Package org.opennms.netmgt.graph.domain
Class AbstractDomainGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
- java.lang.Object
-
- org.opennms.netmgt.graph.domain.AbstractDomainGraph<V,E>
-
- All Implemented Interfaces:
ImmutableGraph<V,E>
,GraphInfo
- Direct Known Subclasses:
ApplicationGraph
,BusinessServiceGraph
,CustomGraph
,LegacyGraph
,SimpleDomainGraph
public abstract class AbstractDomainGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge> extends java.lang.Object implements ImmutableGraph<V,E>
Acts as a domain specific view on aGenericGraph
. Can be extended by a domain specific graph class. It contains no data of it's own but operates on the data of it's wrappedGenericGraph
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractDomainGraph.AbstractDomainGraphBuilder<T extends AbstractDomainGraph.AbstractDomainGraphBuilder,V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
Constructor Summary
Constructors Constructor Description AbstractDomainGraph(GenericGraph genericGraph)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GenericGraph
asGenericGraph()
protected abstract E
convert(GenericEdge edge)
protected abstract ImmutableGraph<V,E>
convert(GenericGraph graph)
protected abstract V
convert(GenericVertex vertex)
boolean
equals(java.lang.Object o)
java.util.Collection<E>
getConnectingEdges(V vertex)
Focus
getDefaultFocus()
java.lang.String
getDescription()
A short description of the graph to help user's understand what the context of the graph is, e.g.: "This provider shows the hierarchy of the defined Business Services and their computed operational states."E
getEdge(java.lang.String id)
java.util.List<java.lang.String>
getEdgeIds()
java.util.List<E>
getEdges()
java.lang.String
getLabel()
A user friendly name/label of the graph, e.g.java.lang.String
getNamespace()
The namespace of the graph.java.util.Collection<V>
getNeighbors(V vertex)
V
getVertex(java.lang.String id)
java.util.List<java.lang.String>
getVertexIds()
java.util.List<V>
getVertices()
ImmutableGraph<V,E>
getView(java.util.Collection<V> verticesInFocus, int szl)
int
hashCode()
java.util.List<E>
resolveEdges(java.util.Collection<java.lang.String> edgeIds)
V
resolveVertex(VertexRef vertexRef)
java.util.List<V>
resolveVertices(java.util.Collection<java.lang.String> vertexIds)
java.util.List<V>
resolveVertices(NodeRef nodeRef)
java.lang.String
toString()
-
-
-
Constructor Detail
-
AbstractDomainGraph
public AbstractDomainGraph(GenericGraph genericGraph)
-
-
Method Detail
-
getVertices
public java.util.List<V> getVertices()
- Specified by:
getVertices
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getEdges
public java.util.List<E> getEdges()
- Specified by:
getEdges
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
convert
protected abstract ImmutableGraph<V,E> convert(GenericGraph graph)
-
convert
protected abstract V convert(GenericVertex vertex)
-
convert
protected abstract E convert(GenericEdge edge)
-
getVertex
public V getVertex(java.lang.String id)
- Specified by:
getVertex
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getEdge
public E getEdge(java.lang.String id)
- Specified by:
getEdge
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getVertexIds
public java.util.List<java.lang.String> getVertexIds()
- Specified by:
getVertexIds
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getEdgeIds
public java.util.List<java.lang.String> getEdgeIds()
- Specified by:
getEdgeIds
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getView
public ImmutableGraph<V,E> getView(java.util.Collection<V> verticesInFocus, int szl)
- Specified by:
getView
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
resolveVertices
public java.util.List<V> resolveVertices(NodeRef nodeRef)
- Specified by:
resolveVertices
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
resolveVertices
public java.util.List<V> resolveVertices(java.util.Collection<java.lang.String> vertexIds)
- Specified by:
resolveVertices
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
resolveVertex
public V resolveVertex(VertexRef vertexRef)
- Specified by:
resolveVertex
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
resolveEdges
public java.util.List<E> resolveEdges(java.util.Collection<java.lang.String> edgeIds)
- Specified by:
resolveEdges
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getNeighbors
public java.util.Collection<V> getNeighbors(V vertex)
- Specified by:
getNeighbors
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getConnectingEdges
public java.util.Collection<E> getConnectingEdges(V vertex)
- Specified by:
getConnectingEdges
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getDefaultFocus
public Focus getDefaultFocus()
- Specified by:
getDefaultFocus
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
asGenericGraph
public GenericGraph asGenericGraph()
- Specified by:
asGenericGraph
in interfaceImmutableGraph<V extends AbstractDomainVertex,E extends AbstractDomainEdge>
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:GraphInfo
The namespace of the graph. Should be unique over all Graphs- Specified by:
getNamespace
in interfaceGraphInfo
-
getDescription
public java.lang.String getDescription()
Description copied from interface:GraphInfo
A short description of the graph to help user's understand what the context of the graph is, e.g.: "This provider shows the hierarchy of the defined Business Services and their computed operational states."- Specified by:
getDescription
in interfaceGraphInfo
-
getLabel
public java.lang.String getLabel()
Description copied from interface:GraphInfo
A user friendly name/label of the graph, e.g. "Business Service Graph"
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-