|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jackrabbit.core.state.SessionItemStateManager
SessionItemStateManager ...
| Constructor Summary | |
SessionItemStateManager(String rootNodeUUID,
UpdatableItemStateManager persistentStateMgr,
NamespaceResolver nsResolver)
Creates a new SessionItemStateManager instance. |
|
| Method Summary | |
void |
cancel()
Cancel an update operation. This will undo all changes made to objects inside this item state manager. |
NodeState |
createNew(NodeState transientState)
Customized variant of createNew(String, QName, String) that
connects the newly created persistent state with the transient state. |
PropertyState |
createNew(PropertyState transientState)
Customized variant of createNew(String, QName, String) that
connects the newly created persistent state with the transient state. |
PropertyState |
createNew(QName propName,
String parentUUID)
Creates a PropertyState instance representing new,
i.e. not yet existing state. Call UpdatableItemStateManager.store(org.apache.jackrabbit.core.state.ItemState)
on the returned object to make it persistent. |
NodeState |
createNew(String uuid,
QName nodeTypeName,
String parentUUID)
Creates a NodeState instance representing new,
i.e. not yet existing state. Call UpdatableItemStateManager.store(org.apache.jackrabbit.core.state.ItemState)
on the returned object to make it persistent. |
NodeState |
createTransientNodeState(NodeState overlayedState,
int initialStatus)
|
NodeState |
createTransientNodeState(String uuid,
QName nodeTypeName,
String parentUUID,
int initialStatus)
|
PropertyState |
createTransientPropertyState(PropertyState overlayedState,
int initialStatus)
|
PropertyState |
createTransientPropertyState(String parentUUID,
QName propName,
int initialStatus)
|
void |
destroy(ItemState state)
Destroy an item state. |
void |
disconnectTransientItemState(ItemState state)
Disconnect a transient item state from its underlying persistent state. |
void |
dispose()
Disposes this UpdatableItemStateManager and frees resources. |
void |
disposeAllTransientItemStates()
Disposes all transient item states in the cache and in the attic. |
void |
disposeTransientItemState(ItemState state)
Disposes the specified transient item state instance, i.e. |
void |
disposeTransientItemStateInAttic(ItemState state)
Disposes the specified transient item state instance in the attic, i.e. |
void |
dump(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
void |
edit()
Start an edit operation on items inside this manager. This allows calling the operations defined below. At the end of this operation, either UpdatableItemStateManager.update() or UpdatableItemStateManager.cancel()
must be invoked. |
Iterator |
getDescendantTransientItemStates(NodeId parentId)
Returns an iterator over those transient item state instances that are direct or indirect descendents of the item state with the given parentId. |
Iterator |
getDescendantTransientItemStatesInAttic(NodeId parentId)
Same as
except that item state instances in the attic are returned. |
HierarchyManager |
getHierarchyMgr()
Returns the hierarchy manager |
ItemState |
getItemState(ItemId id)
Return an item state, given its item id. |
NodeReferences |
getNodeReferences(NodeReferencesId id)
Return a node references object, given its target id |
ItemState |
getTransientItemState(ItemId id)
|
boolean |
hasAnyTransientItemStates()
|
boolean |
hasItemState(ItemId id)
Return a flag indicating whether an item state for a given item id exists. |
boolean |
hasNodeReferences(NodeReferencesId id)
Return a flag indicating whether a node references object for a given target id exists. |
boolean |
inEditMode()
Returns true if this manager is in edit mode i.e.
if an edit operation has been started by invoking UpdatableItemStateManager.edit(),
otherwise returns false. |
void |
moveTransientItemStateToAttic(ItemState state)
Transfers the specified transient item state instance from the 'active' cache to the attic. |
void |
store(ItemState state)
Store an item state. |
void |
store(NodeReferences refs)
Store a node references object |
void |
update()
End an update operation. This will save all items added to this update operation in a single step. If this operation fails, no item will have been saved. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SessionItemStateManager(String rootNodeUUID,
UpdatableItemStateManager persistentStateMgr,
NamespaceResolver nsResolver)
SessionItemStateManager instance.
rootNodeUUID - persistentStateMgr - nsResolver - | Method Detail |
public HierarchyManager getHierarchyMgr()
public void dump(PrintStream ps)
dump in interface Dumpableps - stream to dump state to
public ItemState getItemState(ItemId id)
throws NoSuchItemStateException,
ItemStateException
getItemState in interface ItemStateManagerid - item id
NoSuchItemStateException - if the item does not exist
ItemStateException - if an error occurspublic boolean hasItemState(ItemId id)
hasItemState in interface ItemStateManagerid - item id
true if an item state exists,
otherwise false
public NodeReferences getNodeReferences(NodeReferencesId id)
throws NoSuchItemStateException,
ItemStateException
getNodeReferences in interface ItemStateManagerid - target id
NoSuchItemStateException - if the item does not exist
ItemStateException - if an error occurspublic boolean hasNodeReferences(NodeReferencesId id)
hasNodeReferences in interface ItemStateManagerid - target id
true if an item state exists,
otherwise false
public void edit()
throws IllegalStateException
UpdatableItemStateManager.update() or UpdatableItemStateManager.cancel()
must be invoked.
edit in interface UpdatableItemStateManagerIllegalStateException - if the manager is already in edit mode.
public boolean inEditMode()
throws IllegalStateException
true if this manager is in edit mode i.e.
if an edit operation has been started by invoking UpdatableItemStateManager.edit(),
otherwise returns false.
inEditMode in interface UpdatableItemStateManagertrue if this manager is in edit mode, otherwise
false
IllegalStateException - if the manager is not in edit mode.
public NodeState createNew(String uuid,
QName nodeTypeName,
String parentUUID)
throws IllegalStateException
NodeState instance representing new,
i.e. not yet existing state. Call UpdatableItemStateManager.store(org.apache.jackrabbit.core.state.ItemState)
on the returned object to make it persistent.
createNew in interface UpdatableItemStateManageruuid - node UUIDnodeTypeName - qualified node type nameparentUUID - parent node's UUID
IllegalStateException - if the manager is not in edit mode.
public NodeState createNew(NodeState transientState)
throws IllegalStateException
createNew(String, QName, String) that
connects the newly created persistent state with the transient state.
IllegalStateException
public PropertyState createNew(QName propName,
String parentUUID)
throws IllegalStateException
PropertyState instance representing new,
i.e. not yet existing state. Call UpdatableItemStateManager.store(org.apache.jackrabbit.core.state.ItemState)
on the returned object to make it persistent.
createNew in interface UpdatableItemStateManagerpropName - qualified property nameparentUUID - parent node UUID
IllegalStateException - if the manager is not in edit mode.
public PropertyState createNew(PropertyState transientState)
throws IllegalStateException
createNew(String, QName, String) that
connects the newly created persistent state with the transient state.
IllegalStateException
public void store(ItemState state)
throws IllegalStateException
store in interface UpdatableItemStateManagerstate - item state that should be stored
IllegalStateException - if the manager is not in edit mode.
public void store(NodeReferences refs)
throws IllegalStateException
store in interface UpdatableItemStateManagerrefs - node references object that should be stored
IllegalStateException - if the manager is not in edit mode.
public void destroy(ItemState state)
throws IllegalStateException
destroy in interface UpdatableItemStateManagerstate - item state that should be destroyed
IllegalStateException - if the manager is not in edit mode.
public void cancel()
throws IllegalStateException
cancel in interface UpdatableItemStateManagerIllegalStateException - if the manager is not in edit mode.
public void update()
throws ItemStateException,
IllegalStateException
update in interface UpdatableItemStateManagerIllegalStateException - if the manager is not in edit mode.
ItemStateException - if the operation failed for another reasonpublic void dispose()
UpdatableItemStateManager and frees resources.
dispose in interface UpdatableItemStateManager
public ItemState getTransientItemState(ItemId id)
throws NoSuchItemStateException,
ItemStateException
id -
NoSuchItemStateException
ItemStateExceptionpublic boolean hasAnyTransientItemStates()
public Iterator getDescendantTransientItemStates(NodeId parentId)
throws InvalidItemStateException,
RepositoryException
parentId. The transient item state instance with the given
parentId itself (if there is such) will not be included.
The instances are returned in depth-first tree traversal order.
parentId - the id of the common parent of the transient item state
instances to be returned.
InvalidItemStateException - if any descendant item state has been
deleted externally
RepositoryException - if another error occurspublic Iterator getDescendantTransientItemStatesInAttic(NodeId parentId)
getDescendantTransientItemStates(NodeId)
except that item state instances in the attic are returned.
parentId - the id of the common parent of the transient item state
instances to be returned.
public NodeState createTransientNodeState(String uuid,
QName nodeTypeName,
String parentUUID,
int initialStatus)
throws ItemStateException
uuid - nodeTypeName - parentUUID - initialStatus -
ItemStateException
public NodeState createTransientNodeState(NodeState overlayedState,
int initialStatus)
throws ItemStateException
overlayedState - initialStatus -
ItemStateException
public PropertyState createTransientPropertyState(String parentUUID,
QName propName,
int initialStatus)
throws ItemStateException
parentUUID - propName - initialStatus -
ItemStateException
public PropertyState createTransientPropertyState(PropertyState overlayedState,
int initialStatus)
throws ItemStateException
overlayedState - initialStatus -
ItemStateExceptionpublic void disconnectTransientItemState(ItemState state)
HierarchyManager about the changed identity.
state - the transient ItemState instance that should
be disconnectedpublic void disposeTransientItemState(ItemState state)
state - the transient ItemState instance that should
be disposedItemState.discard()public void moveTransientItemStateToAttic(ItemState state)
state - the transient ItemState instance that should
be moved to the atticpublic void disposeTransientItemStateInAttic(ItemState state)
state - the transient ItemState instance that should
be disposed @see ItemState#discard()public void disposeAllTransientItemStates()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||