org.apache.jackrabbit.jcr2spi.state
Class SessionItemStateManager

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager
All Implemented Interfaces:
OperationVisitor, UpdatableItemStateManager

public class SessionItemStateManager
extends Object
implements UpdatableItemStateManager, OperationVisitor

SessionItemStateManager ...


Constructor Summary
SessionItemStateManager(UpdatableItemStateManager workspaceItemStateMgr, ItemStateValidator validator, QValueFactory qValueFactory, ItemStateFactory isf, ManagerProvider mgrProvider)
          Creates a new SessionItemStateManager instance.
 
Method Summary
 void adjustReferences(ReferenceChangeTracker refTracker)
          Adjust references at the end of a successful XML import.
 void dispose()
          Disposes this UpdatableItemStateManager and frees resources.
 void execute(ChangeLog changes)
          Executes the operations passed with the given change log and modifies the affected item states accordingly.
 void execute(Operation operation)
          Executes the given operation and modifies the affected item states accordingly.
 boolean hasPendingChanges()
           
 void save(ItemState state)
          This will save state and all descendants items of state that are transiently modified in a single step.
 void undo(ItemState itemState)
          This will undo all changes made to state and descendant items of state inside this item state manager.
 void visit(AddLabel operation)
           
 void visit(AddNode operation)
           
 void visit(AddProperty operation)
           
 void visit(Checkin operation)
           
 void visit(Checkout operation)
           
 void visit(Clone operation)
           
 void visit(Copy operation)
           
 void visit(LockOperation operation)
           
 void visit(LockRefresh operation)
           
 void visit(LockRelease operation)
           
 void visit(Merge operation)
           
 void visit(Move operation)
           
 void visit(Remove operation)
           
 void visit(RemoveLabel operation)
           
 void visit(RemoveVersion operation)
           
 void visit(ReorderNodes operation)
           
 void visit(ResolveMergeConflict operation)
           
 void visit(Restore operation)
           
 void visit(SetMixin operation)
           
 void visit(SetPropertyValue operation)
           
 void visit(Update operation)
           
 void visit(WorkspaceImport operation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionItemStateManager

public SessionItemStateManager(UpdatableItemStateManager workspaceItemStateMgr,
                               ItemStateValidator validator,
                               QValueFactory qValueFactory,
                               ItemStateFactory isf,
                               ManagerProvider mgrProvider)
Creates a new SessionItemStateManager instance.

Parameters:
workspaceItemStateMgr -
validator -
qValueFactory -
isf -
mgrProvider -
Method Detail

hasPendingChanges

public boolean hasPendingChanges()
Returns:
true if this manager has any transient state; false otherwise.

save

public void save(ItemState state)
          throws javax.jcr.ReferentialIntegrityException,
                 javax.jcr.InvalidItemStateException,
                 javax.jcr.RepositoryException
This will save state and all descendants items of state that are transiently modified in a single step. If this operation fails, no item will have been saved.

Parameters:
state - the root state of the update operation
Throws:
javax.jcr.ReferentialIntegrityException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

undo

public void undo(ItemState itemState)
          throws javax.jcr.nodetype.ConstraintViolationException,
                 javax.jcr.RepositoryException
This will undo all changes made to state and descendant items of state inside this item state manager.

Parameters:
itemState - the root state of the cancel operation.
Throws:
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException - if undoing changes made to state and descendant items is not a closed set of changes. That is, at least another item needs to be canceled as well in another sub-tree.

adjustReferences

public void adjustReferences(ReferenceChangeTracker refTracker)
                      throws javax.jcr.nodetype.ConstraintViolationException,
                             javax.jcr.RepositoryException
Adjust references at the end of a successful XML import.

Parameters:
refTracker -
Throws:
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

execute

public void execute(Operation operation)
             throws javax.jcr.RepositoryException
Executes the given operation and modifies the affected item states accordingly.

Specified by:
execute in interface UpdatableItemStateManager
Throws:
javax.jcr.RepositoryException
See Also:
UpdatableItemStateManager.execute(Operation)

execute

public void execute(ChangeLog changes)
             throws javax.jcr.RepositoryException
Executes the operations passed with the given change log and modifies the affected item states accordingly.

Specified by:
execute in interface UpdatableItemStateManager
Throws:
javax.jcr.RepositoryException
See Also:
UpdatableItemStateManager.execute(ChangeLog)

dispose

public void dispose()
Disposes this UpdatableItemStateManager and frees resources.

Specified by:
dispose in interface UpdatableItemStateManager
See Also:
UpdatableItemStateManager.dispose()

visit

public void visit(AddNode operation)
           throws javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.nodetype.NoSuchNodeTypeException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(AddNode)

visit

public void visit(AddProperty operation)
           throws javax.jcr.ValueFormatException,
                  javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.ValueFormatException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(AddProperty)

visit

public void visit(Move operation)
           throws javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Move)

visit

public void visit(Remove operation)
           throws javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Remove)

visit

public void visit(SetMixin operation)
           throws javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.nodetype.NoSuchNodeTypeException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(SetMixin)

visit

public void visit(SetPropertyValue operation)
           throws javax.jcr.ValueFormatException,
                  javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.ValueFormatException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(SetPropertyValue)

visit

public void visit(ReorderNodes operation)
           throws javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(ReorderNodes)

visit

public void visit(Clone operation)
           throws javax.jcr.NoSuchWorkspaceException,
                  javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.NoSuchWorkspaceException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Clone)

visit

public void visit(Copy operation)
           throws javax.jcr.NoSuchWorkspaceException,
                  javax.jcr.lock.LockException,
                  javax.jcr.nodetype.ConstraintViolationException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.NoSuchWorkspaceException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Clone)

visit

public void visit(Checkout operation)
           throws javax.jcr.RepositoryException,
                  javax.jcr.UnsupportedRepositoryOperationException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
See Also:
OperationVisitor.visit(Clone)

visit

public void visit(Checkin operation)
           throws javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Clone)

visit

public void visit(Update operation)
           throws javax.jcr.NoSuchWorkspaceException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.lock.LockException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Update)

visit

public void visit(Restore operation)
           throws javax.jcr.version.VersionException,
                  javax.jcr.PathNotFoundException,
                  javax.jcr.ItemExistsException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.version.VersionException
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Restore)

visit

public void visit(Merge operation)
           throws javax.jcr.NoSuchWorkspaceException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.MergeException,
                  javax.jcr.lock.LockException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.MergeException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(Merge)

visit

public void visit(ResolveMergeConflict operation)
           throws javax.jcr.version.VersionException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.version.VersionException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(ResolveMergeConflict)

visit

public void visit(LockOperation operation)
           throws javax.jcr.AccessDeniedException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(LockOperation)

visit

public void visit(LockRefresh operation)
           throws javax.jcr.AccessDeniedException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(LockRefresh)

visit

public void visit(LockRelease operation)
           throws javax.jcr.AccessDeniedException,
                  javax.jcr.InvalidItemStateException,
                  javax.jcr.UnsupportedRepositoryOperationException,
                  javax.jcr.lock.LockException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(LockRelease)

visit

public void visit(AddLabel operation)
           throws javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(AddLabel)

visit

public void visit(RemoveLabel operation)
           throws javax.jcr.version.VersionException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(RemoveLabel)

visit

public void visit(RemoveVersion operation)
           throws javax.jcr.version.VersionException,
                  javax.jcr.AccessDeniedException,
                  javax.jcr.ReferentialIntegrityException,
                  javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.version.VersionException
javax.jcr.AccessDeniedException
javax.jcr.ReferentialIntegrityException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(RemoveVersion)

visit

public void visit(WorkspaceImport operation)
           throws javax.jcr.RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
UnsupportedOperationException
javax.jcr.RepositoryException
See Also:
OperationVisitor.visit(WorkspaceImport)


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