Class ConnectedGraphServer

  • All Implemented Interfaces:
    AutoCloseable, EventListener, org.opendaylight.graph.ConnectedGraphProvider, org.opendaylight.mdsal.binding.api.TransactionChainListener

    @Singleton
    public final class ConnectedGraphServer
    extends Object
    implements org.opendaylight.graph.ConnectedGraphProvider, org.opendaylight.mdsal.binding.api.TransactionChainListener, AutoCloseable
    This Class Implements the DataStoreService interface providing the methods required to manage the network representation elements in the datastore.
    Author:
    Olivier Dugeon, Philippe Niger
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectedGraphServer​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addEdge​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge edge, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge old)
      Add Edge to existing Graph.
      org.opendaylight.graph.ConnectedGraph addGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph)  
      void addPrefix​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix prefix)
      Add Prefix to existing Graph.
      void addVertex​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex vertex, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex old)
      Add Vertex to existing Graph.
      void clearGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph)
      Clear Graph.
      void close()
      Remove the Operation Graph Model and destroy the transaction chain.
      org.opendaylight.graph.ConnectedGraph createConnectedGraph​(String name, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph.DomainScope scope)  
      void deleteEdge​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge edge)
      Remove Edge to existing Graph.
      void deleteGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)  
      void deletePrefix​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix prefix)
      Remove Prefix to existing Graph.
      void deleteVertex​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex vertex)
      Remove Vertex to existing Graph.
      org.opendaylight.graph.ConnectedGraph getConnectedGraph​(String name)  
      org.opendaylight.graph.ConnectedGraph getConnectedGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)  
      List<org.opendaylight.graph.ConnectedGraph> getConnectedGraphs()  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph getGraph​(String name)  
      org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph getGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)  
      void onTransactionChainFailed​(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain, org.opendaylight.mdsal.binding.api.Transaction transaction, Throwable cause)  
      void onTransactionChainSuccessful​(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain)  
      protected void resetTransactionChain()
      Reset the transaction chain only so that the PingPong transaction chain will become usable again.
    • Constructor Detail

      • ConnectedGraphServer

        @Inject
        public ConnectedGraphServer​(org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
    • Method Detail

      • close

        @PreDestroy
        public void close()
        Remove the Operation Graph Model and destroy the transaction chain.
        Specified by:
        close in interface AutoCloseable
      • resetTransactionChain

        protected void resetTransactionChain()
        Reset the transaction chain only so that the PingPong transaction chain will become usable again. However, there will be data loss if we do not apply the previous failed transaction again
      • clearGraph

        public void clearGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph)
        Clear Graph. This method is used by the Connected Graph to clear associated Graph.
        Parameters:
        graph - Graph associated to the Connected Graph
      • addVertex

        public void addVertex​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                              org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex vertex,
                              org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex old)
        Add Vertex to existing Graph. Old vertex is remove first. This method is called when a Connected Vertex is created (See addVertex() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the vertex will be stored
        vertex - Vertex to be inserted in the graph
        old - Old vertex when performing an update. Must be null for a simple addition
      • deleteVertex

        public void deleteVertex​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                                 org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Vertex vertex)
        Remove Vertex to existing Graph. This method is called when a Connected Vertex is removed (See deleteVertex() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the vertex is stored
        vertex - Vertex to be removed
      • addEdge

        public void addEdge​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge edge,
                            org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge old)
        Add Edge to existing Graph. Old edge is remove first. This method is called when a Connected Edge is created (See addEdge() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the edge will be stored
        edge - Edge to be inserted in the graph
        old - Old edge when performing an update. Must be null for a simple addition
      • deleteEdge

        public void deleteEdge​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                               org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Edge edge)
        Remove Edge to existing Graph. This method is called when a Connected Edge is removed (See deleteEdge() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the edge is stored
        edge - Edge to be removed
      • addPrefix

        public void addPrefix​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                              org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix prefix)
        Add Prefix to existing Graph. This method is called when a Prefix is added to a Connected Vertex (See addPrefix() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the prefix will be stored
        prefix - Prefix to be interted in the graph
      • deletePrefix

        public void deletePrefix​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph,
                                 org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.graph.Prefix prefix)
        Remove Prefix to existing Graph. This method is called when a Prefix is removed from a Connected Vertex (See deletePrefix() method from ConnectedGraph Interface).
        Parameters:
        graph - Graph where the prefix is stored
        prefix - Prefix to be removed
      • onTransactionChainFailed

        public void onTransactionChainFailed​(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain,
                                             org.opendaylight.mdsal.binding.api.Transaction transaction,
                                             Throwable cause)
        Specified by:
        onTransactionChainFailed in interface org.opendaylight.mdsal.binding.api.TransactionChainListener
      • onTransactionChainSuccessful

        public void onTransactionChainSuccessful​(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain)
        Specified by:
        onTransactionChainSuccessful in interface org.opendaylight.mdsal.binding.api.TransactionChainListener
      • getConnectedGraphs

        public List<org.opendaylight.graph.ConnectedGraph> getConnectedGraphs()
        Specified by:
        getConnectedGraphs in interface org.opendaylight.graph.ConnectedGraphProvider
      • getConnectedGraph

        public org.opendaylight.graph.ConnectedGraph getConnectedGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)
        Specified by:
        getConnectedGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • getConnectedGraph

        public org.opendaylight.graph.ConnectedGraph getConnectedGraph​(String name)
        Specified by:
        getConnectedGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • getGraph

        public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph getGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)
        Specified by:
        getGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • getGraph

        public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph getGraph​(String name)
        Specified by:
        getGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • createConnectedGraph

        public org.opendaylight.graph.ConnectedGraph createConnectedGraph​(String name,
                                                                          org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph.DomainScope scope)
        Specified by:
        createConnectedGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • addGraph

        public org.opendaylight.graph.ConnectedGraph addGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.Graph graph)
        Specified by:
        addGraph in interface org.opendaylight.graph.ConnectedGraphProvider
      • deleteGraph

        public void deleteGraph​(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.graph.rev191125.graph.topology.GraphKey key)
        Specified by:
        deleteGraph in interface org.opendaylight.graph.ConnectedGraphProvider