Class ConsolidatingChangeLog
java.lang.Object
org.apache.jackrabbit.spi.commons.batch.AbstractChangeLog<org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog.CancelableOperation>
org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog
public class ConsolidatingChangeLog
extends AbstractChangeLog<org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog.CancelableOperation>
-
Constructor Summary
ConstructorDescriptionCreate a new instance of a consolidating change log. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new node to the persistent layer.void
addOperation
(org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog.CancelableOperation op) Determines the cancellation behavior from the list ofoperations
and the current operationop
: When the current operation is cancelled by the last operation, the list of operations is not modified. When the current operation and the last operation cancel each other, the last operation is removed from the list of operations. When the last operation is cancelled by this operation, the last operation is removed from the list of operations and determination of cancellation starts from scratch. Otherwise add the current operation to the list of operations.void
addProperty
(NodeId parentId, Name propertyName, QValue value) Add a new property to the persistent layer.void
addProperty
(NodeId parentId, Name propertyName, QValue[] values) Add a new multi-valued property to the persistent layer.void
Move the node identified by the givensrcNodeId
to the new parent identified bydestParentNodeId
and change its name todestName
.void
Remove an existing item.void
reorderNodes
(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId) Modify the order of the child nodes identified by the givenNodeId
s.void
Modify the set of mixin node types present on the node identified by the given id.void
setPrimaryType
(NodeId nodeId, Name primaryNodeTypeName) Change the primary type of the node identified by the givennodeId
.void
Add a new content tree to the persistent layer.void
setValue
(PropertyId propertyId, QValue value) Modify the value of an existing property.void
setValue
(PropertyId propertyId, QValue[] values) Modify the value of an existing, multi-valued property.
-
Constructor Details
-
ConsolidatingChangeLog
public ConsolidatingChangeLog()Create a new instance of a consolidating change log.
-
-
Method Details
-
addNode
public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, String uuid) throws RepositoryException Description copied from interface:Batch
Add a new node to the persistent layer.- 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
.- Throws:
RepositoryException
- See Also:
-
addProperty
public void addProperty(NodeId parentId, Name propertyName, QValue value) throws RepositoryException Description copied from interface:Batch
Add a new property to the persistent layer.Note: this call should succeed in case the property already exists.
- Parameters:
parentId
- NodeId identifying the parent node.propertyName
- Name of the property to be created.value
- The value of the property to be created.- Throws:
RepositoryException
- See Also:
-
addProperty
public void addProperty(NodeId parentId, Name propertyName, QValue[] values) throws RepositoryException Description copied from interface:Batch
Add a new multi-valued property to the persistent layer.Note: this call should succeed in case the property already exists.
- Parameters:
parentId
- NodeId identifying the parent node.propertyName
- Name of the property to be created.values
- The values of the property to be created.- Throws:
RepositoryException
- See Also:
-
move
public void move(NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException Description copied from interface:Batch
Move the node identified by the givensrcNodeId
to the new parent identified bydestParentNodeId
and change its name todestName
.- Parameters:
srcNodeId
- NodeId identifying the node to be moved.destParentNodeId
- NodeId identifying the new parent.destName
- The new name of the moved node.- Throws:
RepositoryException
- See Also:
-
remove
Description copied from interface:Batch
Remove an existing item.- Parameters:
itemId
- ItemId identifying the item to be removed.- Throws:
RepositoryException
- See Also:
-
reorderNodes
public void reorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId) throws RepositoryException Description copied from interface:Batch
Modify the order of the child nodes identified by the givenNodeId
s.- 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.- Throws:
RepositoryException
- See Also:
-
setMixins
Description copied from interface:Batch
Modify the set of mixin node types present on the node identified by the given id.- Parameters:
nodeId
- NodeId identifying the node to be modified.mixinNodeTypeNames
- The new set of mixin types. Compared to the previous values this may result in both adding and/or removing mixin types.- Throws:
RepositoryException
- See Also:
-
setPrimaryType
Description copied from interface:Batch
Change the primary type of the node identified by the givennodeId
.- Parameters:
nodeId
- NodeId identifying the node to be modified.primaryNodeTypeName
-- Throws:
RepositoryException
- See Also:
-
setValue
Description copied from interface:Batch
Modify the value of an existing property. Note that in contrast to the JCR API this method should not accept anull
value. Removing a property is achieved by callingBatch.remove(ItemId)
.- Parameters:
propertyId
- PropertyId identifying the property to be modified.value
- The new value.- Throws:
RepositoryException
- See Also:
-
setValue
Description copied from interface:Batch
Modify the value of an existing, multi-valued property. Note that in contrast to the JCR API this method should not accept anull
value. Removing a property is achieved by callingBatch.remove(ItemId)
.- Parameters:
propertyId
- PropertyId identifying the property to be modified.values
- The new values.- Throws:
RepositoryException
- See Also:
-
setTree
Description copied from interface:Batch
Add a new content tree to the persistent layer.- Parameters:
parentId
-contentTree
-- Throws:
RepositoryException
-
addOperation
public void addOperation(org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog.CancelableOperation op) throws RepositoryException Determines the cancellation behavior from the list ofoperations
and the current operationop
:- When the current operation is cancelled by the last operation, the list of operations is not modified.
- When the current operation and the last operation cancel each other, the last operation is removed from the list of operations.
- When the last operation is cancelled by this operation, the last operation is removed from the list of operations and determination of cancellation starts from scratch.
- Otherwise add the current operation to the list of operations.
- Overrides:
addOperation
in classAbstractChangeLog<org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog.CancelableOperation>
- Parameters:
op
-Operation
to add- Throws:
RepositoryException
-