org.modeshape.graph.session
Interface GraphSession.Operations<NodePayload,PropertyPayload>

All Known Implementing Classes:
GraphSession.NodeOperations
Enclosing class:
GraphSession<Payload,PropertyPayload>

@ThreadSafe
public static interface GraphSession.Operations<NodePayload,PropertyPayload>


Method Summary
 void compute(Graph.Batch batch, GraphSession.Node<NodePayload,PropertyPayload> node)
          Update any computed fields based on the given node
 void materialize(Node persistentNode, GraphSession.Node<NodePayload,PropertyPayload> node)
          Update the children and properties for the node with the information from the persistent store.
 void materializeProperties(Node persistentNode, GraphSession.Node<NodePayload,PropertyPayload> node)
          Update the properties ONLY for the node with the information from the persistent store.
 void postCopy(GraphSession.Node<NodePayload,PropertyPayload> original, GraphSession.Node<NodePayload,PropertyPayload> copy)
          Notify that an existing child will be copied with the new copy being placed under the supplied parent.
 void postCreateChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode, GraphSession.Node<NodePayload,PropertyPayload> newChild, Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)
          Notify that a new child has been added to the supplied parent node.
 void postMove(GraphSession.Node<NodePayload,PropertyPayload> movedNode, GraphSession.Node<NodePayload,PropertyPayload> oldParentNode)
          Notify that an existing child has been moved from the supplied previous parent into its new location.
 void postRemoveChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode, GraphSession.Node<NodePayload,PropertyPayload> removedChild)
          Notify that an existing child has been removed from the supplied parent.
 void postRemoveProperty(GraphSession.Node<NodePayload,PropertyPayload> node, Name propertyName, GraphSession.PropertyInfo<PropertyPayload> oldProperty)
           
 void postSetProperty(GraphSession.Node<NodePayload,PropertyPayload> node, Name propertyName, GraphSession.PropertyInfo<PropertyPayload> oldProperty)
           
 void postUpdateLocation(GraphSession.Node<NodePayload,PropertyPayload> node, Location oldLocation)
          Signal that the node's location has been changed
 void preCopy(GraphSession.Node<NodePayload,PropertyPayload> original, GraphSession.Node<NodePayload,PropertyPayload> newParentNode)
          Notify that an existing child will be copied with the new copy being placed under the supplied parent.
 void preCreateChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode, Path.Segment newChild, Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)
          Notify that a new child with the supplied path segment is about to be created.
 void preMove(GraphSession.Node<NodePayload,PropertyPayload> nodeToBeMoved, GraphSession.Node<NodePayload,PropertyPayload> newParentNode)
          Notify that an existing child will be moved from its current parent and placed under the supplied parent.
 void preRemoveChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode, GraphSession.Node<NodePayload,PropertyPayload> child)
          Notify that an existing child will be removed from the supplied parent.
 void preRemoveProperty(GraphSession.Node<NodePayload,PropertyPayload> node, Name propertyName)
           
 void preSave(GraphSession.Node<NodePayload,PropertyPayload> node, DateTime saveTime)
          Validate a node for consistency and well-formedness.
 void preSetProperty(GraphSession.Node<NodePayload,PropertyPayload> node, Name propertyName, GraphSession.PropertyInfo<PropertyPayload> newProperty)
           
 

Method Detail

materialize

void materialize(Node persistentNode,
                 GraphSession.Node<NodePayload,PropertyPayload> node)
Update the children and properties for the node with the information from the persistent store.

Parameters:
persistentNode - the persistent node that should be converted into a node info; never null
node - the session's node representation that is to be updated; never null

materializeProperties

void materializeProperties(Node persistentNode,
                           GraphSession.Node<NodePayload,PropertyPayload> node)
Update the properties ONLY for the node with the information from the persistent store.

Parameters:
persistentNode - the persistent node that should be converted into a node info; never null
node - the session's node representation that is to be updated; never null

postUpdateLocation

void postUpdateLocation(GraphSession.Node<NodePayload,PropertyPayload> node,
                        Location oldLocation)
Signal that the node's location has been changed

Parameters:
node - the node with the new location
oldLocation - the old location of the node

preSetProperty

void preSetProperty(GraphSession.Node<NodePayload,PropertyPayload> node,
                    Name propertyName,
                    GraphSession.PropertyInfo<PropertyPayload> newProperty)
                    throws ValidationException
Throws:
ValidationException

postSetProperty

void postSetProperty(GraphSession.Node<NodePayload,PropertyPayload> node,
                     Name propertyName,
                     GraphSession.PropertyInfo<PropertyPayload> oldProperty)

preRemoveProperty

