Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.graph.session
Class GraphSession.Node<Payload,PropertyPayload>

    java.lang.Object
      org.modeshape.graph.session.GraphSession.Node<Payload,PropertyPayload>

Enclosing class:
  GraphSession<Payload,PropertyPayload>

    @NotThreadSafe
    public static class GraphSession.Node<Payload,PropertyPayload>

extends Object

Constructor Summary
`GraphSession.Node(GraphSession<Payload,PropertyPayload> cache, GraphSession.Node<Payload,PropertyPayload> parent, GraphSession.NodeId nodeId, Location location)`

Method Summary
`void` | `clearChanges()` Clear any transient changes that have been accumulated in this node.
`void` | `cloneNode()` Clone this node (and all nodes below it).
`boolean` | `containsChangesWithExternalDependencies()` This method determines whether this node, or any nodes below it, contain changes that depend on nodes that are outside of this branch.
`void` | `copyTo(GraphSession.Node<Payload,PropertyPayload> parent)` Copy this node (and all nodes below it) and place the copy under the supplied parent location.
`GraphSession.Node<Payload,PropertyPayload>` | `createChild(Name name)` Create a new child node with the supplied name.
`GraphSession.Node<Payload,PropertyPayload>` | `createChild(Name name, Collection<Property> idProperties)` Create a new child node with the supplied name and multiple initial identification properties.
`GraphSession.Node<Payload,PropertyPayload>` | `createChild(Name name, Collection<Property> idProperties, Property... remainingProperties)` Create a new child node with the supplied name and multiple initial properties.
`GraphSession.Node<Payload,PropertyPayload>` | `createChild(Name name, Property... properties)` Create a new child node with the supplied name and multiple initial properties.
`void` | `destroy()` Remove this node from it's parent and destroy it's contents.
`boolean` | `equals(Object obj)`
`GraphSession.Node<Payload,PropertyPayload>` | `getChild(Name name, int sns)` Get the child with the supplied name and SNS index.
`GraphSession.Node<Payload,PropertyPayload>` | `getChild(Path.Segment segment)` Get the child with the supplied segment.
`GraphSession.Node<Payload,PropertyPayload>` | `getChildAfter(GraphSession.Node<Payload,PropertyPayload> child)` Get the child node that immediately follows the supplied child.
`Iterable<GraphSession.Node<Payload,PropertyPayload>>` | `getChildren()` Get an iterator over the children.
`Iterable<GraphSession.Node<Payload,PropertyPayload>>` | `getChildren(Name name)` Get an iterator over the children that have the supplied name.
`int` | `getChildrenCount()` Get the number of children.
`int` | `getChildrenCount(Name name)` Get the number of children that have the same supplied name.
`long` | `getExpirationTimeInMillis()` Get the time when this node expires.
`GraphSession.Node<Payload,PropertyPayload>` | `getFirstChild(Name name)` Get the first child matching the name and lowest SNS index
`Location` | `getLocation()` Get the current location for this node.
`Name` | `getName()` Get the name of this node, without any same-name-sibling index.
`GraphSession.NodeId` | `getNodeId()`
`Location` | `getOriginalLocation()` Get the original location for this node prior to making any transient changes.
`GraphSession.Node<Payload,PropertyPayload>` | `getParent()` Get this node's parent node.
`Path` | `getPath()` Get the current path to this node.
`Payload` | `getPayload()`
`Collection<GraphSession.PropertyInfo<PropertyPayload>>` | `getProperties()` Get the information for each of the properties on this node.
`GraphSession.PropertyInfo<PropertyPayload>` | `getProperty(Name name)` Get from this node the property with the supplied name.
`int` | `getPropertyCount()` Get the number of properties owned by this node.
`Set<Name>` | `getPropertyNames()` Get the names of the properties on this node.
`Path.Segment` | `getSegment()` Get the `path segment` for this node.
`GraphSession<Payload,PropertyPayload>` | `getSession()` Get the session to which this node belongs.
`GraphSession.StructureSnapshot<PropertyPayload>` | `getSnapshot(boolean pathsOnly)` Obtain a snapshot of the structure below this node.
`String` | `getString(NamespaceRegistry registry)` Utility method to obtain a string representation that uses the namespace prefixes where appropriate.
`boolean` | `hasChild(Name name, int sns)` Determine whether this node has a child with the supplied name and SNS index.
`boolean` | `hasChild(Path.Segment segment)` Determine whether this node has a child with the supplied name and SNS index.
`int` | `hashCode()`
`boolean` | `isAtOrBelow(GraphSession.Node<Payload,PropertyPayload> other)`
`boolean` | `isChanged(boolean recursive)` Determine whether this node has been marked as having changes.
`boolean` | `isExpired()` Determine if this node's information has expired.
`boolean` | `isLeaf()` Determine if this node is a leaf node with no children.
`boolean` | `isLoaded()` Determine if this node is loaded and usable.
`boolean` | `isNew()` Determine whether this node has been created since the last save.
`boolean` | `isRoot()`
`boolean` | `isStale()` Determine whether this node is stale because it was dropped from the cache.
`protected void` | `load()` Method that causes the information for this node to be read from the store and loaded into the cache
`void` | `loadedWith(List<Location> children, Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties, DateTime expirationTime)` Define the persistent child information that this node is to be populated with.
`void` | `loadedWith(Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)` Define the persistent property information that this node is to be populated with.
`void` | `markAsChanged()` Mark this node as having changes.
`protected void` | `markAsChangedBelow()`
`void` | `markAsCopied()`
`void` | `markAsNew()` Mark this node has having been created and not yet saved.
`void` | `moveTo(GraphSession.Node<Payload,PropertyPayload> parent)` Move this node from its current location so that is is a child of the supplied parent.
`void` | `moveTo(GraphSession.Node<Payload,PropertyPayload> parent, Name newNodeName)` Move this node from its current location so that is is a child of the supplied parent, renaming the node in the process.
`protected void` | `moveTo(GraphSession.Node<Payload,PropertyPayload> parent, Name newNodeName, boolean useBatch)` Move this node from its current location so that is is a child of the supplied parent.
`void` | `onCachedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)` Visit all loaded and unloaded nodes in the cache.
`void` | `onChangedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)` Visit all changed nodes in the cache.
`void` | `onLoadedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)` Visit all nodes in the cache that are already loaded
`void` | `orderChildBefore(Path.Segment childToBeMoved, Path.Segment before)` Move the specified child to be located immediately before the other supplied node.
`protected void` | `recomputeChangedBelow()`
`protected boolean` | `refreshPhase1(GraphSession.RefreshState<Payload,PropertyPayload> refreshState)` Phase 1 of the process of refreshing the cached content while retaining changes.
`protected void` | `refreshPhase2(GraphSession.RefreshState<Payload,PropertyPayload> refreshState, Results persistentInfoForRefreshedNodes)` Phase 2 of the process of refreshing the cached content while retaining changes.
`protected void` | `remove()` Remove this node from it's parent.
`protected void` | `remove(boolean markParentAsChanged)` Remove this node from it's parent.
`GraphSession.PropertyInfo<PropertyPayload>` | `removeProperty(Name name)` Remove a property from this node.
`void` | `rename(Name newNodeName)` Rename this node to have a different name.
`void` | `setPayload(Payload payload)`
`GraphSession.PropertyInfo<PropertyPayload>` | `setProperty(Property property, boolean isMultiValued, PropertyPayload payload)` Set the supplied property information on this node.
`void` | `setUuid(UUID uuid)`
`protected void` | `synchronizeWithNewlyPersistedNode(Location newChild)` This method is used to adjust the existing children by adding a child that was recently added to the persistent store (via clone or copy).
`String` | `toString()`
`protected void` | `unload()` Utility method to unload this cached node.
`protected void` | `updateLocation(Path.Segment segment)` Reconstruct the location object for this node, given the information at the parent.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### GraphSession.Node

    public GraphSession.Node(GraphSession<Payload,PropertyPayload> cache,
                             GraphSession.Node<Payload,PropertyPayload> parent,
                             GraphSession.NodeId nodeId,
                             Location location)

