public class SerializableBatch extends java.lang.Object implements Batch, java.io.Serializable
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!Modifier and Type | Class and Description |
---|---|
static interface |
SerializableBatch.Operation |
Constructor and Description |
---|
SerializableBatch(ItemId itemId)
Creates a new
SerializableBatch . |
Modifier and Type | Method and Description |
---|---|
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
NodeId s. |
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 |
setPrimaryType(NodeId nodeId,
Name primaryNodeTypeName)
Change the primary type of the node identified by the given
nodeId . |
void |
setTree(NodeId parentId,
Tree contentTree)
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.
|
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.public ItemId getSaveTarget()
public void replay(Batch batch) throws PathNotFoundException, ItemNotFoundException, NoSuchNodeTypeException, ValueFormatException, VersionException, LockException, ConstraintViolationException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException
batch
. For a description of
the exception see RepositoryService.submit(Batch)
.batch
- the target batch.PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, java.lang.String uuid)
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
.javax.jcr.Node#addNode(String)
,
javax.jcr.Node#addNode(String, String)
,
javax.jcr.Session#importXML(String, java.io.InputStream, int)
,
javax.jcr.query.Query#storeAsNode(String)
public void addProperty(NodeId parentId, Name propertyName, QValue value)
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 value of the property to be created.javax.jcr.Node#setProperty(String, javax.jcr.Value)
,
javax.jcr.Node#setProperty(String, javax.jcr.Value, int)
,
javax.jcr.Node#setProperty(String, String)
,
javax.jcr.Node#setProperty(String, String, int)
,
javax.jcr.Node#setProperty(String, java.util.Calendar)
,
javax.jcr.Node#setProperty(String, boolean)
,
javax.jcr.Node#setProperty(String, double)
,
javax.jcr.Node#setProperty(String, long)
,
javax.jcr.Node#setProperty(String, javax.jcr.Node)
,
javax.jcr.Session#importXML(String, java.io.InputStream, int)
,
javax.jcr.query.Query#storeAsNode(String)
public void addProperty(NodeId parentId, Name propertyName, QValue[] values)
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 values of the property to be created.javax.jcr.Node#setProperty(String, javax.jcr.Value[])
,
javax.jcr.Node#setProperty(String, javax.jcr.Value[], int)
,
javax.jcr.Node#setProperty(String, String[])
,
javax.jcr.Node#setProperty(String, String[], int)
,
javax.jcr.Session#importXML(String, java.io.InputStream, int)
public void setValue(PropertyId propertyId, QValue value)
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.javax.jcr.Property#setValue(javax.jcr.Value)
,
javax.jcr.Property#setValue(String)
,
javax.jcr.Property#setValue(long)
,
javax.jcr.Property#setValue(double)
,
javax.jcr.Property#setValue(java.util.Calendar)
,
javax.jcr.Property#setValue(boolean)
,
javax.jcr.Property#setValue(javax.jcr.Node)
public void setValue(PropertyId propertyId, QValue[] values)
Batch
null
value. Removing a property is achieved by calling Batch.remove(ItemId)
.public void remove(ItemId itemId)
Batch
public void reorderNodes(NodeId parentId, NodeId srcNodeId, NodeId beforeNodeId)
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.javax.jcr.Node#orderBefore(String, String)
public void setMixins(NodeId nodeId, Name[] mixinNodeTypeIds)
Batch
setMixins
in interface Batch
nodeId
- 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.javax.jcr.Node#addMixin(String)
,
javax.jcr.Node#removeMixin(String)
public void setPrimaryType(NodeId nodeId, Name primaryNodeTypeName) throws RepositoryException
Batch
nodeId
.setPrimaryType
in interface Batch
nodeId
- NodeId identifying the node to be modified.RepositoryException
javax.jcr.Node#setPrimaryType(String)
public void move(NodeId srcNodeId, NodeId destParentNodeId, Name destName)
Batch
srcNodeId
to the
new parent identified by destParentNodeId
and change its
name to destName
."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"