Class SimpleGraph
- java.lang.Object
-
- org.opennms.features.topology.api.topo.simple.SimpleGraph
-
- All Implemented Interfaces:
NamespaceAware,BackendGraph
- Direct Known Subclasses:
BusinessServiceGraph,LegacyBackendGraph
public class SimpleGraph extends Object implements BackendGraph
-
-
Constructor Summary
Constructors Constructor Description SimpleGraph(String namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(Collection<Vertex> vertices)voidadd(List<Edge> edges)voidadd(Edge... edges)voidadd(Vertex... vertices)voidaddEdgeListener(EdgeListener edgeListener)voidaddEdges(Edge... edges)voidaddVertexListener(VertexListener vertexListener)voidaddVertices(Vertex... vertices)voidclearEdges()voidclearVertices()EdgeconnectVertices(String edgeId, VertexRef sourceVertextId, VertexRef targetVertextId)protected AbstractEdgeconnectVertices(String edgeId, VertexRef sourceVertexRef, VertexRef targetVertexRef, String namespace)booleancontainsVertexId(String id)Deprecated.You should search by the namespace and ID tuple insteadbooleancontainsVertexId(VertexRef id, Criteria... criteria)booleancontributesTo(String namespace)Defines if the current implementation contributes to the given namespace.EdgegetEdge(String namespace, String id)EdgegetEdge(EdgeRef reference)EdgeRef[]getEdgeIdsForVertex(VertexRef vertex)Map<VertexRef,Set<EdgeRef>>getEdgeIdsForVertices(VertexRef... vertices)This function can be used for efficiency when you need theEdgeRefinstances for a large number of vertices.List<Edge>getEdges(Collection<? extends EdgeRef> references)Return an immutable list of all edges that match this set of references.List<Edge>getEdges(Criteria... criteria)Return an immutable list of edges that match the criteria.intgetEdgeTotalCount()StringgetNamespace()A string used to identify references belonging to this provider May only contain characters that make for a reasonable Java identifier such as letters digits and underscore (no colons, periods, commas etc.)VertexgetVertex(String namespace, String id)VertexgetVertex(VertexRef reference, Criteria... criteria)intgetVertexTotalCount()List<Vertex>getVertices(Collection<? extends VertexRef> references, Criteria... criteria)List<Vertex>getVertices(Criteria... criteria)Return an immutable list of vertices that match the criteria.voidremove(EdgeRef... edges)voidremove(VertexRef... vertices)voidremoveEdgeListener(EdgeListener edgeListener)voidremoveEdges(EdgeRef... edges)voidremoveVertex(VertexRef... vertexId)voidremoveVertexListener(VertexListener vertexListener)voidresetContainer()voidsetEdges(List<Edge> edges)voidsetVertices(List<Vertex> vertices)
-
-
-
Constructor Detail
-
SimpleGraph
public SimpleGraph(String namespace)
-
-
Method Detail
-
getNamespace
public String getNamespace()
Description copied from interface:NamespaceAwareA string used to identify references belonging to this provider May only contain characters that make for a reasonable Java identifier such as letters digits and underscore (no colons, periods, commas etc.)- Specified by:
getNamespacein interfaceNamespaceAware- Returns:
- the namespace, e.g. "nodes".
-
contributesTo
public boolean contributesTo(String namespace)
Description copied from interface:NamespaceAwareDefines if the current implementation contributes to the given namespace. This is usually the case, when the given namespaces equalsNamespaceAware.getNamespace(), but is not a requirement.- Specified by:
contributesToin interfaceNamespaceAware- Parameters:
namespace- the namespace to contribute to- Returns:
true, if the current implementation contributes to the given namespace, otherwisefalse.
-
getVertex
public Vertex getVertex(String namespace, String id)
- Specified by:
getVertexin interfaceBackendGraph
-
getVertex
public Vertex getVertex(VertexRef reference, Criteria... criteria)
- Specified by:
getVertexin interfaceBackendGraph
-
getVertices
public List<Vertex> getVertices(Collection<? extends VertexRef> references, Criteria... criteria)
- Specified by:
getVerticesin interfaceBackendGraph
-
addVertexListener
public void addVertexListener(VertexListener vertexListener)
- Specified by:
addVertexListenerin interfaceBackendGraph
-
removeVertexListener
public void removeVertexListener(VertexListener vertexListener)
- Specified by:
removeVertexListenerin interfaceBackendGraph
-
add
public void add(Vertex... vertices)
-
add
public void add(Collection<Vertex> vertices)
-
remove
public void remove(VertexRef... vertices)
-
getVertices
public List<Vertex> getVertices(Criteria... criteria)
Description copied from interface:BackendGraphReturn an immutable list of vertices that match the criteria.- Specified by:
getVerticesin interfaceBackendGraph
-
clearVertices
public void clearVertices()
- Specified by:
clearVerticesin interfaceBackendGraph
-
getVertexTotalCount
public int getVertexTotalCount()
- Specified by:
getVertexTotalCountin interfaceBackendGraph
-
containsVertexId
public boolean containsVertexId(String id)
Deprecated.You should search by the namespace and ID tuple instead- Specified by:
containsVertexIdin interfaceBackendGraph
-
containsVertexId
public boolean containsVertexId(VertexRef id, Criteria... criteria)
- Specified by:
containsVertexIdin interfaceBackendGraph
-
getEdge
public Edge getEdge(String namespace, String id)
- Specified by:
getEdgein interfaceBackendGraph
-
getEdge
public Edge getEdge(EdgeRef reference)
- Specified by:
getEdgein interfaceBackendGraph
-
getEdges
public List<Edge> getEdges(Collection<? extends EdgeRef> references)
Description copied from interface:BackendGraphReturn an immutable list of all edges that match this set of references.- Specified by:
getEdgesin interfaceBackendGraph
-
addEdgeListener
public void addEdgeListener(EdgeListener edgeListener)
- Specified by:
addEdgeListenerin interfaceBackendGraph
-
removeEdgeListener
public void removeEdgeListener(EdgeListener edgeListener)
- Specified by:
removeEdgeListenerin interfaceBackendGraph
-
getEdges
public List<Edge> getEdges(Criteria... criteria)
Description copied from interface:BackendGraphReturn an immutable list of edges that match the criteria.- Specified by:
getEdgesin interfaceBackendGraph
-
clearEdges
public void clearEdges()
- Specified by:
clearEdgesin interfaceBackendGraph
-
getEdgeTotalCount
public int getEdgeTotalCount()
- Specified by:
getEdgeTotalCountin interfaceBackendGraph
-
add
public void add(Edge... edges)
-
remove
public void remove(EdgeRef... edges)
-
addVertices
public void addVertices(Vertex... vertices)
- Specified by:
addVerticesin interfaceBackendGraph
-
removeVertex
public void removeVertex(VertexRef... vertexId)
- Specified by:
removeVertexin interfaceBackendGraph
-
getEdgeIdsForVertex
public EdgeRef[] getEdgeIdsForVertex(VertexRef vertex)
- Specified by:
getEdgeIdsForVertexin interfaceBackendGraph
-
getEdgeIdsForVertices
public final Map<VertexRef,Set<EdgeRef>> getEdgeIdsForVertices(VertexRef... vertices)
Description copied from interface:BackendGraphThis function can be used for efficiency when you need theEdgeRefinstances for a large number of vertices.- Specified by:
getEdgeIdsForVerticesin interfaceBackendGraph
-
addEdges
public void addEdges(Edge... edges)
- Specified by:
addEdgesin interfaceBackendGraph
-
removeEdges
public void removeEdges(EdgeRef... edges)
- Specified by:
removeEdgesin interfaceBackendGraph
-
connectVertices
public Edge connectVertices(String edgeId, VertexRef sourceVertextId, VertexRef targetVertextId)
- Specified by:
connectVerticesin interfaceBackendGraph
-
resetContainer
public void resetContainer()
- Specified by:
resetContainerin interfaceBackendGraph
-
connectVertices
protected final AbstractEdge connectVertices(String edgeId, VertexRef sourceVertexRef, VertexRef targetVertexRef, String namespace)
-
-