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 intcompareTo(OnmsResource o)compareToSet<OnmsAttribute>getAttributes()getAttributesList<OnmsResource>getChildResources()getChildResourcesOnmsEntitygetEntity()getEntityMap<String,String>getExternalValueAttributes()Get the external value attributes for this resource, if any.ResourceIdgetId()getIdStringgetLabel()getLabelStringgetLink()getLinkStringgetName()getNameOnmsResourcegetParent()getParentResourcePathgetPath()OnmsResourceTypegetResourceType()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.voidsetEntity(OnmsEntity entity)setEntityvoidsetLabel(String label)setLabelvoidsetLink(String link)setLinkvoidsetParent(OnmsResource parent)setParentstatic List<OnmsResource>sortIntoResourceList(List<OnmsResource> resources)Sorts the List of Resources and returns a new List of the generic type Resource.StringtoString()toString
-
-
-
Constructor Detail
-
OnmsResource
public OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, ResourcePath path)
Constructor for OnmsResource.
- Parameters:
name- aStringobject.label- aStringobject.resourceType- aOnmsResourceTypeobject.attributes- aSetobject.
-
OnmsResource
public OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, List<OnmsResource> resources, ResourcePath path)
Constructor for OnmsResource.
- Parameters:
name- aStringobject.label- aStringobject.resourceType- aOnmsResourceTypeobject.attributes- aSetobject.resources- aListobject.
-
-
Method Detail
-
getResourceType
public OnmsResourceType getResourceType()
getResourceType
- Returns:
- a
OnmsResourceTypeobject.
-
getAttributes
public Set<OnmsAttribute> getAttributes()
getAttributes
- Returns:
- a
Setobject.
-
getChildResources
public List<OnmsResource> getChildResources()
getChildResources
- Returns:
- a
Listobject.
-
compareTo
public int compareTo(OnmsResource o)
compareTo
- Specified by:
compareToin interfaceComparable<OnmsResource>- Parameters:
o- aOnmsResourceobject.- 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- aOnmsResourceobject.
-
getParent
public OnmsResource getParent()
getParent
- Returns:
- a
OnmsResourceobject.
-
getId
public ResourceId getId()
getId
- Returns:
- a
Stringobject.
-
getRrdGraphAttributes
public Map<String,RrdGraphAttribute> getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.- Returns:
- a
Mapobject.
-
getStringPropertyAttributes
public Map<String,String> getStringPropertyAttributes()
Get the string property attributes for this resource, if any.- Returns:
- a
Mapobject.
-
getExternalValueAttributes
public Map<String,String> getExternalValueAttributes()
Get the external value attributes for this resource, if any.- Returns:
- a
Mapobject.
-
toString
public String toString()
toString
-
getEntity
public OnmsEntity getEntity()
getEntity
- Returns:
- a
OnmsEntityobject.
-
setEntity
public void setEntity(OnmsEntity entity)
setEntity
- Parameters:
entity- aOnmsEntityobject.
-
getPath
public ResourcePath getPath()
-
-