|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jackrabbit.core.state.LocalItemStateManager
Local ItemStateManager that isolates changes to
persistent states from other clients.
| Field Summary | |
protected SharedItemStateManager |
sharedStateMgr
Shared item state manager |
protected WorkspaceImpl |
wspImpl
Local WorkspaceImpl instance. |
| Constructor Summary | |
LocalItemStateManager(SharedItemStateManager sharedStateMgr,
WorkspaceImpl wspImpl)
Creates a new LocalItemStateManager instance. |
|
| Method Summary | |
void |
cancel()
Cancel an update operation. This will undo all changes made to objects inside this item state manager. |
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. |
void |
destroy(ItemState state)
Destroy an item state. |
void |
dispose()
Disposes this UpdatableItemStateManager and frees resources. |
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. |
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 |
protected NodeState |
getNodeState(NodeId id)
Retrieve a node state from the parent shared state manager and wraps it into a intermediate object that helps us handle local modifications. |
protected PropertyState |
getPropertyState(PropertyId id)
Retrieve a property state from the parent shared state manager and wraps it into a intermediate object that helps us handle local modifications. |
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 |
stateCreated(ItemState created)
Called when an ItemState has successfully
been created (i.e. its underlying persistent state was created). |
void |
stateDestroyed(ItemState destroyed)
Called when an ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed). |
void |
stateDiscarded(ItemState discarded)
Called when an ItemState has been discarded (i.e. it has
been rendered 'invalid'). |
void |
stateModified(ItemState modified)
Called when an ItemState has successfully
been modified (i.e. its underlying persistent state has changed). |
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. |
protected void |
update(ChangeLog changeLog)
End an update operation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final SharedItemStateManager sharedStateMgr
protected final WorkspaceImpl wspImpl
| Constructor Detail |
public LocalItemStateManager(SharedItemStateManager sharedStateMgr,
WorkspaceImpl wspImpl)
LocalItemStateManager instance.
todo LocalItemStateManager without a wspImpl will not generate observation events!
sharedStateMgr - shared state managerwspImpl - the workspace instance where this item state manager
belongs to, or null if this item state manager is not
associated with a workspace. This is the case for the version item state
manager. Version item states are not associated with a specific workspace
instance.| Method Detail |
protected NodeState getNodeState(NodeId id)
throws NoSuchItemStateException,
ItemStateException
id - node id
NoSuchItemStateException
ItemStateException
protected PropertyState getPropertyState(PropertyId id)
throws NoSuchItemStateException,
ItemStateException
id - property id
NoSuchItemStateException
ItemStateException
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()
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
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 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 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 StaleItemStateException,
ItemStateException,
IllegalStateException
update in interface UpdatableItemStateManagerIllegalStateException - if the manager is not in edit mode.
ItemStateException - if the operation failed for another reason
StaleItemStateException - if at least one of the affected items
has become stale in the meantime
protected void update(ChangeLog changeLog)
throws StaleItemStateException,
ItemStateException
changeLog - change log containing local states and references
StaleItemStateException - if at least one of the affected item
states has become stale in the meantime
ItemStateException - if an error occurspublic void dispose()
UpdatableItemStateManager and frees resources.
dispose in interface UpdatableItemStateManagerpublic void stateCreated(ItemState created)
ItemState has successfully
been created (i.e. its underlying persistent state was created).
stateCreated in interface ItemStateListenercreated - the ItemState that has been 'created'public void stateModified(ItemState modified)
ItemState has successfully
been modified (i.e. its underlying persistent state has changed).
stateModified in interface ItemStateListenermodified - the ItemState that has been 'modified'public void stateDestroyed(ItemState destroyed)
ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed).
stateDestroyed in interface ItemStateListenerdestroyed - the ItemState that has been 'destroyed'public void stateDiscarded(ItemState discarded)
ItemState has been discarded (i.e. it has
been rendered 'invalid').
stateDiscarded in interface ItemStateListenerdiscarded - the ItemState that has been discardedItemState.discard()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||