Interface ImmutableGraphContainer<G extends ImmutableGraph<? extends Vertex,​? extends Edge>>

  • All Superinterfaces:
    GraphContainerInfo
    All Known Implementing Classes:
    AbstractDomainGraphContainer, CustomGraphContainer, GenericGraphContainer, SimpleDomainGraphContainer

    public interface ImmutableGraphContainer<G extends ImmutableGraph<? extends Vertex,​? extends Edge>>
    extends GraphContainerInfo
    Originally in OpenNMS there was the TopologyProvider (aka GraphProvider). Its responsibility was mixed as it represented the graph and also the manager for the graph. From the graph's perspective it was not possible to determine the label or description, as the API was very limited. It basically only supported calls like "getVertices()" or "getEdges()". At some point (around H18/H19) the need for multiple graphs provided by a TopologyProvider arose, as well as the possibility to push multiple graphs into OpenNMS. Back then it was decided to use GraphML as an "exchange format". Luckily GraphML already supported multiple GraphML graphs within one GraphML file. In order to make this compatible with OpenNMS the MetaTopologyProvider was born. It's responsibility was to provide multiple TopologyProviders, whereas to the user it looked like only one "Thing". To accomplish this, the MetaTopologyProvider returned a "default" or "preferred" TopologyProvider to use as default. Besides that what was shown to the user (e.g. label and description) when building the menu was not part of the Model, but enriched later on with OSGi service properties. When working on the "New Graph API", multiple graphs were considered from the start. This is when the ImmutableGraphContainer was born. Its purpose is similar to the GraphML definition: A ImmutableGraphContainer can hold multiple ImmutableGraphs. It can also just return a ImmutableGraph for a given namespace. Be aware, that a GraphContainer should always be fully populated (not enriched) when loaded by a provider.
    Author:
    mvrueden
    • Method Detail

      • getGraphs

        List<G> getGraphs()
        Returns the list of graphs provided by the container. The returned list, should never be null or empty.
        Returns:
        the provided graphs. Must never be null or empty
      • getGraph

        G getGraph​(String namespace)
        Returns the graph with the requested namespace, or null if it does not exist.
        Parameters:
        namespace - the namespace of the graph to get
        Returns:
        the graph with the requested namespace or null if it does not exist