|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.spi.commons.batch.ChangeLogImpl
org.apache.jackrabbit.spi.commons.batch.ConsolidatingChangeLog
public class ConsolidatingChangeLog
A ChangeLog implementation which does basic consolidation on its
Operations. That is, cancelling
operations are removed if possible. In general this is not possible across
move operations. The individual
CancelableOperation implementations document their behavior
concerning cancellation.
| Nested Class Summary | |
|---|---|
protected static interface |
ConsolidatingChangeLog.CancelableOperation
This class represent an Operation which can be cancelled by another operation
or which cancels another operation. |
protected static class |
ConsolidatingChangeLog.CancelableOperations
Factory for creating CancelableOperations. |
| Field Summary |
|---|
| Fields inherited from class org.apache.jackrabbit.spi.commons.batch.ChangeLogImpl |
|---|
operations |
| Constructor Summary | |
|---|---|
ConsolidatingChangeLog()
Create a new instance of a consolidating change log. |
|
| Method Summary | |
|---|---|
void |
addNode(NodeId parentId,
Name nodeName,
Name nodetypeName,
String uuid)
Add a new node to the persistent layer. |
protected void |
addOperation(Operation op)
Determines the cancellation behavior from the list of operations
and the current operation op:
When the current operation is cancelled by the last operation, the list of operations
is not modified. |
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. |
protected static Path |
getPath(ItemId itemId)
Determine the Path from an ItemId. |
protected static Path |
getPath(NodeId parentId,
Name name)
Create a Path from the NodeId of a parent and the Name of a
child. |
void |
move(NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
Move the node identified by the given srcNodeId to the
new parent identified by destParentNodeId and change its
name to destName. |
void |
remove(ItemId itemId)
Remove an existing item. |
void |
reorderNodes(NodeId parentId,
NodeId srcNodeId,
NodeId beforeNodeId)
Modify the order of the child nodes identified by the given NodeIds. |
void |
setMixins(NodeId nodeId,
Name[] mixinNodeTypeNames)
Modify the set of mixin node types present on the node identified by the given id. |
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. |
| Methods inherited from class org.apache.jackrabbit.spi.commons.batch.ChangeLogImpl |
|---|
apply, equals, equals, hashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConsolidatingChangeLog()
| Method Detail |
|---|
protected static Path getPath(NodeId parentId,
Name name)
throws RepositoryException
Path from the NodeId of a parent and the Name of a
child.
parentId - node id of the parentname - name of the child
name
RepositoryExceptionprotected static Path getPath(ItemId itemId)
Path from an ItemId.
itemId -
itemId
public void addNode(NodeId parentId,
Name nodeName,
Name nodetypeName,
String uuid)
throws RepositoryException
Batch
addNode in interface BatchaddNode in class ChangeLogImplparentId - 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 or
null. 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 be null.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
NoSuchNodeTypeException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionNode.addNode(String),
Node.addNode(String, String),
Session.importXML(String, java.io.InputStream, int),
Query.storeAsNode(String)
public void addProperty(NodeId parentId,
Name propertyName,
QValue value)
throws RepositoryException
BatchNote: this call should succeed in case the property already exists.
addProperty in interface BatchaddProperty in class ChangeLogImplparentId - NodeId identifying the parent node.propertyName - Name of the property to be created.value - The qualified value of the property to be created.
ValueFormatException
VersionException
LockException
ConstraintViolationException
PathNotFoundException
ItemExistsException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionNode.setProperty(String, javax.jcr.Value),
Node.setProperty(String, javax.jcr.Value, int),
Node.setProperty(String, String),
Node.setProperty(String, String, int),
Node.setProperty(String, java.util.Calendar),
Node.setProperty(String, boolean),
Node.setProperty(String, double),
Node.setProperty(String, long),
Node.setProperty(String, javax.jcr.Node),
Session.importXML(String, java.io.InputStream, int),
Query.storeAsNode(String)
public void addProperty(NodeId parentId,
Name propertyName,
QValue[] values)
throws RepositoryException
BatchNote: this call should succeed in case the property already exists.
addProperty in interface BatchaddProperty in class ChangeLogImplparentId - NodeId identifying the parent node.propertyName - Name of the property to be created.values - The qualified values of the property to be created.
ValueFormatException
VersionException
LockException
ConstraintViolationException
PathNotFoundException
ItemExistsException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionNode.setProperty(String, javax.jcr.Value[]),
Node.setProperty(String, javax.jcr.Value[], int),
Node.setProperty(String, String[]),
Node.setProperty(String, String[], int),
Session.importXML(String, java.io.InputStream, int)
public void move(NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
throws RepositoryException
BatchsrcNodeId to the
new parent identified by destParentNodeId and change its
name to destName.
move in interface Batchmove in class ChangeLogImplsrcNodeId - NodeId identifying the node to be moved.destParentNodeId - NodeId identifying the new parent.destName - The new name of the moved node.
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionSession.move(String, String)
public void remove(ItemId itemId)
throws RepositoryException
Batch
remove in interface Batchremove in class ChangeLogImplitemId - ItemId identifying the item to be removed.
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionItem.remove()
public void reorderNodes(NodeId parentId,
NodeId srcNodeId,
NodeId beforeNodeId)
throws RepositoryException
BatchNodeIds.
reorderNodes in interface BatchreorderNodes in class ChangeLogImplparentId - 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.
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
AccessDeniedException
RepositoryExceptionNode.orderBefore(String, String)
public void setMixins(NodeId nodeId,
Name[] mixinNodeTypeNames)
throws RepositoryException
Batch
setMixins in interface BatchsetMixins in class ChangeLogImplnodeId - 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.
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionNode.addMixin(String),
Node.removeMixin(String)
public void setValue(PropertyId propertyId,
QValue value)
throws RepositoryException
Batchnull value.
Removing a property is achieved by calling Batch.remove(ItemId).
setValue in interface BatchsetValue in class ChangeLogImplpropertyId - PropertyId identifying the property to be modified.value - The new value.
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionProperty.setValue(javax.jcr.Value),
Property.setValue(String),
Property.setValue(long),
Property.setValue(double),
Property.setValue(java.util.Calendar),
Property.setValue(boolean),
Property.setValue(javax.jcr.Node)
public void setValue(PropertyId propertyId,
QValue[] values)
throws RepositoryException
Batchnull
value. Removing a property is achieved by calling Batch.remove(ItemId).
setValue in interface BatchsetValue in class ChangeLogImplpropertyId - PropertyId identifying the property to be modified.values - The new values.
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryExceptionProperty.setValue(javax.jcr.Value[]),
Property.setValue(String[])
protected void addOperation(Operation op)
throws RepositoryException
operations
and the current operation op:
addOperation in class ChangeLogImplop - Operation to add
RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||