org.opennms.netmgt.model
Class OnmsResource

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

public class OnmsResource
extends Object
implements Comparable<OnmsResource>

OnmsResource class.


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

Constructor for OnmsResource.

Parameters:
name - a String object.
label - a String object.
resourceType - a OnmsResourceType object.
attributes - a Set object.

OnmsResource

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

Constructor for OnmsResource.

Parameters:
name - a String object.
label - a String object.
resourceType - a OnmsResourceType object.
attributes - a Set object.
resources - a List object.
Method Detail

getName

public String getName()

getName

Returns:
a String object.

getLabel

public String getLabel()

getLabel

Returns:
a String object.

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 interface Comparable<OnmsResource>
Parameters:
o - a OnmsResource 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 - a OnmsResource object.

getParent

public OnmsResource getParent()

getParent

Returns:
a OnmsResource object.

getId

public String getId()

getId

Returns:
a String object.

getLink

public String getLink()

getLink

Returns:
a String object.

setLink

public void setLink(String link)

setLink

Parameters:
link - a String object.

createResourceId

public static String createResourceId(String... resources)

createResourceId

Parameters:
resources - a String object.
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

Overrides:
toString in class Object
Returns:
a String object.

getEntity

public OnmsEntity getEntity()

getEntity

Returns:
a OnmsEntity object.

setEntity

public void setEntity(OnmsEntity entity)

setEntity

Parameters:
entity - a OnmsEntity object.


Copyright © 2011. All Rights Reserved.