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 ConnectedEdgeaddEdge(Edge edge)Add Edge in the Connected Graph.voidaddPrefix(Prefix prefix)Add Prefix in the Connected Graph.ConnectedVertexaddVertex(Vertex vertex)Add Vertex in the Connected Graph.voidclear()Clear the Connected Graph by removing all Vertices, Edges and Prefixes.voiddeleteEdge(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.voiddeletePrefix(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix ippfx)Remove the Prefix in the Connected Graph.voiddeleteVertex(VertexKey key)Remove the Vertex in the Connected Graph.ConnectedEdgegetConnectedEdge(Long key)Returns the Edge associated to the given key.ConnectedEdgegetConnectedEdge(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.ConnectedVertexgetConnectedVertex(Long key)Returns the Vertex associated to the given key.ConnectedVertexgetConnectedVertex(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.intgetEdgesSize()Returns the number of Edges in the graph.GraphgetGraph()Returns the Graph associated to this Connected Graph.PrefixgetPrefix(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.StringgetSummary()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.intgetVerticesSize()Returns the number of Vertices in the graph.booleanregisterTrigger(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.StringtoString()Returns the name of the associated Graph.booleanunRegisterTrigger(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:ConnectedGraphReturns the Graph associated to this Connected Graph.- Specified by:
getGraphin interfaceConnectedGraph- Returns:
- Graph
-
getVertices
public List<ConnectedVertex> getVertices()
Description copied from interface:ConnectedGraphReturns the list of Connected Vertices that form this graph.- Specified by:
getVerticesin interfaceConnectedGraph- Returns:
- list of Connected Vertices
-
getConnectedVertex
public ConnectedVertex getConnectedVertex(Long key)
Description copied from interface:ConnectedGraphReturns the Vertex associated to the given key.- Specified by:
getConnectedVertexin 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:ConnectedGraphReturns the Vertex associated to the given IP address.- Specified by:
getConnectedVertexin 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:ConnectedGraphReturns the number of Vertices in the graph.- Specified by:
getVerticesSizein interfaceConnectedGraph- Returns:
- number of vertices
-
getEdges
public List<ConnectedEdge> getEdges()
Description copied from interface:ConnectedGraphReturns the list of Connected Edges that form this graph.- Specified by:
getEdgesin interfaceConnectedGraph- Returns:
- list of Connected Edges
-
getConnectedEdge
public ConnectedEdge getConnectedEdge(Long key)
Description copied from interface:ConnectedGraphReturns the Edge associated to the given key.- Specified by:
getConnectedEdgein 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:ConnectedGraphReturns the Edge associated to the given IP address.- Specified by:
getConnectedEdgein 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:ConnectedGraphReturns the number of Edges in the graph.- Specified by:
getEdgesSizein interfaceConnectedGraph- Returns:
- number of edges
-
getPrefixes
public List<Prefix> getPrefixes()
Description copied from interface:ConnectedGraphReturns the list of Prefix that are stored in this graph.- Specified by:
getPrefixesin 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:ConnectedGraphReturns the Prefix associated to the given IP prefix.- Specified by:
getPrefixin 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:ConnectedGraphAdd Vertex in the Connected Graph. This action will automatically create the associated Connected Vertex and update the Graph in the DataStore.- Specified by:
addVertexin 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:ConnectedGraphRemove the Vertex in the Connected Graph. This action will automatically remove the associated Connected Vertex and update the Graph in the DataStore.- Specified by:
deleteVertexin interfaceConnectedGraph- Parameters:
key- Unique Vertex Identifier
-
addEdge
public ConnectedEdge addEdge(Edge edge)
Description copied from interface:ConnectedGraphAdd Edge in the Connected Graph. This action will automatically create the associated Connected Edge and update the Graph in the DataStore.- Specified by:
addEdgein 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:
deleteEdgein interfaceConnectedGraph- Parameters:
key- Unique Edge Identifier
-
addPrefix
public void addPrefix(Prefix prefix)
Description copied from interface:ConnectedGraphAdd Prefix in the Connected Graph. This action will automatically update the Graph in the DataStore.- Specified by:
addPrefixin 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:ConnectedGraphRemove the Prefix in the Connected Graph. This action will automatically update the Graph in the DataStore.- Specified by:
deletePrefixin interfaceConnectedGraph- Parameters:
ippfx- IPv4 or IPv6 prefix
-
clear
public void clear()
Description copied from interface:ConnectedGraphClear the Connected Graph by removing all Vertices, Edges and Prefixes. This also remove the associated Graph in the Datastore.- Specified by:
clearin interfaceConnectedGraph
-
getSummary
public String getSummary()
Description copied from interface:ConnectedGraphReturns the summary of the graph characteristics: number of Vertices, Edges and Prefix.- Specified by:
getSummaryin 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:ConnectedGraphRegister a trigger that is executed when a problem occurs on a Vertex or a Edge within the Connected Graph.- Specified by:
registerTriggerin 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:ConnectedGraphUn-register a trigger that is already registered on the Connected Graph.- Specified by:
unRegisterTriggerin interfaceConnectedGraph- Parameters:
trigger- Trigger to be unregisteredkey- Topology Key Identifier- Returns:
- True if un-registration is done, false otherwise
-
-