org.apache.jackrabbit.spi.commons
Class SerializableBatch

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.SerializableBatch
All Implemented Interfaces:
Serializable, org.apache.jackrabbit.spi.Batch

public class SerializableBatch
extends Object
implements org.apache.jackrabbit.spi.Batch, 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!

See Also:
Serialized Form

Nested Class Summary
static interface SerializableBatch.Operation
           
 
Constructor Summary
SerializableBatch(org.apache.jackrabbit.spi.ItemId itemId)
          Creates a new SerializableBatch.
 
Method Summary
 void addNode(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name nodeName, org.apache.jackrabbit.spi.Name nodetypeName, String uuid)
           
 void addProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue value)
           
 void addProperty(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.Name propertyName, org.apache.jackrabbit.spi.QValue[] values)
           
 org.apache.jackrabbit.spi.ItemId getSaveTarget()
           
 void move(org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId destParentNodeId, org.apache.jackrabbit.spi.Name destName)
           
 void remove(org.apache.jackrabbit.spi.ItemId itemId)
           
 void reorderNodes(org.apache.jackrabbit.spi.NodeId parentId, org.apache.jackrabbit.spi.NodeId srcNodeId, org.apache.jackrabbit.spi.NodeId beforeNodeId)
           
 void replay(org.apache.jackrabbit.spi.Batch batch)
          Replays this batch on the given batch.
 void setMixins(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name[] mixinNodeTypeIds)
           
 void setPrimaryType(org.apache.jackrabbit.spi.NodeId nodeId, org.apache.jackrabbit.spi.Name primaryNodeTypeName)
           
 void setValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue value)
           
 void setValue(org.apache.jackrabbit.spi.PropertyId propertyId, org.apache.jackrabbit.spi.QValue[] values)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableBatch

public SerializableBatch(org.apache.jackrabbit.spi.ItemId itemId)
Creates a new SerializableBatch.

Parameters:
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

getSaveTarget

public org.apache.jackrabbit.spi.ItemId getSaveTarget()
Returns:
the item id where save was called for this batch.

replay

public void replay(org.apache.jackrabbit.spi.Batch batch)
            throws PathNotFoundException,
                   ItemNotFoundException,
                   NoSuchNodeTypeException,
                   ValueFormatException,
                   VersionException,
                   LockException,
                   ConstraintViolationException,
                   AccessDeniedException,
                   UnsupportedRepositoryOperationException,
                   RepositoryException
Replays this batch on the given batch. For a description of the exception see RepositoryService.submit(Batch).

Parameters:
batch - the target batch.
Throws:
PathNotFoundException
ItemNotFoundException
NoSuchNodeTypeException
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException

addNode

public void addNode(org.apache.jackrabbit.spi.NodeId parentId,
                    org.apache.jackrabbit.spi.Name nodeName,
                    org.apache.jackrabbit.spi.Name nodetypeName,
                    String uuid)
Specified by:
addNode in interface org.apache.jackrabbit.spi.Batch

addProperty

public void addProperty(org.apache.jackrabbit.spi.NodeId parentId,
                        org.apache.jackrabbit.spi.Name propertyName,
                        org.apache.jackrabbit.spi.QValue value)
Specified by:
addProperty in interface org.apache.jackrabbit.spi.Batch

addProperty

public void addProperty(org.apache.jackrabbit.spi.NodeId parentId,
                        org.apache.jackrabbit.spi.Name propertyName,
                        org.apache.jackrabbit.spi.QValue[] values)
Specified by:
addProperty in interface org.apache.jackrabbit.spi.Batch

setValue

public void setValue(org.apache.jackrabbit.spi.PropertyId propertyId,
                     org.apache.jackrabbit.spi.QValue value)
Specified by:
setValue in interface org.apache.jackrabbit.spi.Batch

setValue

public void setValue(org.apache.jackrabbit.spi.PropertyId propertyId,
                     org.apache.jackrabbit.spi.QValue[] values)
Specified by:
setValue in interface org.apache.jackrabbit.spi.Batch

remove

public void remove(org.apache.jackrabbit.spi.ItemId itemId)
Specified by:
remove in interface org.apache.jackrabbit.spi.Batch

reorderNodes

public void reorderNodes(org.apache.jackrabbit.spi.NodeId parentId,
                         org.apache.jackrabbit.spi.NodeId srcNodeId,
                         org.apache.jackrabbit.spi.NodeId beforeNodeId)
Specified by:
reorderNodes in interface org.apache.jackrabbit.spi.Batch

setMixins

public void setMixins(org.apache.jackrabbit.spi.NodeId nodeId,
                      org.apache.jackrabbit.spi.Name[] mixinNodeTypeIds)
Specified by:
setMixins in interface org.apache.jackrabbit.spi.Batch

setPrimaryType

public void setPrimaryType(org.apache.jackrabbit.spi.NodeId nodeId,
                           org.apache.jackrabbit.spi.Name primaryNodeTypeName)
                    throws RepositoryException
Specified by:
setPrimaryType in interface org.apache.jackrabbit.spi.Batch
Throws:
RepositoryException

move

public void move(org.apache.jackrabbit.spi.NodeId srcNodeId,
                 org.apache.jackrabbit.spi.NodeId destParentNodeId,
                 org.apache.jackrabbit.spi.Name destName)
Specified by:
move in interface org.apache.jackrabbit.spi.Batch


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.