Class ConsolidatingChangeLog
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.batch.AbstractChangeLog<ConsolidatingChangeLog.CancelableOperation>
-
- org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog
-
- All Implemented Interfaces:
org.apache.jackrabbit.spi.Batch,ChangeLog
public class ConsolidatingChangeLog extends AbstractChangeLog<ConsolidatingChangeLog.CancelableOperation>
AChangeLogimplementation which does basic consolidation on itsOperations. That is, cancelling operations are removed if possible. In general this is not possible acrossmoveoperations. The individualCancelableOperationimplementations document their behavior concerning cancellation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceConsolidatingChangeLog.CancelableOperationThis class represent anOperationwhich can be cancelled by another operation or which cancels another operation.protected static classConsolidatingChangeLog.CancelableOperationsFactory for creatingCancelableOperations.
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.spi.commons.batch.AbstractChangeLog
operations
-
-
Constructor Summary
Constructors Constructor Description ConsolidatingChangeLog()Create a new instance of a consolidating change log.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNode(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name nodeName, org.apache.jackrabbit.spi.Name nodetypeName, String uuid)voidaddOperation(ConsolidatingChangeLog.CancelableOperation op)Determines the cancellation behavior from the list ofoperationsand 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.voidaddProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue value)voidaddProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue[] values)protected static org.apache.jackrabbit.spi.PathgetPath(org.apache.jackrabbit.spi.ItemId itemId)Determine thePathfrom anItemId.protected static org.apache.jackrabbit.spi.PathgetPath(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name name)Create aPathfrom theNodeIdof a parent and theNameof a child.voidmove(org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId destParentNodeId, org.apache.jackrabbit.spi.Name destName)voidremove(org.apache.jackrabbit.spi.ItemId itemId)voidreorderNodes(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId beforeNodeId)voidsetMixins(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name[] mixinNodeTypeNames)voidsetPrimaryType(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name primaryNodeTypeName)voidsetTree(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Tree contentTree)voidsetValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue value)voidsetValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue[] values)
-
-
-
Method Detail
-
getPath
protected static org.apache.jackrabbit.spi.Path getPath(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name name) throws RepositoryExceptionCreate aPathfrom theNodeIdof a parent and theNameof a child.- Parameters:
parentId- node id of the parentname- name of the child- Returns:
- the path of the item
nameornullifparentId's path is not absolute - Throws:
RepositoryException
-
getPath
protected static org.apache.jackrabbit.spi.Path getPath(org.apache.jackrabbit.spi.ItemId itemId)
Determine thePathfrom anItemId.- Parameters:
itemId-- Returns:
- path of the item
itemIdornullifitemId's path is not absolute
-
addNode
public void addNode(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name nodeName, org.apache.jackrabbit.spi.Name nodetypeName, String uuid) throws RepositoryException- Throws:
RepositoryException
-
addProperty
public void addProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue value) throws RepositoryException- Throws:
RepositoryException
-
addProperty
public void addProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue[] values) throws RepositoryException- Throws:
RepositoryException
-
move
public void move(org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId destParentNodeId, org.apache.jackrabbit.spi.Name destName) throws RepositoryException- Throws:
RepositoryException
-
remove
public void remove(org.apache.jackrabbit.spi.ItemId itemId) throws RepositoryException- Throws:
RepositoryException
-
reorderNodes
public void reorderNodes(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId beforeNodeId) throws RepositoryException- Throws:
RepositoryException
-
setMixins
public void setMixins(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name[] mixinNodeTypeNames) throws RepositoryException- Throws:
RepositoryException
-
setPrimaryType
public void setPrimaryType(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name primaryNodeTypeName) throws RepositoryException- Throws:
RepositoryException
-
setValue
public void setValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue value) throws RepositoryException- Throws:
RepositoryException
-
setValue
public void setValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue[] values) throws RepositoryException- Throws:
RepositoryException
-
setTree
public void setTree(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Tree contentTree) throws RepositoryException- Throws:
RepositoryException
-
addOperation
public void addOperation(ConsolidatingChangeLog.CancelableOperation op) throws RepositoryException
Determines the cancellation behavior from the list ofoperationsand 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:
addOperationin classAbstractChangeLog<ConsolidatingChangeLog.CancelableOperation>- Parameters:
op-Operationto add- Throws:
RepositoryException
-
-