Class SerializableBatch
java.lang.Object
org.apache.jackrabbit.spi.commons.SerializableBatch
- All Implemented Interfaces:
Serializable,Batch
SerializableBatch implements a serializable SPI Batch, which
simply records all calls and replays them when asked for. The client of
this batch must ensure that the passed QValue instances are
serializable, otherwise the serializing the Batch will fail!- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a new node to the persistent layer.voidaddProperty(NodeId parentId, Name propertyName, QValue value) Add a new property to the persistent layer.voidaddProperty(NodeId parentId, Name propertyName, QValue[] values) Add a new multi-valued property to the persistent layer.voidMove the node identified by the givensrcNodeIdto the new parent identified bydestParentNodeIdand change its name todestName.voidRemove an existing item.voidreorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId) Modify the order of the child nodes identified by the givenNodeIds.voidReplays this batch on the givenbatch.voidModify the set of mixin node types present on the node identified by the given id.voidsetPrimaryType(NodeId nodeId, Name primaryNodeTypeName) Change the primary type of the node identified by the givennodeId.voidAdd a new content tree to the persistent layer.voidsetValue(PropertyId propertyId, QValue value) Modify the value of an existing property.voidsetValue(PropertyId propertyId, QValue[] values) Modify the value of an existing, multi-valued property.
-
Constructor Details
-
SerializableBatch
Creates a newSerializableBatch.- Parameters:
itemId- the id of the item where save was called. To indicate that save was called on the session, the id of the root node must be passed.
-
-
Method Details
-
getSaveTarget
- Returns:
- the item id where save was called for this batch.
-
replay
public void replay(Batch batch) throws PathNotFoundException, ItemNotFoundException, NoSuchNodeTypeException, ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException Replays this batch on the givenbatch. For a description of the exception seeRepositoryService.submit(Batch). -
addNode
Description copied from interface:BatchAdd a new node to the persistent layer.- Specified by:
addNodein interfaceBatch- Parameters:
parentId- NodeId identifying the parent node.nodeName- Name of the node to be created.nodetypeName- Primary node type name of the node to be created.uuid- Value for the jcr:uuid property of the node to be created ornull. If due to an import the uuid of the resulting node is already defined, it must be passed as separate uuid parameter, indicating a binding value for the server. Otherwise the uuid must benull.- See Also:
-
addProperty
Description copied from interface:BatchAdd a new property to the persistent layer.Note: this call should succeed in case the property already exists.
- Specified by:
addPropertyin interfaceBatch- Parameters:
parentId- NodeId identifying the parent node.propertyName- Name of the property to be created.value- The value of the property to be created.- See Also:
-
addProperty
Description copied from interface:BatchAdd a new multi-valued property to the persistent layer.Note: this call should succeed in case the property already exists.
- Specified by:
addPropertyin interfaceBatch- Parameters:
parentId- NodeId identifying the parent node.propertyName- Name of the property to be created.values- The values of the property to be created.- See Also:
-
setValue
Description copied from interface:BatchModify the value of an existing property. Note that in contrast to the JCR API this method should not accept anullvalue. Removing a property is achieved by callingBatch.remove(ItemId). -
setValue
Description copied from interface:BatchModify the value of an existing, multi-valued property. Note that in contrast to the JCR API this method should not accept anullvalue. Removing a property is achieved by callingBatch.remove(ItemId). -
remove
Description copied from interface:BatchRemove an existing item. -
reorderNodes
Description copied from interface:BatchModify the order of the child nodes identified by the givenNodeIds.- Specified by:
reorderNodesin interfaceBatch- Parameters:
parentId- NodeId identifying the parent node.srcNodeId- NodeId identifying the node to be reordered.beforeNodeId- NodeId identifying the child node, before which the source node must be placed.- See Also:
-
setMixins
Description copied from interface:BatchModify the set of mixin node types present on the node identified by the given id. -
setPrimaryType
Description copied from interface:BatchChange the primary type of the node identified by the givennodeId.- Specified by:
setPrimaryTypein interfaceBatch- Parameters:
nodeId- NodeId identifying the node to be modified.primaryNodeTypeName-- Throws:
RepositoryException- See Also:
-
move
Description copied from interface:BatchMove the node identified by the givensrcNodeIdto the new parent identified bydestParentNodeIdand change its name todestName. -
setTree
Description copied from interface:BatchAdd a new content tree to the persistent layer.- Specified by:
setTreein interfaceBatch- Parameters:
parentId-contentTree-- Throws:
RepositoryException
-