public interface DocumentWriter extends PageWriter
EditableDocument
instances, that should be used by connectors
when they want to return the information regarding external nodes.UNKNOWN_TOTAL_SIZE
Modifier and Type | Method and Description |
---|---|
DocumentWriter |
addChild(String id,
Name name)
Add a child with the given id and name to the underlying document.
|
DocumentWriter |
addChild(String id,
String name)
Add a child with the given id and name to the underlying document.
|
DocumentWriter |
addMixinType(Name name)
Adds a mixin type to the underlying document.
|
DocumentWriter |
addMixinType(String name)
Adds a mixin type to the underlying document.
|
DocumentWriter |
addPage(String parentId,
int nextPageOffset,
long blockSize,
long totalChildCount)
Create a reference to a separate page of children in its underlying document.
|
DocumentWriter |
addPage(String parentId,
String nextPageOffset,
long blockSize,
long totalChildCount)
Create a reference to a separate page of children in its underlying document.
|
DocumentWriter |
addProperties(Map<Name,Property> properties)
Adds a map of properties to the the underlying document's properties.
|
DocumentWriter |
addProperty(Name name,
Object value)
Adds a property with the given name and value to the underlying document's properties.
|
DocumentWriter |
addProperty(Name name,
Object[] values)
Adds a multi-value property with the given name to the underlying document's properties.
|
DocumentWriter |
addProperty(Name name,
Object firstValue,
Object... additionalValues)
Adds a multi-value property with the given name to the underlying document's properties.
|
DocumentWriter |
addProperty(String name,
Object value)
Adds a property with the given name and value to the underlying document's properties.
|
DocumentWriter |
addProperty(String name,
Object[] values)
Adds a multi-value property with the given name to the underlying document's properties.
|
DocumentWriter |
addProperty(String name,
Object firstValue,
Object... additionalValues)
Adds a multi-value property with the given name to the underlying document's properties.
|
DocumentWriter |
addPropertyValue(Name name,
Object value)
Adds an additional value to an existing property with the given name.
|
DocumentWriter |
addPropertyValue(String name,
Object value)
Adds an additional value to an existing property with the given name.
|
DocumentWriter |
removeChild(String id)
Remove a child from this document.
|
DocumentWriter |
setCacheable(boolean cacheable)
Sets whether a particular document should be cached by the repository or not.
|
DocumentWriter |
setChildren(LinkedHashMap<String,Name> children)
Set an ordered of (childId, childName) for the underlying document.
|
DocumentWriter |
setChildren(List<? extends Document> children)
Set the list of children for the underlying document.
|
DocumentWriter |
setId(String id)
Sets an identifier string on the underlying document.
|
DocumentWriter |
setNotQueryable()
Sets a flag on the underlying document which indicates that it should not be indexed (and therefore will not appear in
queries) by the repository.
|
DocumentWriter |
setParent(String parentId)
Sets the id of the parent of the underlying document.
|
DocumentWriter |
setParents(List<String> parentIds)
Sets the ids of one or more parents on the underlying document.
|
DocumentWriter |
setParents(String... parentIds)
Sets the ids of one or more parents on the underlying document.
|
DocumentWriter |
setPrimaryType(Name name)
Sets the primary type of the underlying document.
|
DocumentWriter |
setPrimaryType(String name)
Sets the primary type of the underlying document.
|
DocumentWriter |
setProperties(Map<Name,Property> properties)
Replaces the underlying document's properties with the one from the given map.
|
document
DocumentWriter setId(String id)
id
- the identifier of the document; may not be nullDocumentWriter setPrimaryType(String name)
name
- the name of the primary type for the node; may not be nullDocumentWriter setPrimaryType(Name name)
name
- the name of the primary type for the node; may not be nullDocumentWriter addMixinType(String name)
name
- the name of a node type that should be added as a mixin for the node; may not be nullDocumentWriter addMixinType(Name name)
name
- the name of a node type that should be added as a mixin for the node; may not be nullDocumentWriter addProperty(String name, Object value)
name
- the name of the property; may not be nullvalue
- the value for the property; may not be nullDocumentWriter addProperty(Name name, Object value)
name
- the name of the property; may not be nullvalue
- a value for the property; may not be nullDocumentWriter addProperty(String name, Object[] values)
name
- a name of the property; may not be nullvalues
- the values for the property; may not be null but may be emptyDocumentWriter addProperty(Name name, Object[] values)
name
- the name of the property; may not be nullvalues
- the values for the property; may not be null but may be emptyDocumentWriter addProperty(String name, Object firstValue, Object... additionalValues)
name
- the name of the property; may not be nullfirstValue
- the first value for the property; may not be nulladditionalValues
- additional values for the propertyDocumentWriter addProperty(Name name, Object firstValue, Object... additionalValues)
name
- the name of the property; may not be nullfirstValue
- the first value for the property; may not be nulladditionalValues
- additional values for the propertyDocumentWriter addProperties(Map<Name,Property> properties)
properties
- a map of properties keyed by their name; may not be nullDocumentWriter addPropertyValue(String name, Object value)
name
- the name of the property; may not be nullvalue
- the new value that should be added to the property; may not be nullDocumentWriter addPropertyValue(Name name, Object value)
name
- the name of the property; may not be nullvalue
- the new value that should be added to the property; may not be nullDocumentWriter setProperties(Map<Name,Property> properties)
properties
- a map of properties keyed by their name; may not be nullDocumentWriter setParents(String... parentIds)
parentIds
- the array of parent identifiersDocumentWriter setParent(String parentId)
parentId
- the identifier of the parent; may not be nullDocumentWriter setParents(List<String> parentIds)
parentIds
- the list of parent identifiers; may not be nullDocumentWriter setCacheable(boolean cacheable)
cacheable
- a boolean
flagDocumentWriter setNotQueryable()
DocumentWriter addChild(String id, String name)
PageWriter
addChild
in interface PageWriter
id
- the new child's id; may not be nullname
- the new child's name; may not be nullDocumentWriter addChild(String id, Name name)
PageWriter
addChild
in interface PageWriter
id
- the new child's id; may not be nullname
- the new child's name; may not be nullDocumentWriter removeChild(String id)
PageWriter
removeChild
in interface PageWriter
id
- the identifier of the childDocumentWriter setChildren(List<? extends Document> children)
PageWriter
setChildren
in interface PageWriter
children
- a list of EditableDocument
instances each describing a single child; may not be nullDocumentWriter setChildren(LinkedHashMap<String,Name> children)
PageWriter
The passed map does not contain any explicit information about same name siblings, so a connector would need to handle that logic.
setChildren
in interface PageWriter
children
- a map of (childId, childName) pairs; may not be nullDocumentWriter addPage(String parentId, int nextPageOffset, long blockSize, long totalChildCount)
PageWriter
addPage
in interface PageWriter
parentId
- a non-null
String representing the identifier of the parent (owning) documentnextPageOffset
- a non-null
int representing a numeric offset of the next page.blockSize
- an integer which indicates the size of the next block of childrentotalChildCount
- an integer which indicates the total number of children; should be PageWriter.UNKNOWN_TOTAL_SIZE
if
the number of children is unknown, too large to compute efficiently, or to signal that the repository should use the
Connector.getChildReference(String, String)
method to find the child reference for a parent and a (supposed)
child node.Connector.getChildReference(String, String)
DocumentWriter addPage(String parentId, String nextPageOffset, long blockSize, long totalChildCount)
PageWriter
addPage
in interface PageWriter
parentId
- a non-null
String representing the identifier of the parent (owning) documentnextPageOffset
- a non-null
String representing the offset of the next page. The meaning of the offset isn't
defined and it's up to each connector to define it.blockSize
- an integer which indicates the size of the next block of childrentotalChildCount
- an integer which indicates the total number of children; should be PageWriter.UNKNOWN_TOTAL_SIZE
if
the number of children is unknown, too large to compute efficiently, or to signal that the repository should use the
Connector.getChildReference(String, String)
method to find the child reference for a parent and a (supposed)
child node.Connector.getChildReference(String, String)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.