org.opennms.netmgt.model
Class OnmsResource

java.lang.Object
  extended by org.opennms.netmgt.model.OnmsResource
All Implemented Interfaces:
Comparable<OnmsResource>

public class OnmsResource
extends Object
implements Comparable<OnmsResource>


Constructor Summary
OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes)
           
OnmsResource(String name, String label, OnmsResourceType resourceType, Set<OnmsAttribute> attributes, List<OnmsResource> resources)
           
 
Method Summary
 int compareTo(OnmsResource o)
           
static String createResourceId(String... resources)
           
 Set<OnmsAttribute> getAttributes()
           
 List<OnmsResource> getChildResources()
           
 OnmsEntity getEntity()
           
 Map<String,String> getExternalValueAttributes()
          Get the external value attributes for this resource, if any.
 String getId()
           
 String getLabel()
           
 String getLink()
           
 String getName()
           
 OnmsResource getParent()
           
 OnmsResourceType getResourceType()
           
 Map<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)
           
 void setLink(String link)
           
 void setParent(OnmsResource parent)
           
static List<OnmsResource> sortIntoResourceList(List<OnmsResource> resources)
          Sorts the List of Resources and returns a new List of the generic type Resource.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OnmsResource

public OnmsResource(String name,
                    String label,
                    OnmsResourceType resourceType,
                    Set<OnmsAttribute> attributes)

OnmsResource

public OnmsResource(String name,
                    String label,
                    OnmsResourceType resourceType,
                    Set<OnmsAttribute> attributes,
                    List<OnmsResource> resources)
Method Detail

getName

public String getName()

getLabel

public String getLabel()

getResourceType

public OnmsResourceType getResourceType()

getAttributes

public Set<OnmsAttribute> getAttributes()

getChildResources

public List<OnmsResource> getChildResources()

compareTo

public int compareTo(OnmsResource o)
Specified by:
compareTo in interface Comparable<OnmsResource>

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)

getParent

public OnmsResource getParent()

getId

public String getId()

getLink

public String getLink()

setLink

public void setLink(String link)

createResourceId

public static String createResourceId(String... resources)

getRrdGraphAttributes

public Map<String,RrdGraphAttribute> getRrdGraphAttributes()
Get the RRD graph attributes for this resource, if any.


getStringPropertyAttributes

public Map<String,String> getStringPropertyAttributes()
Get the string property attributes for this resource, if any.


getExternalValueAttributes

public Map<String,String> getExternalValueAttributes()
Get the external value attributes for this resource, if any.


toString

public String toString()
Overrides:
toString in class Object

getEntity

public OnmsEntity getEntity()

setEntity

public void setEntity(OnmsEntity entity)


Copyright © 2009. All Rights Reserved.