Package org.opennms.netmgt.model
Class OnmsResource
- java.lang.Object
-
- org.opennms.netmgt.model.OnmsResource
-
- All Implemented Interfaces:
java.lang.Comparable<OnmsResource>
- Direct Known Subclasses:
StatisticsReportModel.PrettyOnmsResource
public class OnmsResource extends java.lang.Object implements java.lang.Comparable<OnmsResource>
OnmsResource class.
-
-
Constructor Summary
Constructors Constructor Description OnmsResource(java.lang.String name, java.lang.String label, OnmsResourceType resourceType, java.util.Set<OnmsAttribute> attributes, java.util.List<OnmsResource> resources, ResourcePath path)
Constructor for OnmsResource.OnmsResource(java.lang.String name, java.lang.String label, OnmsResourceType resourceType, java.util.Set<OnmsAttribute> attributes, ResourcePath path)
Constructor for OnmsResource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(OnmsResource o)
compareTojava.util.Set<OnmsAttribute>
getAttributes()
getAttributesjava.util.List<OnmsResource>
getChildResources()
getChildResourcesOnmsEntity
getEntity()
getEntityjava.util.Map<java.lang.String,java.lang.String>
getExternalValueAttributes()
Get the external value attributes for this resource, if any.ResourceId
getId()
getIdjava.lang.String
getLabel()
getLabeljava.lang.String
getLink()
getLinkjava.lang.String
getName()
getNameOnmsResource
getParent()
getParentResourcePath
getPath()
OnmsResourceType
getResourceType()
getResourceTypejava.util.Map<java.lang.String,RrdGraphAttribute>
getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.java.util.Map<java.lang.String,java.lang.String>
getStringPropertyAttributes()
Get the string property attributes for this resource, if any.void
setEntity(OnmsEntity entity)
setEntityvoid
setLabel(java.lang.String label)
setLabelvoid
setLink(java.lang.String link)
setLinkvoid
setParent(OnmsResource parent)
setParentstatic java.util.List<OnmsResource>
sortIntoResourceList(java.util.List<OnmsResource> resources)
Sorts the List of Resources and returns a new List of the generic type Resource.java.lang.String
toString()
toString
-
-
-
Constructor Detail
-
OnmsResource
public OnmsResource(java.lang.String name, java.lang.String label, OnmsResourceType resourceType, java.util.Set<OnmsAttribute> attributes, ResourcePath path)
Constructor for OnmsResource.
- Parameters:
name
- aString
object.label
- aString
object.resourceType
- aOnmsResourceType
object.attributes
- aSet
object.
-
OnmsResource
public OnmsResource(java.lang.String name, java.lang.String label, OnmsResourceType resourceType, java.util.Set<OnmsAttribute> attributes, java.util.List<OnmsResource> resources, ResourcePath path)
Constructor for OnmsResource.
- Parameters:
name
- aString
object.label
- aString
object.resourceType
- aOnmsResourceType
object.attributes
- aSet
object.resources
- aList
object.
-
-
Method Detail
-
getName
public java.lang.String getName()
getName
- Returns:
- a
String
object.
-
getLabel
public java.lang.String getLabel()
getLabel
- Returns:
- a
String
object.
-
setLabel
public void setLabel(java.lang.String label)
setLabel
- Parameters:
label
- aString
object.
-
getResourceType
public OnmsResourceType getResourceType()
getResourceType
- Returns:
- a
OnmsResourceType
object.
-
getAttributes
public java.util.Set<OnmsAttribute> getAttributes()
getAttributes
- Returns:
- a
Set
object.
-
getChildResources
public java.util.List<OnmsResource> getChildResources()
getChildResources
- Returns:
- a
List
object.
-
compareTo
public int compareTo(OnmsResource o)
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<OnmsResource>
- Parameters:
o
- aOnmsResource
object.- Returns:
- a int.
-
sortIntoResourceList
public static java.util.List<OnmsResource> sortIntoResourceList(java.util.List<OnmsResource> resources)
Sorts the List of Resources and returns a new List of the generic type Resource.- Parameters:
resources
- list of Resource objects. This will be sorted using Collections.sort, and note that this will modify the provided list.- Returns:
- a sorted list
-
setParent
public void setParent(OnmsResource parent)
setParent
- Parameters:
parent
- aOnmsResource
object.
-
getParent
public OnmsResource getParent()
getParent
- Returns:
- a
OnmsResource
object.
-
getId
public ResourceId getId()
getId
- Returns:
- a
String
object.
-
getLink
public java.lang.String getLink()
getLink
- Returns:
- a
String
object.
-
setLink
public void setLink(java.lang.String link)
setLink
- Parameters:
link
- aString
object.
-
getRrdGraphAttributes
public java.util.Map<java.lang.String,RrdGraphAttribute> getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.- Returns:
- a
Map
object.
-
getStringPropertyAttributes
public java.util.Map<java.lang.String,java.lang.String> getStringPropertyAttributes()
Get the string property attributes for this resource, if any.- Returns:
- a
Map
object.
-
getExternalValueAttributes
public java.util.Map<java.lang.String,java.lang.String> getExternalValueAttributes()
Get the external value attributes for this resource, if any.- Returns:
- a
Map
object.
-
toString
public java.lang.String toString()
toString
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a
String
object.
-
getEntity
public OnmsEntity getEntity()
getEntity
- Returns:
- a
OnmsEntity
object.
-
setEntity
public void setEntity(OnmsEntity entity)
setEntity
- Parameters:
entity
- aOnmsEntity
object.
-
getPath
public ResourcePath getPath()
-
-