Class CollapsibleGraph
- java.lang.Object
-
- org.opennms.features.topology.api.topo.CollapsibleGraph
-
- All Implemented Interfaces:
NamespaceAware,BackendGraph
public class CollapsibleGraph extends Object implements BackendGraph
-
-
Constructor Summary
Constructors Constructor Description CollapsibleGraph(BackendGraph delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdgeListener(EdgeListener listener)voidaddEdges(Edge... edges)voidaddVertexListener(VertexListener vertexListener)voidaddVertices(Vertex... vertices)voidclearEdges()voidclearVertices()static Set<Edge>collapseEdges(Set<Edge> edges, CollapsibleCriteria[] criteria)This function assumes that all criteria passed in are marked as collapsed.static Set<Vertex>collapseVertices(Set<Vertex> vertices, CollapsibleCriteria[] criteria)EdgeconnectVertices(String edgeId, VertexRef sourceVertextId, VertexRef targetVertextId)booleancontainsVertexId(String id)booleancontainsVertexId(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()Set<VertexRef>getFocusNodes(Criteria... criteria)static Map<VertexRef,Set<Vertex>>getMapOfVerticesToCollapsedVertices(CollapsibleCriteria[] criteria)intgetMaxSemanticZoomLevel(Criteria... criteria)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.)intgetSemanticZoomLevel(VertexRef vertex)VertexgetVertex(String namespace, String id)VertexgetVertex(VertexRef reference, Criteria... criteria)intgetVertexTotalCount()Collection<Vertex>getVertices(int semanticZoomLevel, Criteria... criteria)List<Vertex>getVertices(Collection<? extends VertexRef> references, Criteria... criteria)List<Vertex>getVertices(CollapsibleRef collapsibleRef, Criteria... criteria)List<Vertex>getVertices(Criteria... criteria)Return an immutable list of vertices that match the criteria.voidremoveEdgeListener(EdgeListener listener)voidremoveEdges(EdgeRef... edges)voidremoveVertex(VertexRef... vertexId)voidremoveVertexListener(VertexListener vertexListener)voidresetContainer()
-
-
-
Constructor Detail
-
CollapsibleGraph
public CollapsibleGraph(BackendGraph delegate)
-
-
Method Detail
-
containsVertexId
public boolean containsVertexId(String id)
- Specified by:
containsVertexIdin interfaceBackendGraph
-
containsVertexId
public boolean containsVertexId(VertexRef id, Criteria... criteria)
- Specified by:
containsVertexIdin interfaceBackendGraph
-
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 Collection<Vertex> getVertices(int semanticZoomLevel, Criteria... criteria)
-
getSemanticZoomLevel
public int getSemanticZoomLevel(VertexRef vertex)
-
getMaxSemanticZoomLevel
public int getMaxSemanticZoomLevel(Criteria... criteria)
-
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
-
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
-
clearVertices
public void clearVertices()
- Specified by:
clearVerticesin interfaceBackendGraph
-
getVertexTotalCount
public int getVertexTotalCount()
- Specified by:
getVertexTotalCountin interfaceBackendGraph
-
addVertices
public void addVertices(Vertex... vertices)
- Specified by:
addVerticesin interfaceBackendGraph
-
removeVertex
public void removeVertex(VertexRef... vertexId)
- Specified by:
removeVertexin interfaceBackendGraph
-
getEdge
public Edge getEdge(String namespace, String id)
- Specified by:
getEdgein interfaceBackendGraph
-
getEdge
public Edge getEdge(EdgeRef reference)
- Specified by:
getEdgein interfaceBackendGraph
-
collapseVertices
public static Set<Vertex> collapseVertices(Set<Vertex> vertices, CollapsibleCriteria[] criteria)
-
getMapOfVerticesToCollapsedVertices
public static Map<VertexRef,Set<Vertex>> getMapOfVerticesToCollapsedVertices(CollapsibleCriteria[] criteria)
-
collapseEdges
public static Set<Edge> collapseEdges(Set<Edge> edges, CollapsibleCriteria[] criteria)
This function assumes that all criteria passed in are marked as collapsed.- Parameters:
edges-criteria-- Returns:
-
getVertices
public List<Vertex> getVertices(CollapsibleRef collapsibleRef, Criteria... criteria)
-
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
-
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 listener)
- Specified by:
addEdgeListenerin interfaceBackendGraph
-
removeEdgeListener
public void removeEdgeListener(EdgeListener listener)
- Specified by:
removeEdgeListenerin interfaceBackendGraph
-
clearEdges
public void clearEdges()
- Specified by:
clearEdgesin interfaceBackendGraph
-
getEdgeTotalCount
public int getEdgeTotalCount()
- Specified by:
getEdgeTotalCountin interfaceBackendGraph
-
getEdgeIdsForVertex
public EdgeRef[] getEdgeIdsForVertex(VertexRef vertex)
- Specified by:
getEdgeIdsForVertexin interfaceBackendGraph
-
getEdgeIdsForVertices
public 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
-
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.
-
-