void preRemoveProperty(GraphSession.Node<NodePayload,PropertyPayload> node,
                       Name propertyName)
                       throws ValidationException
Throws:
ValidationException

postRemoveProperty

void postRemoveProperty(GraphSession.Node<NodePayload,PropertyPayload> node,
                        Name propertyName,
                        GraphSession.PropertyInfo<PropertyPayload> oldProperty)

preCreateChild

void preCreateChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode,
                    Path.Segment newChild,
                    Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)
                    throws ValidationException
Notify that a new child with the supplied path segment is about to be created. When this method is called, the child has not yet been added to the parent node.

Parameters:
parentNode - the parent node; never null
newChild - the path segment for the new child; never null
properties - the initial properties for the new child, which can be manipulated directly; never null
Throws:
ValidationException - if the parent may not have a child with the supplied name and the creation of the new node should be aborted

postCreateChild

void postCreateChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode,
                     GraphSession.Node<NodePayload,PropertyPayload> newChild,
                     Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)
                     throws ValidationException
Notify that a new child has been added to the supplied parent node. The child may have an initial set of properties specified at creation time, although none of the PropertyInfo objects will have a payload.

Parameters:
parentNode - the parent node; never null
newChild - the child that was just added to the parent node; never null
properties - the properties of the child, which can be manipulated directly; never null
Throws:
ValidationException - if the parent and child are not valid and the creation of the new node should be aborted

preMove

void preMove(GraphSession.Node<NodePayload,PropertyPayload> nodeToBeMoved,
             GraphSession.Node<NodePayload,PropertyPayload> newParentNode)
             throws ValidationException
Notify that an existing child will be moved from its current parent and placed under the supplied parent. When this method is called, the child node has not yet been moved.

Parameters:
nodeToBeMoved - the existing node that is to be moved from its current parent to the supplied parent; never null
newParentNode - the new parent node; never null
Throws:
ValidationException - if the child should not be moved

postMove

void postMove(GraphSession.Node<NodePayload,PropertyPayload> movedNode,
              GraphSession.Node<NodePayload,PropertyPayload> oldParentNode)
Notify that an existing child has been moved from the supplied previous parent into its new location. When this method is called, the child node has been moved and any same-name-siblings that were after the child in the old parent have had their SNS indexes adjusted.

Parameters:
movedNode - the existing node that is was moved; never null
oldParentNode - the old parent node; never null

preCopy

void preCopy(GraphSession.Node<NodePayload,PropertyPayload> original,
             GraphSession.Node<NodePayload,PropertyPayload> newParentNode)
             throws ValidationException
Notify that an existing child will be copied with the new copy being placed under the supplied parent. When this method is called, the copy has not yet been performed.

Parameters:
original - the existing node that is to be copied; never null
newParentNode - the parent node where the copy is to be placed; never null
Throws:
ValidationException - if the copy is not valid

postCopy

void postCopy(GraphSession.Node<NodePayload,PropertyPayload> original,
              GraphSession.Node<NodePayload,PropertyPayload> copy)
Notify that an existing child will be copied with the new copy being placed under the supplied parent. When this method is called, the copy has been performed, but the new copy will not be loaded nor will be capable of being loaded.

Parameters:
original - the original node that was copied; never null
copy - the new copy that was made; never null

preRemoveChild

void preRemoveChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode,
                    GraphSession.Node<NodePayload,PropertyPayload> child)
                    throws ValidationException
Notify that an existing child will be removed from the supplied parent. When this method is called, the child node has not yet been removed.

Parameters:
parentNode - the parent node; never null
child - the child that is to be removed from the parent node; never null
Throws:
ValidationException - if the child should not be removed from the parent node

postRemoveChild

void postRemoveChild(GraphSession.Node<NodePayload,PropertyPayload> parentNode,
                     GraphSession.Node<NodePayload,PropertyPayload> removedChild)
Notify that an existing child has been removed from the supplied parent. When this method is called, the child node has been removed and any same-name-siblings following the child have had their SNS indexes adjusted. Additionally, the removed child no longer has a parent and is considered stale.

Parameters:
parentNode - the parent node; never null
removedChild - the child that is to be removed from the parent node; never null

preSave

void preSave(GraphSession.Node<NodePayload,PropertyPayload> node,
             DateTime saveTime)
             throws ValidationException
Validate a node for consistency and well-formedness.

Parameters:
node - the node to be validated
saveTime - the time at which the save operation is occurring; never null
Throws:
ValidationException - if there is a problem during validation

compute

void compute(Graph.Batch batch,
             GraphSession.Node<NodePayload,PropertyPayload> node)
Update any computed fields based on the given node

Parameters:
batch - the workspace graph batch in which computed fields should be created
node - the node form which computed fields will be derived


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.