Method Detail

### getSession

    public GraphSession<Payload,PropertyPayload> getSession()

  Get the session to which this node belongs.

  Returns:
    the session; never null

### getExpirationTimeInMillis

    public final long getExpirationTimeInMillis()

  Get the time when this node expires.

  Returns:
    the time in milliseconds past the epoch when this node's cached information expires, or `Long.MAX_VALUE` if there is no expiration or if the node has not been loaded
  See Also:
    `isExpired()`, `isLoaded()`

### isExpired

    public final boolean isExpired()

  Determine if this node's information has expired. This method will never return true if the node is not loaded. This method is idempotent.

  Returns:
    true if this node's information has been read from the store and is expired

### isLoaded

    public final boolean isLoaded()

  Determine if this node is loaded and usable. Even though the node may have been loaded previously, this method may return false (and unloads the cached information) if the cached information has expired and thus is no longer usable. Note, however, that changes on or below this node will prevent the node from being unloaded.

  Returns:
    true if the node's information has already been loaded and may be used, or false otherwise

### load

    protected final void load()
                       throws RepositorySourceException

  Method that causes the information for this node to be read from the store and loaded into the cache

  Throws:
    `AccessControlException` - if the caller does not have the permission to perform the operation
    `RepositorySourceException` - if there is a problem reading the store

