org.apache.jackrabbit.core.state
Interface UpdatableItemStateManager

All Superinterfaces:
ItemStateManager
All Known Implementing Classes:
LocalItemStateManager, SessionItemStateManager

public interface UpdatableItemStateManager
extends ItemStateManager

Identifies an ItemStateManager that allows updating items.


Method Summary
 void cancel()
          Cancel an update operation.
 NodeState createNew(NodeId id, QName nodeTypeName, NodeId parentId)
          Creates a NodeState instance representing new, i.e.
 PropertyState createNew(QName propName, NodeId parentId)
          Creates a PropertyState instance representing new, i.e.
 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.
 boolean inEditMode()
          Returns true 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

public 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, either update() or cancel() must be invoked.

Throws:
IllegalStateException - if the manager is already in edit mode.

inEditMode

public boolean inEditMode()
Returns true if this manager is in edit mode i.e. if an edit operation has been started by invoking edit(), otherwise returns false.

Returns:
true if this manager is in edit mode, otherwise false

createNew

public NodeState createNew(NodeId id,
                           QName nodeTypeName,
                           NodeId parentId)
                    throws IllegalStateException
Creates a NodeState instance representing new, i.e. not yet existing state. Call store(org.apache.jackrabbit.core.state.ItemState) on the returned object to make it persistent.

Parameters:
id - the id of the node
nodeTypeName - qualified node type name
parentId - parent node's id
Returns:
a node state
Throws:
IllegalStateException - if the manager is not in edit mode.

createNew

public PropertyState createNew(QName propName,
                               NodeId parentId)
                        throws IllegalStateException
Creates a PropertyState instance representing new, i.e. not yet existing state. Call store(org.apache.jackrabbit.core.state.ItemState) on the returned object to make it persistent.

Parameters:
propName - qualified property name
parentId - parent node Id
Returns:
a property state
Throws:
IllegalStateException - if the manager is not in edit mode.

store

public 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

public 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

public 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

public 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 referenced
StaleItemStateException - if at least one of the affected items has become stale in the meantime
ItemStateException - if the operation failed for another reason
IllegalStateException - if the manager is not in edit mode.

dispose

public void dispose()
Disposes this UpdatableItemStateManager and frees resources.



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