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.
 PropertyState createNew(QName propName, String parentUUID)
          Creates a PropertyState instance representing new, i.e.
 NodeState createNew(String uuid, QName nodeTypeName, String parentUUID)
          Creates a NodeState 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 store(NodeReferences refs)
          Store a node references object
 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
Throws:
IllegalStateException - if the manager is not in edit mode.

createNew

public NodeState createNew(String uuid,
                           QName nodeTypeName,
                           String parentUUID)
                    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:
uuid - node UUID
nodeTypeName - qualified node type name
parentUUID - parent node's UUID
Returns:
a node state
Throws:
IllegalStateException - if the manager is not in edit mode.

createNew

public PropertyState createNew(QName propName,
                               String parentUUID)
                        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
parentUUID - parent node UUID
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.

store

public void store(NodeReferences refs)
           throws IllegalStateException
Store a node references object

Parameters:
refs - node references object 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 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:
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-2005 The Apache Software Foundation. All Rights Reserved.