### unload

    protected final void unload()

  Utility method to unload this cached node.

### refreshPhase1

    protected final boolean refreshPhase1(GraphSession.RefreshState<Payload,PropertyPayload> refreshState)

  Phase 1 of the process of refreshing the cached content while retaining changes. This phase walks the entire tree to determine which nodes have changes, which nodes can be unloaded, and which nodes have no changes but are ancestors of those nodes with changes (and therefore have to be refreshed). Each node has a `changed state`, and the supplied RefreshState tracks which nodes must be `refreshed` in `phase 2`; all other nodes are able to be unloaded in `phase 2`.

  Parameters:
    `refreshState` - the holder of the information about which nodes are to be unloaded or refreshed; may not be null
  Returns:
    true if the node could be (or already is) unloaded, or false otherwise
  See Also:
    `#refreshPhase2(RefreshState, Results)`

### refreshPhase2

    protected final void refreshPhase2(GraphSession.RefreshState<Payload,PropertyPayload> refreshState,
                                       Results persistentInfoForRefreshedNodes)

  Phase 2 of the process of refreshing the cached content while retaining changes. This phase walks the graph and either unloads the node or, if the node is an ancestor of changed nodes, refreshes the node state to reflect that of the persistent store.

  Parameters:
    `refreshState` -
    `persistentInfoForRefreshedNodes` -
  See Also:
    `#refreshPhase1(RefreshState)`

### loadedWith

    public void loadedWith(List<Location> children,
                           Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties,
                           DateTime expirationTime)

  Define the persistent child information that this node is to be populated with. This method does not cause the node's information to be read from the store.

  This method is intended to be called by the `GraphSession.Operations#materialize(org.modeshape.graph.Node, Node)` , and should not be called by other components.

  Parameters:
    `children` - the children for this node; may not be null
    `properties` - the properties for this node; may not be null
    `expirationTime` - the time that this cached information expires, or null if there is no expiration

### loadedWith

    public void loadedWith(Map<Name,GraphSession.PropertyInfo<PropertyPayload>> properties)

  Define the persistent property information that this node is to be populated with. This method does not cause the node's information to be read from the store.

  Parameters:
    `properties` - the properties for this node; may not be null

