|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.spi.commons.SerializableBatch
public class SerializableBatch
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!
| Nested Class Summary | |
|---|---|
static interface |
SerializableBatch.Operation
|
| Constructor Summary | |
|---|---|
SerializableBatch(ItemId itemId)
Creates a new SerializableBatch. |
|
| Method Summary | |
|---|---|
void |
addNode(NodeId parentId,
Name nodeName,
Name nodetypeName,
java.lang.String uuid)
Add a new node to the persistent layer. |
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. |
ItemId |
getSaveTarget()
|
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 |
replay(Batch batch)
Replays this batch on the given batch. |
void |
setMixins(NodeId nodeId,
Name[] mixinNodeTypeIds)
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SerializableBatch(ItemId itemId)
SerializableBatch.
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 Detail |
|---|
public ItemId getSaveTarget()
public void replay(Batch batch)
throws javax.jcr.PathNotFoundException,
javax.jcr.ItemNotFoundException,
javax.jcr.nodetype.NoSuchNodeTypeException,
javax.jcr.ValueFormatException,
javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.AccessDeniedException,
javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
batch. For a description of
the exception see RepositoryService.submit(Batch).
batch - the target batch.
javax.jcr.PathNotFoundException
javax.jcr.ItemNotFoundException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public void addNode(NodeId parentId,
Name nodeName,
Name nodetypeName,
java.lang.String uuid)
Batch
addNode in interface BatchparentId - 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.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)
BatchNote: this call should succeed in case the property already exists.
addProperty in interface BatchparentId - NodeId identifying the parent node.propertyName - Name of the property to be created.value - The qualified value of the property to be created.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)
BatchNote: this call should succeed in case the property already exists.
addProperty in interface BatchparentId - NodeId identifying the parent node.propertyName - Name of the property to be created.values - The qualified values of the property to be created.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 setValue(PropertyId propertyId,
QValue value)
Batchnull value.
Removing a property is achieved by calling Batch.remove(ItemId).
setValue in interface BatchpropertyId - PropertyId identifying the property to be modified.value - The new value.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)
Batchnull
value. Removing a property is achieved by calling Batch.remove(ItemId).
setValue in interface BatchpropertyId - PropertyId identifying the property to be modified.values - The new values.Property.setValue(javax.jcr.Value[]),
Property.setValue(String[])public void remove(ItemId itemId)
Batch
remove in interface BatchitemId - ItemId identifying the item to be removed.Item.remove()
public void reorderNodes(NodeId parentId,
NodeId srcNodeId,
NodeId beforeNodeId)
BatchNodeIds.
reorderNodes in interface BatchparentId - 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.Node.orderBefore(String, String)
public void setMixins(NodeId nodeId,
Name[] mixinNodeTypeIds)
Batch
setMixins in interface BatchnodeId - NodeId identifying the node to be modified.mixinNodeTypeIds - The new set of mixin types. Compared to the
previous values this may result in both adding and/or removing mixin types.Node.addMixin(String),
Node.removeMixin(String)
public void move(NodeId srcNodeId,
NodeId destParentNodeId,
Name destName)
BatchsrcNodeId to the
new parent identified by destParentNodeId and change its
name to destName.
move in interface BatchsrcNodeId - NodeId identifying the node to be moved.destParentNodeId - NodeId identifying the new parent.destName - The new name of the moved node.Session.move(String, String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||