Package org.opendaylight.graph.impl
Class ConnectedGraphImpl
java.lang.Object
org.opendaylight.graph.impl.ConnectedGraphImpl
- All Implemented Interfaces:
ConnectedGraph
This Class implements the Connected Graph for path computation algorithms.
- Author:
- Olivier Dugeon, Philippe Niger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd Edge in the Connected Graph.void
Add Prefix in the Connected Graph.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.getConnectedEdge
(Long key) Returns the Edge associated to the given key.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.getConnectedEdge
(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address) Returns the Edge associated to the given IPv4 address.getConnectedEdge
(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address) Returns the Edge associated to the given IPv6 address.getConnectedVertex
(Long key) Returns the Vertex associated to the given key.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.getEdges()
Returns the list of Connected Edges that form this graph.int
Returns the number of Edges in the graph.getGraph()
Returns the Graph associated to this Connected Graph.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.Returns the list of Prefix that are stored in this graph.Returns the summary of the graph characteristics: number of Vertices, Edges and Prefix.Returns the list of Connected Vertices that form this graph.int
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.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 Details
-
ConnectedGraphImpl
-
-
Method Details
-
getGraph
Description copied from interface:ConnectedGraph
Returns the Graph associated to this Connected Graph.- Specified by:
getGraph
in interfaceConnectedGraph
- Returns:
- Graph
-
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
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
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
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
-
getConnectedEdge
public ConnectedEdge getConnectedEdge(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address address) Description copied from interface:ConnectedGraph
Returns the Edge associated to the given IPv4 address.- Specified by:
getConnectedEdge
in interfaceConnectedGraph
- Parameters:
address
- IPv4 address of the Edge- Returns:
- Edge or null if there is no Edge associated to the given IP address in this graph
-
getConnectedEdge
public ConnectedEdge getConnectedEdge(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address address) Description copied from interface:ConnectedGraph
Returns the Edge associated to the given IPv6 address.- Specified by:
getConnectedEdge
in interfaceConnectedGraph
- Parameters:
address
- IPv6 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
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
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
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
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
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
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
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
-
toString
Returns the name of the associated Graph.
-