Package org.opendaylight.graph.impl
Class ConnectedGraphServer
java.lang.Object
org.opendaylight.graph.impl.ConnectedGraphServer
- All Implemented Interfaces:
AutoCloseable
,EventListener
,ConnectedGraphProvider
,org.opendaylight.mdsal.binding.api.TransactionChainListener
@Singleton
public final class ConnectedGraphServer
extends Object
implements 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
ConstructorDescriptionConnectedGraphServer
(org.opendaylight.mdsal.binding.api.DataBroker dataBroker) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add Edge to existing Graph.Add a Graph.void
Add Prefix to existing Graph.void
Add Vertex to existing Graph.void
clearGraph
(Graph graph) Clear Graph.void
close()
Remove the Operation Graph Model and destroy the transaction chain.createConnectedGraph
(String name, Graph.DomainScope scope) Create Connected Graph and associated Graph for given name and Graph Type.void
deleteEdge
(Graph graph, Edge edge) Remove Edge to existing Graph.void
deleteGraph
(GraphKey key) Remove a Graph.void
deletePrefix
(Graph graph, Prefix prefix) Remove Prefix to existing Graph.void
deleteVertex
(Graph graph, Vertex vertex) Remove Vertex to existing Graph.getConnectedGraph
(String name) Returns Connected Graph for the given graph name.Returns Connected Graph for the given graph key.Returns all registered Connected Graphs.Returns Graph for the given graph name.Returns the Graph for the given graph 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
Reset the transaction chain only so that the PingPong transaction chain will become usable again.
-
Constructor Details
-
ConnectedGraphServer
@Inject public ConnectedGraphServer(org.opendaylight.mdsal.binding.api.DataBroker dataBroker)
-
-
Method Details
-
close
@PreDestroy public void close()Remove the Operation Graph Model and destroy the transaction chain.- Specified by:
close
in interfaceAutoCloseable
-
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
Clear Graph. This method is used by the Connected Graph to clear associated Graph.- Parameters:
graph
- Graph associated to the Connected Graph
-
addVertex
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 storedvertex
- Vertex to be inserted in the graphold
- Old vertex when performing an update. Must be null for a simple addition
-
deleteVertex
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 storedvertex
- Vertex to be removed
-
addEdge
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 storededge
- Edge to be inserted in the graphold
- Old edge when performing an update. Must be null for a simple addition
-
deleteEdge
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 storededge
- Edge to be removed
-
addPrefix
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 storedprefix
- Prefix to be interted in the graph
-
deletePrefix
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 storedprefix
- 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 interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-
onTransactionChainSuccessful
public void onTransactionChainSuccessful(org.opendaylight.mdsal.binding.api.TransactionChain transactionChain) - Specified by:
onTransactionChainSuccessful
in interfaceorg.opendaylight.mdsal.binding.api.TransactionChainListener
-
getConnectedGraphs
Description copied from interface:ConnectedGraphProvider
Returns all registered Connected Graphs.- Specified by:
getConnectedGraphs
in interfaceConnectedGraphProvider
- Returns:
- List of Connected Graph
-
getConnectedGraph
Description copied from interface:ConnectedGraphProvider
Returns Connected Graph for the given graph key.- Specified by:
getConnectedGraph
in interfaceConnectedGraphProvider
- Parameters:
key
- Unique Graph Identifier- Returns:
- Connected Graph
-
getConnectedGraph
Description copied from interface:ConnectedGraphProvider
Returns Connected Graph for the given graph name.- Specified by:
getConnectedGraph
in interfaceConnectedGraphProvider
- Parameters:
name
- Name of the Graph- Returns:
- Connected Graph
-
getGraph
Description copied from interface:ConnectedGraphProvider
Returns the Graph for the given graph key.- Specified by:
getGraph
in interfaceConnectedGraphProvider
- Parameters:
key
- Unique Graph Identifier- Returns:
- Graph
-
getGraph
Description copied from interface:ConnectedGraphProvider
Returns Graph for the given graph name.- Specified by:
getGraph
in interfaceConnectedGraphProvider
- Parameters:
name
- Name of the Graph- Returns:
- Graph
-
createConnectedGraph
Description copied from interface:ConnectedGraphProvider
Create Connected Graph and associated Graph for given name and Graph Type. The associated Graph is also stored in the DataStore.- Specified by:
createConnectedGraph
in interfaceConnectedGraphProvider
- Parameters:
name
- Name of the Graphscope
- Domain scope of the Graph (Intra or Inter domain)- Returns:
- Connected Graph
-
addGraph
Description copied from interface:ConnectedGraphProvider
Add a Graph. This action will automatically create the associated Connected Graph and store is in the DataStore.- Specified by:
addGraph
in interfaceConnectedGraphProvider
- Parameters:
graph
- Graph to be added- Returns:
- Connected Graph
-
deleteGraph
Description copied from interface:ConnectedGraphProvider
Remove a Graph. This action will automatically delete the associated Connected Graph and store is in the DataStore.- Specified by:
deleteGraph
in interfaceConnectedGraphProvider
- Parameters:
key
- Graph Identifier
-