Package org.opendaylight.graph.impl
Class ConnectedGraphImpl
- java.lang.Object
-
- org.opendaylight.graph.impl.ConnectedGraphImpl
-
- All Implemented Interfaces:
ConnectedGraph
public class ConnectedGraphImpl extends Object implements ConnectedGraph
This Class implements the Connected Graph for path computation algorithms.- Author:
- Olivier Dugeon, Philippe Niger
-
-
Constructor Summary
Constructors Constructor Description ConnectedGraphImpl(Graph newGraph, ConnectedGraphServer server)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectedEdge
addEdge(Edge edge)
Add Edge in the Connected Graph.void
addPrefix(Prefix prefix)
Add Prefix in the Connected Graph.ConnectedVertex
addVertex(Vertex vertex)
Add Vertex in the Connected Graph.void
clear()
Clear the Connected Graph by removing all Vertices, Edges and Prefixes.void
deleteEdge(EdgeKey key)
Connected Edge is kept in the edges Hash Map in order to memorize the total Bandwidth reserved by Constrained Paths that belong to this Edge.void
deletePrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix ippfx)
Remove the Prefix in the Connected Graph.void
deleteVertex(VertexKey key)
Remove the Vertex in the Connected Graph.ConnectedEdge
getConnectedEdge(Long key)
Returns the Edge associated to the given key.ConnectedEdge
getConnectedEdge(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address)
Returns the Edge associated to the given IP address.ConnectedVertex
getConnectedVertex(Long key)
Returns the Vertex associated to the given key.ConnectedVertex
getConnectedVertex(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address)
Returns the Vertex associated to the given IP address.List<ConnectedEdge>
getEdges()
Returns the list of Connected Edges that form this graph.int
getEdgesSize()
Returns the number of Edges in the graph.Graph
getGraph()
Returns the Graph associated to this Connected Graph.Prefix
getPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix prefix)
Returns the Prefix associated to the given IP prefix.List<Prefix>
getPrefixes()
Returns the list of Prefix that are stored in this graph.String
getSummary()
Returns the summary of the graph characteristics: number of Vertices, Edges and Prefix.List<ConnectedVertex>
getVertices()
Returns the list of Connected Vertices that form this graph.int
getVerticesSize()
Returns the number of Vertices in the graph.boolean
registerTrigger(ConnectedGraphTrigger trigger, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey key)
Register a trigger that is executed when a problem occurs on a Vertex or a Edge within the Connected Graph.String
toString()
Returns the name of the associated Graph.boolean
unRegisterTrigger(ConnectedGraphTrigger trigger, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey key)
Un-register a trigger that is already registered on the Connected Graph.
-
-
-
Constructor Detail
-
ConnectedGraphImpl
public ConnectedGraphImpl(Graph newGraph, ConnectedGraphServer server)
-
-
Method Detail
-
getGraph
public Graph getGraph()
Description copied from interface:ConnectedGraph
Returns the Graph associated to this Connected Graph.- Specified by:
getGraph
in interfaceConnectedGraph
- Returns:
- Graph
-
getVertices
public List<ConnectedVertex> getVertices()
Description copied from interface:ConnectedGraph
Returns the list of Connected Vertices that form this graph.- Specified by:
getVertices
in interfaceConnectedGraph
- Returns:
- list of Connected Vertices
-
getConnectedVertex
public ConnectedVertex getConnectedVertex(Long key)
Description copied from interface:ConnectedGraph
Returns the Vertex associated to the given key.- Specified by:
getConnectedVertex
in interfaceConnectedGraph
- Parameters:
key
- Unique Vertex Identifier- Returns:
- Vertex or null if there is no Vertex associated to the given key in this graph
-
getConnectedVertex
public ConnectedVertex getConnectedVertex(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address)
Description copied from interface:ConnectedGraph
Returns the Vertex associated to the given IP address.- Specified by:
getConnectedVertex
in interfaceConnectedGraph
- Parameters:
address
- IP address of the Loopback of the Vertex- Returns:
- Vertex or null if there is no Vertex associated to the given IP address in this graph
-
getVerticesSize
public int getVerticesSize()
Description copied from interface:ConnectedGraph
Returns the number of Vertices in the graph.- Specified by:
getVerticesSize
in interfaceConnectedGraph
- Returns:
- number of vertices
-
getEdges
public List<ConnectedEdge> getEdges()
Description copied from interface:ConnectedGraph
Returns the list of Connected Edges that form this graph.- Specified by:
getEdges
in interfaceConnectedGraph
- Returns:
- list of Connected Edges
-
getConnectedEdge
public ConnectedEdge getConnectedEdge(Long key)
Description copied from interface:ConnectedGraph
Returns the Edge associated to the given key.- Specified by:
getConnectedEdge
in interfaceConnectedGraph
- Parameters:
key
- Unique Edge Identifier- Returns:
- Edge or null if there is no Edge associated to the given key in this graph
-
getConnectedEdge
public ConnectedEdge getConnectedEdge(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress address)
Description copied from interface:ConnectedGraph
Returns the Edge associated to the given IP address.- Specified by:
getConnectedEdge
in interfaceConnectedGraph
- Parameters:
address
- IP address of the Edge- Returns:
- Edge or null if there is no Edge associated to the given IP address in this graph
-
getEdgesSize
public int getEdgesSize()
Description copied from interface:ConnectedGraph
Returns the number of Edges in the graph.- Specified by:
getEdgesSize
in interfaceConnectedGraph
- Returns:
- number of edges
-
getPrefixes
public List<Prefix> getPrefixes()
Description copied from interface:ConnectedGraph
Returns the list of Prefix that are stored in this graph.- Specified by:
getPrefixes
in interfaceConnectedGraph
- Returns:
- list of Prefix
-
getPrefix
public Prefix getPrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix prefix)
Description copied from interface:ConnectedGraph
Returns the Prefix associated to the given IP prefix.- Specified by:
getPrefix
in interfaceConnectedGraph
- Parameters:
prefix
- IPv4 or IPv6 prefix- Returns:
- Prefix that match the given IPv4 or IPv6 prefix
-
addVertex
public ConnectedVertex addVertex(Vertex vertex)
Description copied from interface:ConnectedGraph
Add Vertex in the Connected Graph. This action will automatically create the associated Connected Vertex and update the Graph in the DataStore.- Specified by:
addVertex
in interfaceConnectedGraph
- Parameters:
vertex
- Vertex to be added- Returns:
- Connected Vertex associated to the given Vertex
-
deleteVertex
public void deleteVertex(VertexKey key)
Description copied from interface:ConnectedGraph
Remove the Vertex in the Connected Graph. This action will automatically remove the associated Connected Vertex and update the Graph in the DataStore.- Specified by:
deleteVertex
in interfaceConnectedGraph
- Parameters:
key
- Unique Vertex Identifier
-
addEdge
public ConnectedEdge addEdge(Edge edge)
Description copied from interface:ConnectedGraph
Add Edge in the Connected Graph. This action will automatically create the associated Connected Edge and update the Graph in the DataStore.- Specified by:
addEdge
in interfaceConnectedGraph
- Parameters:
edge
- Edge to be added- Returns:
- Connected Edge associated to the given Edge
-
deleteEdge
public void deleteEdge(EdgeKey key)
Connected Edge is kept in the edges Hash Map in order to memorize the total Bandwidth reserved by Constrained Paths that belong to this Edge. Connected Edges are removed when the Connected Graph is cleared.- Specified by:
deleteEdge
in interfaceConnectedGraph
- Parameters:
key
- Unique Edge Identifier
-
addPrefix
public void addPrefix(Prefix prefix)
Description copied from interface:ConnectedGraph
Add Prefix in the Connected Graph. This action will automatically update the Graph in the DataStore.- Specified by:
addPrefix
in interfaceConnectedGraph
- Parameters:
prefix
- Prefix to be added
-
deletePrefix
public void deletePrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix ippfx)
Description copied from interface:ConnectedGraph
Remove the Prefix in the Connected Graph. This action will automatically update the Graph in the DataStore.- Specified by:
deletePrefix
in interfaceConnectedGraph
- Parameters:
ippfx
- IPv4 or IPv6 prefix
-
clear
public void clear()
Description copied from interface:ConnectedGraph
Clear the Connected Graph by removing all Vertices, Edges and Prefixes. This also remove the associated Graph in the Datastore.- Specified by:
clear
in interfaceConnectedGraph
-
getSummary
public String getSummary()
Description copied from interface:ConnectedGraph
Returns the summary of the graph characteristics: number of Vertices, Edges and Prefix.- Specified by:
getSummary
in interfaceConnectedGraph
- Returns:
- characteristics of the Graph as a string
-
registerTrigger
public boolean registerTrigger(ConnectedGraphTrigger trigger, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey key)
Description copied from interface:ConnectedGraph
Register a trigger that is executed when a problem occurs on a Vertex or a Edge within the Connected Graph.- Specified by:
registerTrigger
in interfaceConnectedGraph
- Parameters:
trigger
- Trigger to be registeredkey
- Topology Key Identifier- Returns:
- True if registration is done, false otherwise
-
unRegisterTrigger
public boolean unRegisterTrigger(ConnectedGraphTrigger trigger, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey key)
Description copied from interface:ConnectedGraph
Un-register a trigger that is already registered on the Connected Graph.- Specified by:
unRegisterTrigger
in interfaceConnectedGraph
- Parameters:
trigger
- Trigger to be unregisteredkey
- Topology Key Identifier- Returns:
- True if un-registration is done, false otherwise
-
-