GraphManager (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.graph, interface: GraphManager

# Interface GraphManager

All Superinterfaces:
  `GraphChangeHandler`

All Known Implementing Classes:
  `GraphMap, NoSyncObjectStore, ObjectStore`

public interface GraphManager extends GraphChangeHandler
Represents a generic "managed" graph with nodes mapped by their ids. Inherited GraphChangeHandler methods are intended as callbacks for graph node objects to notify graph of their changes.

Since:
  1.2

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getNode(Object nodeId)`
  Returns a graph node given an id.
  `Collection<Object>`
  `registeredNodes()`
  Returns all graph nodes registered with GraphManager.
  `void`
  `registerNode(Object nodeId, Object nodeObject)`
  "Registers" a graph node, usually storing the node in some internal map using its id as a key.
  `Object`
  `unregisterNode(Object nodeId)`
  "Unregisters" a graph node, forgetting any information associated with nodeId.

  ### Methods inherited from interface GraphChangeHandler

  `arcCreated, arcDeleted, nodeCreated, nodeIdChanged, nodePropertyChanged, nodeRemoved`
  Modifier and Type
  Method
  Description
  `default void`
  `arcCreated(Object nodeId, Object targetNodeId, ArcId arcId)`
  Notifies implementing object that a new arc was created between two nodes.
  `default void`
  `arcDeleted(Object nodeId, Object targetNodeId, ArcId arcId)`
  Notifies implementing object that an arc between two nodes was deleted.
  `default void`
  `nodeCreated(Object nodeId)`
  Notifies implementing object that a new node was created in the graph.
  `default void`
  `nodeIdChanged(Object nodeId, Object newId)`
  Notifies implementing object that a node was assigned a new id.
  `default void`
  `nodePropertyChanged(Object nodeId, String property, Object oldValue, Object newValue)`
  Notifies implementing object that a node's property was modified.
  `default void`
  `nodeRemoved(Object nodeId)`
  Notifies implementing object that a node was removed from the graph.

- ## Method Details

  - ### getNode

    Object getNode(Object nodeId)
    Returns a graph node given an id.

  - ### registerNode

    void registerNode(Object nodeId, Object nodeObject)
    "Registers" a graph node, usually storing the node in some internal map using its id as a key.

  - ### unregisterNode

    Object unregisterNode(Object nodeId)
    "Unregisters" a graph node, forgetting any information associated with nodeId.

  - ### registeredNodes

    Collection<Object> registeredNodes()
    Returns all graph nodes registered with GraphManager.