org.apache.jackrabbit.spi.commons.logging
Class BatchLogger

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.logging.AbstractLogger
      extended by org.apache.jackrabbit.spi.commons.logging.BatchLogger
All Implemented Interfaces:
Batch

public class BatchLogger
extends AbstractLogger
implements Batch

Log wrapper for a Batch.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
AbstractLogger.Callable, AbstractLogger.SafeCallable
 
Field Summary
 
Fields inherited from class org.apache.jackrabbit.spi.commons.logging.AbstractLogger
writer
 
Constructor Summary
BatchLogger(Batch batch, LogWriter writer)
          Create a new instance for the given batch which uses writer for persisting log messages.
 
Method Summary
 void addNode(NodeId parentId, Name nodeName, Name nodetypeName, 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.
 Batch getBatch()
           
 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 setPrimaryType(NodeId nodeId, Name primaryNodeTypeName)
          Change the primary type of the node identified by the given nodeId.
 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.logging.AbstractLogger
execute, execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchLogger

public BatchLogger(Batch batch,
                   LogWriter writer)
Create a new instance for the given batch which uses writer for persisting log messages.

Parameters:
batch -
writer -
Method Detail

getBatch

public Batch getBatch()
Returns:
the wrapped Batch

addNode

public void addNode(NodeId parentId,
                    Name nodeName,
                    Name nodetypeName,
                    String uuid)
             throws RepositoryException
Description copied from interface: Batch
Add a new node to the persistent layer.

Specified by:
addNode in interface Batch
Parameters:
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.
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
NoSuchNodeTypeException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Node.addNode(String), Node.addNode(String, String), Session.importXML(String, java.io.InputStream, int), Query.storeAsNode(String)

addProperty

public void addProperty(NodeId parentId,
                        Name propertyName,
                        QValue value)
                 throws RepositoryException
Description copied from interface: Batch
Add a new property to the persistent layer.

Note: this call should succeed in case the property already exists.

Specified by:
addProperty in interface Batch
Parameters:
parentId - NodeId identifying the parent node.
propertyName - Name of the property to be created.
value - The value of the property to be created.
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
PathNotFoundException
ItemExistsException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
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)

addProperty

public void addProperty(NodeId parentId,
                        Name propertyName,
                        QValue[] values)
                 throws RepositoryException
Description copied from interface: Batch
Add a new multi-valued property to the persistent layer.

Note: this call should succeed in case the property already exists.

Specified by:
addProperty in interface Batch
Parameters:
parentId - NodeId identifying the parent node.
propertyName - Name of the property to be created.
values - The values of the property to be created.
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
PathNotFoundException
ItemExistsException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
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)

setValue

public void setValue(PropertyId propertyId,
                     QValue value)
              throws RepositoryException
Description copied from interface: Batch
Modify the value of an existing property. Note that in contrast to the JCR API this method should not accept a null value. Removing a property is achieved by calling Batch.remove(ItemId).

Specified by:
setValue in interface Batch
Parameters:
propertyId - PropertyId identifying the property to be modified.
value - The new value.
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
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)

setValue

public void setValue(PropertyId propertyId,
                     QValue[] values)
              throws RepositoryException
Description copied from interface: Batch
Modify the value of an existing, multi-valued property. Note that in contrast to the JCR API this method should not accept a null value. Removing a property is achieved by calling Batch.remove(ItemId).

Specified by:
setValue in interface Batch
Parameters:
propertyId - PropertyId identifying the property to be modified.
values - The new values.
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Property.setValue(javax.jcr.Value[]), Property.setValue(String[])

remove

public void remove(ItemId itemId)
            throws RepositoryException
Description copied from interface: Batch
Remove an existing item.

Specified by:
remove in interface Batch
Parameters:
itemId - ItemId identifying the item to be removed.
Throws:
VersionException
LockException
ConstraintViolationException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Item.remove()

reorderNodes

public void reorderNodes(NodeId parentId,
                         NodeId srcNodeId,
                         NodeId beforeNodeId)
                  throws RepositoryException
Description copied from interface: Batch
Modify the order of the child nodes identified by the given NodeIds.

Specified by:
reorderNodes in interface Batch
Parameters:
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.
Throws:
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
AccessDeniedException
RepositoryException
See Also:
Node.orderBefore(String, String)

setMixins

public void setMixins(NodeId nodeId,
                      Name[] mixinNodeTypeNames)
               throws RepositoryException
Description copied from interface: Batch
Modify the set of mixin node types present on the node identified by the given id.

Specified by:
setMixins in interface Batch
Parameters:
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.
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Node.addMixin(String), Node.removeMixin(String)

setPrimaryType

public void setPrimaryType(NodeId nodeId,
                           Name primaryNodeTypeName)
                    throws RepositoryException
Description copied from interface: Batch
Change the primary type of the node identified by the given nodeId.

Specified by:
setPrimaryType in interface Batch
Parameters:
nodeId - NodeId identifying the node to be modified.
Throws:
RepositoryException
See Also:
Node.setPrimaryType(String)

move

public void move(NodeId srcNodeId,
                 NodeId destParentNodeId,
                 Name destName)
          throws RepositoryException
Description copied from interface: Batch
Move the node identified by the given srcNodeId to the new parent identified by destParentNodeId and change its name to destName.

Specified by:
move in interface Batch
Parameters:
srcNodeId - NodeId identifying the node to be moved.
destParentNodeId - NodeId identifying the new parent.
destName - The new name of the moved node.
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
AccessDeniedException
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Session.move(String, String)


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