|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.spi.commons.batch.ChangeLogImpl
public class ChangeLogImpl
This ChangeLog
implementation simply keeps back all calls to its Batch
methods as
a list of operations
(with item of type Operation
). When applied
to a batch, all operations in the list are applied
to that
batch.
Field Summary | |
---|---|
protected List |
operations
Operation s kept in this change log. |
Constructor Summary | |
---|---|
ChangeLogImpl()
|
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)
This method is called when an operation is added to the list of operations
kept by this change log. |
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. |
Batch |
apply(Batch batch)
Applies the Operation s contained in this change log to
the passed batch . |
boolean |
equals(ChangeLogImpl other)
|
boolean |
equals(Object other)
|
int |
hashCode()
|
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 NodeId s. |
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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final List operations
Operation
s kept in this change log.
Constructor Detail |
---|
public ChangeLogImpl()
Method Detail |
---|
public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, String uuid) throws RepositoryException
Batch
addNode
in interface Batch
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 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
RepositoryException
Node.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
Batch
Note: this call should succeed in case the property already exists.
addProperty
in interface Batch
parentId
- 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
RepositoryException
Node.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
Batch
Note: this call should succeed in case the property already exists.
addProperty
in interface Batch
parentId
- 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
RepositoryException
Node.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
Batch
srcNodeId
to the
new parent identified by destParentNodeId
and change its
name to destName
.
move
in interface Batch
srcNodeId
- 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
RepositoryException
Session.move(String, String)
public void remove(ItemId itemId) throws RepositoryException
Batch
remove
in interface Batch
itemId
- ItemId identifying the item to be removed.
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
Item.remove()
public void reorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId) throws RepositoryException
Batch
NodeId
s.
reorderNodes
in interface Batch
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.
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
AccessDeniedException
RepositoryException
Node.orderBefore(String, String)
public void setMixins(NodeId nodeId, Name[] mixinNodeTypeNames) throws RepositoryException
Batch
setMixins
in interface Batch
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.
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
Node.addMixin(String)
,
Node.removeMixin(String)
public void setValue(PropertyId propertyId, QValue value) throws RepositoryException
Batch
null
value.
Removing a property is achieved by calling Batch.remove(ItemId)
.
setValue
in interface Batch
propertyId
- PropertyId identifying the property to be modified.value
- The new value.
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
Property.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
Batch
null
value. Removing a property is achieved by calling Batch.remove(ItemId)
.
setValue
in interface Batch
propertyId
- PropertyId identifying the property to be modified.values
- The new values.
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
Property.setValue(javax.jcr.Value[])
,
Property.setValue(String[])
public Batch apply(Batch batch) throws RepositoryException
ChangeLog
Operation
s contained in this change log to
the passed batch
.
apply
in interface ChangeLog
batch
passed in as argument with the
operations from this change log applied.
RepositoryException
protected void addOperation(Operation op) throws RepositoryException
operations
kept by this change log.
op
- Operation
to add
RepositoryException
public String toString()
toString
in class Object
public boolean equals(Object other)
equals
in class Object
public boolean equals(ChangeLogImpl other)
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |