org.apache.jackrabbit.jcr2spi.state
Class SessionItemStateManager

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

public class SessionItemStateManager
extends TransientOperationVisitor
implements UpdatableItemStateManager

SessionItemStateManager ...


Constructor Summary
SessionItemStateManager(UpdatableItemStateManager workspaceItemStateMgr, ItemStateValidator validator, QValueFactory qValueFactory, ItemStateFactory isf, SessionImpl 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(AddNode operation)
           
 void visit(AddProperty operation)
           
 void visit(Move operation)
           
 void visit(Remove operation)
           
 void visit(ReorderNodes operation)
           
 void visit(SetMixin operation)
           
 void visit(SetPrimaryType operation)
           
 void visit(SetPropertyValue operation)
           
 
Methods inherited from class org.apache.jackrabbit.jcr2spi.operation.TransientOperationVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
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,
                               SessionImpl 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 ReferentialIntegrityException,
                 InvalidItemStateException,
                 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:
ReferentialIntegrityException
InvalidItemStateException
RepositoryException

undo

public void undo(ItemState itemState)
          throws ConstraintViolationException,
                 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:
ConstraintViolationException
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 ConstraintViolationException,
                             RepositoryException
Adjust references at the end of a successful XML import.

Parameters:
refTracker -
Throws:
ConstraintViolationException
RepositoryException

execute

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

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

execute

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

Specified by:
execute in interface UpdatableItemStateManager
Throws:
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 LockException,
                  ConstraintViolationException,
                  AccessDeniedException,
                  ItemExistsException,
                  NoSuchNodeTypeException,
                  UnsupportedRepositoryOperationException,
                  VersionException,
                  RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
LockException
ConstraintViolationException
AccessDeniedException
ItemExistsException
NoSuchNodeTypeException
UnsupportedRepositoryOperationException
VersionException
RepositoryException
See Also:
OperationVisitor.visit(AddNode)

visit

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

visit

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

visit

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

visit

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

visit

public void visit(SetPrimaryType operation)
           throws ConstraintViolationException,
                  RepositoryException
Specified by:
visit in interface OperationVisitor
Throws:
ConstraintViolationException
RepositoryException
See Also:
OperationVisitor.visit(SetPrimaryType)

visit

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

visit

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


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