### updateLocation

    protected void updateLocation(Path.Segment segment)

  Reconstruct the location object for this node, given the information at the parent.

  Parameters:
    `segment` - the path segment for this node; may be null only when this node is the root node

### synchronizeWithNewlyPersistedNode

    protected void synchronizeWithNewlyPersistedNode(Location newChild)

  This method is used to adjust the existing children by adding a child that was recently added to the persistent store (via clone or copy). The new child will appear at the end of the existing children, but before any children that were added to, moved into, created under this parent.

  Parameters:
    `newChild` - the new child that was added

### isChanged

    public final boolean isChanged(boolean recursive)

  Determine whether this node has been marked as having changes.

  Parameters:
    `recursive` - true if the nodes under this node should be checked, or false if only this node should be checked
  Returns:
    true if there are changes in the specified scope, or false otherwise

### isNew

    public final boolean isNew()

  Determine whether this node has been created since the last save. If this method returns true, then by definition the parent node will be marked as having `changed`.

  Returns:
    true if this node is new, or false otherwise

### containsChangesWithExternalDependencies

    public boolean containsChangesWithExternalDependencies()

  This method determines whether this node, or any nodes below it, contain changes that depend on nodes that are outside of this branch.

  Returns:
    true if this branch has nodes with changes dependent on nodes outside of this branch

### clearChanges

    public void clearChanges()

  Clear any transient changes that have been accumulated in this node.

  See Also:
    `markAsChanged()`

### markAsChanged

    public final void markAsChanged()

  Mark this node as having changes.

  See Also:
    `clearChanges()`, `markAsNew()`

### markAsCopied

    public final void markAsCopied()

### markAsNew

    public final void markAsNew()

  Mark this node has having been created and not yet saved.

  See Also:
    `clearChanges()`, `markAsChanged()`

### markAsChangedBelow

    protected final void markAsChangedBelow()

### recomputeChangedBelow

    protected final void recomputeChangedBelow()

### moveTo

    public void moveTo(GraphSession.Node<Payload,PropertyPayload> parent)

  Move this node from its current location so that is is a child of the supplied parent.

  Parameters:
    `parent` - the new parent for this node; may not be null
  Throws:
    `RepositorySourceException` - if the parent node is to be loaded but a problem is encountered while doing so
    `IllegalArgumentException` - if this is the root node

### moveTo

    public void moveTo(GraphSession.Node<Payload,PropertyPayload> parent,
                       Name newNodeName)

  Move this node from its current location so that is is a child of the supplied parent, renaming the node in the process.

  Parameters:
    `parent` - the new parent for this node; may not be null
    `newNodeName` - the new name for the node, or null if the node should keep the same name
  Throws:
    `RepositorySourceException` - if the parent node is to be loaded but a problem is encountered while doing so
    `IllegalArgumentException` - if this is the root node

### moveTo

    protected void moveTo(GraphSession.Node<Payload,PropertyPayload> parent,
                          Name newNodeName,
                          boolean useBatch)

  Move this node from its current location so that is is a child of the supplied parent.

  Parameters:
    `parent` - the new parent for this node; may not be null
    `newNodeName` - the new name for the node, or null if the node should keep the same name
    `useBatch` - true if this operation should be performed using the session's current batch operation and executed upon `GraphSession.save()`, or false if the move should be performed immediately
  Throws:
    `ValidationException` - if the supplied parent node is a decendant of this node
    `RepositorySourceException` - if the parent node is to be loaded but a problem is encountered while doing so
    `IllegalArgumentException` - if this is the root node
    `AccessControlException` - if the caller does not have the permission to perform the operation

### rename

    public void rename(Name newNodeName)

  Rename this node to have a different name.

  Parameters:
    `newNodeName` -

