Package org.opennms.netmgt.model
Class OnmsResource
- java.lang.Object
-
- org.opennms.netmgt.model.OnmsResource
-
- All Implemented Interfaces:
Comparable<OnmsResource>
- Direct Known Subclasses:
StatisticsReportModel.PrettyOnmsResource
public class OnmsResource extends Object implements Comparable<OnmsResource>
OnmsResource class.
-
-
Constructor Summary
Constructors Constructor Description OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, List<OnmsResource> resources, ResourcePath path)
Constructor for OnmsResource.OnmsResource(String name, String label, OnmsResourceType resourceType, 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)
compareToSet<OnmsAttribute>
getAttributes()
getAttributesList<OnmsResource>
getChildResources()
getChildResourcesOnmsEntity
getEntity()
getEntityMap<String,String>
getExternalValueAttributes()
Get the external value attributes for this resource, if any.ResourceId
getId()
getIdString
getLabel()
getLabelString
getLink()
getLinkString
getName()
getNameOnmsResource
getParent()
getParentResourcePath
getPath()
OnmsResourceType
getResourceType()
getResourceTypeMap<String,RrdGraphAttribute>
getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.Map<String,String>
getStringPropertyAttributes()
Get the string property attributes for this resource, if any.void
setEntity(OnmsEntity entity)
setEntityvoid
setLabel(String label)
setLabelvoid
setLink(String link)
setLinkvoid
setParent(OnmsResource parent)
setParentstatic List<OnmsResource>
sortIntoResourceList(List<OnmsResource> resources)
Sorts the List of Resources and returns a new List of the generic type Resource.String
toString()
toString
-
-
-
Constructor Detail
-
OnmsResource
public OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, ResourcePath path)
Constructor for OnmsResource.
- Parameters:
name
- aString
object.label
- aString
object.resourceType
- aOnmsResourceType
object.attributes
- aSet
object.
-
OnmsResource
public OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, 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
-
getResourceType
public OnmsResourceType getResourceType()
getResourceType
- Returns:
- a
OnmsResourceType
object.
-
getAttributes
public Set<OnmsAttribute> getAttributes()
getAttributes
- Returns:
- a
Set
object.
-
getChildResources
public List<OnmsResource> getChildResources()
getChildResources
- Returns:
- a
List
object.
-
compareTo
public int compareTo(OnmsResource o)
compareTo
- Specified by:
compareTo
in interfaceComparable<OnmsResource>
- Parameters:
o
- aOnmsResource
object.- Returns:
- a int.
-
sortIntoResourceList
public static List<OnmsResource> sortIntoResourceList(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.
-
getRrdGraphAttributes
public Map<String,RrdGraphAttribute> getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.- Returns:
- a
Map
object.
-
getStringPropertyAttributes
public Map<String,String> getStringPropertyAttributes()
Get the string property attributes for this resource, if any.- Returns:
- a
Map
object.
-
getExternalValueAttributes
public Map<String,String> getExternalValueAttributes()
Get the external value attributes for this resource, if any.- Returns:
- a
Map
object.
-
toString
public String toString()
toString
-
getEntity
public OnmsEntity getEntity()
getEntity
- Returns:
- a
OnmsEntity
object.
-
setEntity
public void setEntity(OnmsEntity entity)
setEntity
- Parameters:
entity
- aOnmsEntity
object.
-
getPath
public ResourcePath getPath()
-
-