org.apache.jackrabbit.jcr2spi.state
Interface ItemStateFactory

All Known Subinterfaces:
TransientItemStateFactory
All Known Implementing Classes:
AbstractItemStateFactory, TransientISFactory, WorkspaceItemStateFactory

public interface ItemStateFactory

ItemStateFactory provides methods to create child NodeStates and PropertyStates for a given NodeState.


Method Summary
 void addCreationListener(ItemStateCreationListener listener)
          Adds the given ItemStateCreationListener.
 NodeState createDeepNodeState(NodeId nodeId, NodeEntry anyParent)
          Tries to retrieve the NodeState with the given NodeId and if the state exists, fills in the NodeEntries missing between the last known NodeEntry marked by anyParent.
 PropertyState createDeepPropertyState(PropertyId propertyId, NodeEntry anyParent)
          Tries to retrieve the PropertyState with the given PropertyId and if the state exists, fills in the HierarchyEntries missing between the last known NodeEntry marked by anyParent.
 NodeState createNodeState(NodeId nodeId, NodeEntry entry)
          Creates the child NodeState with the given nodeId.
 PropertyState createPropertyState(PropertyId propertyId, PropertyEntry entry)
          Creates the PropertyState with the given propertyId.
 NodeState createRootState(NodeEntry entry)
           
 Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId)
          Returns an Iterator over ChildInfos for the given NodeState.
 Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName, boolean weak)
          Returns the identifiers of all reference properties that point to the given node.
 void removeCreationListener(ItemStateCreationListener listener)
          Removes the given ItemStateCreationListener.
 

Method Detail

createRootState

NodeState createRootState(NodeEntry entry)
                          throws ItemNotFoundException,
                                 RepositoryException
Parameters:
entry -
Returns:
Throws:
ItemNotFoundException
RepositoryException

createNodeState

NodeState createNodeState(NodeId nodeId,
                          NodeEntry entry)
                          throws ItemNotFoundException,
                                 RepositoryException
Creates the child NodeState with the given nodeId.

Parameters:
nodeId - the id of the NodeState to create.
entry - the HierarchyEntry the new state should be attached to.
Returns:
the created NodeState.
Throws:
ItemNotFoundException - if there is no such NodeState.
RepositoryException - if an error occurs while retrieving the NodeState.

createDeepNodeState

NodeState createDeepNodeState(NodeId nodeId,
                              NodeEntry anyParent)
                              throws ItemNotFoundException,
                                     RepositoryException
Tries to retrieve the NodeState with the given NodeId and if the state exists, fills in the NodeEntries missing between the last known NodeEntry marked by anyParent.

Parameters:
nodeId -
anyParent -
Returns:
the created NodeState.
Throws:
ItemNotFoundException - if there is no such NodeState.
RepositoryException - if an error occurs while retrieving the NodeState.

createPropertyState

PropertyState createPropertyState(PropertyId propertyId,
                                  PropertyEntry entry)
                                  throws ItemNotFoundException,
                                         RepositoryException
Creates the PropertyState with the given propertyId.

Parameters:
propertyId - the id of the PropertyState to create.
entry - the HierarchyEntry the new state should be attached to.
Returns:
the created PropertyState.
Throws:
ItemNotFoundException - if there is no such PropertyState.
RepositoryException - if an error occurs while retrieving the PropertyState.

createDeepPropertyState

PropertyState createDeepPropertyState(PropertyId propertyId,
                                      NodeEntry anyParent)
                                      throws ItemNotFoundException,
                                             RepositoryException
Tries to retrieve the PropertyState with the given PropertyId and if the state exists, fills in the HierarchyEntries missing between the last known NodeEntry marked by anyParent.

Parameters:
propertyId -
anyParent -
Returns:
Throws:
ItemNotFoundException - if there is no such NodeState.
RepositoryException - if an error occurs while retrieving the NodeState.

getChildNodeInfos

Iterator<ChildInfo> getChildNodeInfos(NodeId nodeId)
                                      throws ItemNotFoundException,
                                             RepositoryException
Returns an Iterator over ChildInfos for the given NodeState.

Parameters:
nodeId -
Throws:
ItemNotFoundException
RepositoryException

getNodeReferences

Iterator<PropertyId> getNodeReferences(NodeState nodeState,
                                       Name propertyName,
                                       boolean weak)
Returns the identifiers of all reference properties that point to the given node.

Parameters:
nodeState - reference target
propertyName -
weak - Boolean flag indicating whether weak references should be returned or not.
Returns:
reference property identifiers

addCreationListener

void addCreationListener(ItemStateCreationListener listener)
Adds the given ItemStateCreationListener.

Parameters:
listener -

removeCreationListener

void removeCreationListener(ItemStateCreationListener listener)
Removes the given ItemStateCreationListener.

Parameters:
listener -


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