### copyTo

    public void copyTo(GraphSession.Node<Payload,PropertyPayload> parent)

  Copy this node (and all nodes below it) and place the copy under the supplied parent location. The new copy will be appended to any existing children of the supplied parent node, and will be given the appropriate same-name-sibling index. This method may not be called on the root node.

  Parameters:
    `parent` - the new parent for the new copy; may not be null
  Throws:
    `RepositorySourceException` - if the parent node is to be loaded but a problem is encountered while doing so
    `IllegalArgumentException` - if the parent is null, or if this is the root node
    `AccessControlException` - if the caller does not have the permission to perform the operation

### cloneNode

    public void cloneNode()

  Clone this node (and all nodes below it). The new copy will be appended to the existing children of the `parent`, and will be given the appropriate same-name-sibling index.

  This is equivalent to calling `node.copyTo(node.getParent())`

  Throws:
    `IllegalArgumentException` - if this is the root node

### orderChildBefore

    public void orderChildBefore(Path.Segment childToBeMoved,
                                 Path.Segment before)
                          throws PathNotFoundException

  Move the specified child to be located immediately before the other supplied node.

  Parameters:
    `childToBeMoved` - the path segment specifying the child that is to be moved
    `before` - the path segment of the node before which the `childToBeMoved` should be placed, or null if the child should be moved to the end
  Throws:
    `PathNotFoundException` - if the `childToBeMoved` or `before` segments do not specify an existing child
    `IllegalArgumentException` - if either segment is null or does not specify an existing node

### remove

    protected void remove()

  Remove this node from it's parent. Note that locations are not updated, since they will be updated if this node is added to a different parent. However, the locations of same-name-siblings under the parent are updated.

### remove

    protected void remove(boolean markParentAsChanged)

  Remove this node from it's parent. Note that locations are not updated, since they will be updated if this node is added to a different parent. However, the locations of same-name-siblings under the parent are updated.

  Parameters:
    `markParentAsChanged` - true if the parent should be marked as being changed (i.e., when changes are initiated from within this session), or false otherwise (i.e., when changes are made to reflect the persistent state)

### destroy

    public void destroy()

  Remove this node from it's parent and destroy it's contents. The location of sibling nodes with the same name will be updated, and the node and all nodes below it will be destroyed and removed from the cache.

  Throws:
    `AccessControlException` - if the caller does not have the permission to perform the operation

### isRoot

    public final boolean isRoot()

### isStale

    public boolean isStale()

  Determine whether this node is stale because it was dropped from the cache.

  Returns:
    true if the node is stale and should no longer be used

### getParent

    public GraphSession.Node<Payload,PropertyPayload> getParent()

  Get this node's parent node.

  Returns:
    the parent node

### getNodeId

    public final GraphSession.NodeId getNodeId()

  Returns:
    nodeId

### getName

    public Name getName()

  Get the name of this node, without any same-name-sibling index.

  Returns:
    the name; never null

### getSegment

    public final Path.Segment getSegment()

  Get the `path segment` for this node.

  Returns:
    the path segment; never null

### getPath

    public final Path getPath()

  Get the current path to this node.

  Returns:
    the current path; never null

### getLocation

    public final Location getLocation()

  Get the current location for this node.

  Returns:
    the current location; never null

### setUuid

    public final void setUuid(UUID uuid)

### getOriginalLocation

    public final Location getOriginalLocation()

  Get the original location for this node prior to making any transient changes.

  Returns:
    the current location; never null

### createChild

    public GraphSession.Node<Payload,PropertyPayload> createChild(Name name)

  Create a new child node with the supplied name. The same-name-sibling index will be determined based upon the existing children.

  Parameters:
    `name` - the name of the new child node
  Returns:
    the new child node
  Throws:
    `IllegalArgumentException` - if the name is null
    `RepositorySourceException` - if this node must be loaded but doing so results in a problem

