Package org.apache.jackrabbit.core.state
Interface UpdatableItemStateManager
-
- All Superinterfaces:
ItemStateManager
- All Known Implementing Classes:
LocalItemStateManager
,SessionItemStateManager
,XAItemStateManager
public interface UpdatableItemStateManager extends ItemStateManager
Identifies anItemStateManager
that allows updating items.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Cancel an update operation.NodeState
createNew(NodeId id, Name nodeTypeName, NodeId parentId)
Creates aNodeState
instance representing new, i.e.PropertyState
createNew(Name propName, NodeId parentId)
Creates aPropertyState
instance representing new, i.e.void
destroy(ItemState state)
Destroy an item state.void
dispose()
Disposes thisUpdatableItemStateManager
and frees resources.void
edit()
Start an edit operation on items inside this manager.boolean
inEditMode()
Returnstrue
if this manager is in edit mode i.e.void
store(ItemState state)
Store an item state.void
update()
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()
Returnstrue
if this manager is in edit mode i.e. if an edit operation has been started by invokingedit()
, otherwise returnsfalse
.- Returns:
true
if this manager is in edit mode, otherwisefalse
-
createNew
NodeState createNew(NodeId id, Name nodeTypeName, NodeId parentId) throws RepositoryException
Creates aNodeState
instance 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, ornull
for 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 aPropertyState
instance 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 IllegalStateException
Cancel 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, IllegalStateException
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.- 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 thisUpdatableItemStateManager
and frees resources.
-
-