Package org.opennms.netmgt.graph.api
Class NodeRef
- java.lang.Object
-
- org.opennms.netmgt.graph.api.NodeRef
-
public class NodeRef extends Object
Object to reference a node. This can either be done by setting thenodeId
orforeignSource
ANDforeignId
fields. If created from an OnmsNode all fields may be populated. Note: This should allow for easier node referencing, however it is no guarantee that the node referenced actually exists.- Author:
- mvrueden
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static NodeRef
from(int nodeId)
Creates aNodeRef
with only thenodeId
field set.static NodeRef
from(int nodeId, String foreignSource, String foreignId)
Creates aNodeRef
with all fields populatedstatic NodeRef
from(String nodeRefCriteria)
Creates a newNodeRef
object from a string.static NodeRef
from(String foreignSource, String foreignId)
Explicitly use foreignSource and foreignId to create aNodeRef
object.static List<NodeRef>
from(GenericVertex vertex)
CreatesNodeRef
s from aGenericVertex
.String
getForeignId()
String
getForeignSource()
Integer
getNodeId()
List<NodeRef>
getVariants()
If nodeId, foreignSource and foreignId are set, this returns multiple variants: nodeId and foreignSource/foreignId node refsint
hashCode()
boolean
matches(OnmsNode node)
-
-
-
Method Detail
-
getNodeId
public Integer getNodeId()
-
getForeignSource
public String getForeignSource()
-
getForeignId
public String getForeignId()
-
matches
public boolean matches(OnmsNode node)
-
getVariants
public List<NodeRef> getVariants()
If nodeId, foreignSource and foreignId are set, this returns multiple variants: nodeId and foreignSource/foreignId node refs
-
from
public static NodeRef from(String nodeRefCriteria)
Creates a newNodeRef
object from a string. This can be a nodeId, but also a fs:fid string.- Parameters:
nodeRefCriteria
- the criteria- Returns:
- the reference to a node
-
from
public static NodeRef from(String foreignSource, String foreignId)
Explicitly use foreignSource and foreignId to create aNodeRef
object.
-
from
public static NodeRef from(int nodeId, String foreignSource, String foreignId)
Creates aNodeRef
with all fields populated
-
from
public static List<NodeRef> from(GenericVertex vertex)
CreatesNodeRef
s from aGenericVertex
. If multiple properties are set, they are returned in the following order: - reference defined by node id - reference defined by foreignSource/foreignId - reference defined by node criteria string
-
-