### createChild

    public GraphSession.Node<Payload,PropertyPayload> createChild(Name name,
                                                                  Property... properties)

  Create a new child node with the supplied name and multiple initial properties. The same-name-sibling index will be determined based upon the existing children.

  Parameters:
    `name` - the name of the new child node
    `properties` - the (non-identification) properties for the new node
  Returns:
    the new child node
  Throws:
    `IllegalArgumentException` - if the name or properties are null
    `ValidationException` - if the new node is not valid as a child
    `RepositorySourceException` - if this node must be loaded but doing so results in a problem

### createChild

    public GraphSession.Node<Payload,PropertyPayload> createChild(Name name,
                                                                  Collection<Property> idProperties)

  Create a new child node with the supplied name and multiple initial identification properties. The same-name-sibling index will be determined based upon the existing children.

  Parameters:
    `name` - the name of the new child node
    `idProperties` - the identification properties for the new node
  Returns:
    the new child node
  Throws:
    `IllegalArgumentException` - if the name or properties are null
    `ValidationException` - if the new node is not valid as a child
    `RepositorySourceException` - if this node must be loaded but doing so results in a problem

### createChild

    public GraphSession.Node<Payload,PropertyPayload> createChild(Name name,
                                                                  Collection<Property> idProperties,
                                                                  Property... remainingProperties)

  Create a new child node with the supplied name and multiple initial properties. The same-name-sibling index will be determined based upon the existing children.

  Parameters:
    `name` - the name of the new child node
    `idProperties` - the identification properties for the new node
    `remainingProperties` - the remaining (non-identification) properties for the new node
  Returns:
    the new child node
  Throws:
    `IllegalArgumentException` - if the name or properties are null
    `ValidationException` - if the new node is not valid as a child
    `RepositorySourceException` - if this node must be loaded but doing so results in a problem

### hasChild

    public boolean hasChild(Path.Segment segment)

  Determine whether this node has a child with the supplied name and SNS index.

  Parameters:
    `segment` - the segment of the child
  Returns:
    true if there is a child, or false if there is no such child
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### hasChild

    public boolean hasChild(Name name,
                            int sns)

  Determine whether this node has a child with the supplied name and SNS index.

  Parameters:
    `name` - the name of the child
    `sns` - the same-name-sibling index; must be 1 or more
  Returns:
    true if there is a child, or false if there is no such child
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChild

    public GraphSession.Node<Payload,PropertyPayload> getChild(Path.Segment segment)

  Get the child with the supplied segment.

  Parameters:
    `segment` - the segment of the child
  Returns:
    the child with the supplied name and SNS index, or null if the children have not yet been loaded
  Throws:
    `PathNotFoundException` - if the children have been loaded and the child does not exist
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getFirstChild

    public GraphSession.Node<Payload,PropertyPayload> getFirstChild(Name name)

  Get the first child matching the name and lowest SNS index

  Parameters:
    `name` - the name of the child
  Returns:
    the first child with the supplied name, or null if the children have not yet been loaded
  Throws:
    `PathNotFoundException` - if the children have been loaded and the child does not exist
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChild

    public GraphSession.Node<Payload,PropertyPayload> getChild(Name name,
                                                               int sns)

  Get the child with the supplied name and SNS index.

  Parameters:
    `name` - the name of the child
    `sns` - the same-name-sibling index; must be 1 or more
  Returns:
    the child with the supplied name and SNS index; never null
  Throws:
    `PathNotFoundException` - if the children have been loaded and the child does not exist
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChildren

    public Iterable<GraphSession.Node<Payload,PropertyPayload>> getChildren(Name name)

  Get an iterator over the children that have the supplied name.

  Parameters:
    `name` - the of the child nodes to be returned; may not be null
  Returns:
    an unmodifiable iterator over the cached children that have the supplied name; never null but possibly empty
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChildren

    public Iterable<GraphSession.Node<Payload,PropertyPayload>> getChildren()

  Get an iterator over the children.

  Returns:
    an unmodifiable iterator over the cached children; never null
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChildAfter

    public GraphSession.Node<Payload,PropertyPayload> getChildAfter(GraphSession.Node<Payload,PropertyPayload> child)

  Get the child node that immediately follows the supplied child.

  Parameters:
    `child` - the existing child; must be a child of this node
  Returns:
    the node that appears directly after the supplied child, or null if the supplied child is the last child

