Package org.apache.jackrabbit.core.state
Interface UpdatableItemStateManager
-
- All Superinterfaces:
ItemStateManager
- All Known Implementing Classes:
LocalItemStateManager,SessionItemStateManager,XAItemStateManager
public interface UpdatableItemStateManager extends ItemStateManager
Identifies anItemStateManagerthat allows updating items.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel()Cancel an update operation.NodeStatecreateNew(NodeId id, Name nodeTypeName, NodeId parentId)Creates aNodeStateinstance representing new, i.e.PropertyStatecreateNew(Name propName, NodeId parentId)Creates aPropertyStateinstance representing new, i.e.voiddestroy(ItemState state)Destroy an item state.voiddispose()Disposes thisUpdatableItemStateManagerand frees resources.voidedit()Start an edit operation on items inside this manager.booleaninEditMode()Returnstrueif this manager is in edit mode i.e.voidstore(ItemState state)Store an item state.voidupdate()End an update operation.-
Methods inherited from interface org.apache.jackrabbit.core.state.ItemStateManager
getItemState, getNodeReferences, hasItemState, hasNodeReferences
-
-
-
-
Method Detail
-
edit
void edit() throws IllegalStateException
Start an edit operation on items inside this manager. This allows calling the operations defined below. At the end of this operation, eitherupdate()orcancel()must be invoked.- Throws:
IllegalStateException- if the manager is already in edit mode.
-
inEditMode
boolean inEditMode()
Returnstrueif this manager is in edit mode i.e. if an edit operation has been started by invokingedit(), otherwise returnsfalse.- Returns:
trueif this manager is in edit mode, otherwisefalse
-
createNew
NodeState createNew(NodeId id, Name nodeTypeName, NodeId parentId) throws RepositoryException
Creates aNodeStateinstance representing new, i.e. not yet existing state. Callstore(org.apache.jackrabbit.core.state.ItemState)on the returned object to make it persistent.- Parameters:
id- the id of the node, ornullfor a new node idnodeTypeName- The node type nameparentId- parent node's id- Returns:
- a node state
- Throws:
RepositoryException- if the node state can not be created
-
createNew
PropertyState createNew(Name propName, NodeId parentId) throws IllegalStateException
Creates aPropertyStateinstance representing new, i.e. not yet existing state. Callstore(org.apache.jackrabbit.core.state.ItemState)on the returned object to make it persistent.- Parameters:
propName- property nameparentId- parent node Id- Returns:
- a property state
- Throws:
IllegalStateException- if the manager is not in edit mode.
-
store
void store(ItemState state) throws IllegalStateException
Store an item state.- Parameters:
state- item state that should be stored- Throws:
IllegalStateException- if the manager is not in edit mode.
-
destroy
void destroy(ItemState state) throws IllegalStateException
Destroy an item state.- Parameters:
state- item state that should be destroyed- Throws:
IllegalStateException- if the manager is not in edit mode.
-
cancel
void cancel() throws IllegalStateExceptionCancel an update operation. This will undo all changes made to objects inside this item state manager.- Throws:
IllegalStateException- if the manager is not in edit mode.
-
update
void update() throws ReferentialIntegrityException, StaleItemStateException, ItemStateException, IllegalStateExceptionEnd 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.- Throws:
ReferentialIntegrityException- if a new or modified REFERENCE property refers to a non-existent target or if a removed node is still being referencedStaleItemStateException- if at least one of the affected items has become stale in the meantimeItemStateException- if the operation failed for another reasonIllegalStateException- if the manager is not in edit mode.
-
dispose
void dispose()
Disposes thisUpdatableItemStateManagerand frees resources.
-
-