### getChildrenCount

    public int getChildrenCount()

  Get the number of children.

  Returns:
    the number of children in the cache
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getChildrenCount

    public int getChildrenCount(Name name)

  Get the number of children that have the same supplied name.

  Parameters:
    `name` - the name of the children to count
  Returns:
    the number of children in the cache
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### isLeaf

    public boolean isLeaf()

  Determine if this node is a leaf node with no children.

  Returns:
    true if this node has no children
  Throws:
    `RepositorySourceException` - if there is a problem loading this node's information from the store

### getProperty

    public GraphSession.PropertyInfo<PropertyPayload> getProperty(Name name)

  Get from this node the property with the supplied name.

  Parameters:
    `name` - the property name; may not be null
  Returns:
    the property with the supplied name, or null if there is no such property on this node

### setProperty

    public GraphSession.PropertyInfo<PropertyPayload> setProperty(Property property,
                                                                  boolean isMultiValued,
                                                                  PropertyPayload payload)

  Set the supplied property information on this node.

  Parameters:
    `property` - the new property; may not be null
    `isMultiValued` - true if the property is multi-valued
    `payload` - the optional payload for this property; may be null
  Returns:
    the previous information for the property, or null if there was no previous property
  Throws:
    `AccessControlException` - if the caller does not have the permission to perform the operation

### removeProperty

    public GraphSession.PropertyInfo<PropertyPayload> removeProperty(Name name)

  Remove a property from this node.

  Parameters:
    `name` - the name of the property to be removed; may not be null
  Returns:
    the previous information for the property, or null if there was no previous property

### getPropertyNames

    public Set<Name> getPropertyNames()

  Get the names of the properties on this node.

  Returns:
    the names of the properties; never null

### getProperties

    public Collection<GraphSession.PropertyInfo<PropertyPayload>> getProperties()

  Get the information for each of the properties on this node.

  Returns:
    the information for each of the properties; never null

### getPropertyCount

    public int getPropertyCount()

  Get the number of properties owned by this node.

  Returns:
    the number of properties; never negative

### isAtOrBelow

    public boolean isAtOrBelow(GraphSession.Node<Payload,PropertyPayload> other)

### getPayload

    public Payload getPayload()

  Returns:
    payload

### setPayload

    public void setPayload(Payload payload)

  Parameters:
    `payload` - Sets payload to the specified value.

### hashCode

    public final int hashCode()

  Overrides:
    `hashCode` in class `Object`
  See Also:
    `Object.hashCode()`

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`
  See Also:
    `Object.equals(java.lang.Object)`

### getString

    public String getString(NamespaceRegistry registry)

  Utility method to obtain a string representation that uses the namespace prefixes where appropriate.

  Parameters:
    `registry` - the namespace registry, or null if no prefixes should be used
  Returns:
    the string representation; never null

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`
  See Also:
    `Object.toString()`

### onLoadedNodes

    public void onLoadedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)

  Visit all nodes in the cache that are already loaded

  Parameters:
    `visitor` - the visitor; may not be null

### onCachedNodes

    public void onCachedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)

  Visit all loaded and unloaded nodes in the cache.

  Parameters:
    `visitor` - the visitor; may not be null

### onChangedNodes

    public void onChangedNodes(GraphSession.NodeVisitor<Payload,PropertyPayload> visitor)

  Visit all changed nodes in the cache.

  Parameters:
    `visitor` - the visitor; may not be null

### getSnapshot

    public GraphSession.StructureSnapshot<PropertyPayload> getSnapshot(boolean pathsOnly)

  Obtain a snapshot of the structure below this node.

  Parameters:
    `pathsOnly` - true if the snapshot should only include paths, or false if the entire locations should be included
  Returns:
    the snapshot

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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