Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.bizapp.shared.uibeans
Class ResourceTreeNode

java.lang.Object
  extended by org.hyperic.hq.bizapp.shared.uibeans.TreeNode
      extended by org.hyperic.hq.bizapp.shared.uibeans.ResourceTreeNode
All Implemented Interfaces:
java.io.Serializable, IResourceTreeNode, ITreeNode

public class ResourceTreeNode
extends TreeNode
implements IResourceTreeNode

Implementation of the resource tree node interface for rendering the navigation map.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hyperic.hq.bizapp.shared.uibeans.TreeNode
downChildren, NO_CTYPE, upChildren
 
Fields inherited from interface org.hyperic.util.data.IResourceTreeNode
AUTO_GROUP, CLUSTER, NONE, RESOURCE
 
Constructor Summary
ResourceTreeNode(java.lang.String name, java.lang.String desc, AppdefEntityID[] pEntityIds, int ctype, int type)
          Creates a new ResourceTreeNode instance for an auto-group with multiple parent resources.
ResourceTreeNode(java.lang.String name, java.lang.String desc, AppdefEntityID rEntityId, AppdefEntityID[] pEntityIds, int ctype)
          Creates a promotable ResourceTreeNode instance for a resource.
ResourceTreeNode(java.lang.String name, java.lang.String desc, AppdefEntityID rEntityId, AppdefEntityID pEntityId, int ctype)
          Creates a promotable ResourceTreeNode instance for a resource.
ResourceTreeNode(java.lang.String name, java.lang.String desc, AppdefEntityID rEntityId, int type)
          Creates a new ResourceTreeNode instance for a resource.
ResourceTreeNode(java.lang.String name, java.lang.String desc, AppdefEntityID pEntityId, int ctype, int type)
          Creates a new ResourceTreeNode instance for an auto-group with one parent resource.
 
Method Summary
static void alphaSortNodes(ResourceTreeNode[] children)
           
static void alphaSortNodes(ResourceTreeNode[] children, boolean reverse)
           
static void autoGroupData(ResourceTreeNode[] data)
           
 boolean equals(java.lang.Object o)
          Determines whether two objects are equal.
 int getCtype()
          Get the ctype.
 ITreeNode[] getDownChildren()
          Overridden from TreeNode to ensure that the array is of type IResourceTreeNode[].
 AppdefEntityID[] getEntityIds()
          If our type is a resource, then we return the resource ids.
 AppdefEntityID[] getPEntityIds()
          Get the parents' Appdef entity ids.
 AppdefEntityID getREntityId()
          Get the resource's Appdef entity id.
 int getType()
          Return the type of this node.
 ITreeNode[] getUpChildren()
          Overridden from TreeNode to ensure that the array is of type IResourceTreeNode[].
 boolean hasCtype()
          Returns true if this node is an autogroup and has a ctype, false otherwise.
 int hashCode()
          Returns the hashcode of this object.
 boolean isPromotable()
          Is this node promotable to an auto-group
 void promote()
          Promote a resource node to an auto-group node.
 void setCtype(int ctype)
          Set the ctype.
 void setPEntityIds(AppdefEntityID[] pEntityIds)
          Set the parents' Appdef entity ids.
 void setREntityId(AppdefEntityID rEntityId)
          Set the resource's Appdef entity id.
 void setType(int type)
          Set the type of this node.
 java.lang.String toString()
          Return a string representation of this node.
 
Methods inherited from class org.hyperic.hq.bizapp.shared.uibeans.TreeNode
addDownChild, addDownChildren, addRectangle, addUpChild, addUpChildren, clear, getDescription, getDownChildrenCount, getName, getRectangles, getUpChildrenCount, hasDownChildren, hasUpChildren, isSelected, replaceDownChildren, replaceUpChildren, reset, setDescription, setName, setSelected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hyperic.util.data.ITreeNode
addRectangle, getDescription, getName, getRectangles, hasDownChildren, hasUpChildren, isSelected, reset
 

Constructor Detail

ResourceTreeNode

public ResourceTreeNode(java.lang.String name,
                        java.lang.String desc,
                        AppdefEntityID rEntityId,
                        AppdefEntityID pEntityId,
                        int ctype)
Creates a promotable ResourceTreeNode instance for a resource. The resource may be promoted to an auto-group with one parent resource at a later time.

Parameters:
name - the name
desc - the description
rEntityId - the resource's entity id
pEntityId - the Appdef parent entity id
ctype - the ctype
type - the type of this node

ResourceTreeNode

public ResourceTreeNode(java.lang.String name,
                        java.lang.String desc,
                        AppdefEntityID rEntityId,
                        AppdefEntityID[] pEntityIds,
                        int ctype)
Creates a promotable ResourceTreeNode instance for a resource. The resource may be promoted to an auto-group at a later time.

Parameters:
name - the name
desc - the description
rEntityId - the resource's entity id
pEntityIds - the Appdef parent entity ids
ctype - the ctype

ResourceTreeNode

public ResourceTreeNode(java.lang.String name,
                        java.lang.String desc,
                        AppdefEntityID pEntityId,
                        int ctype,
                        int type)
Creates a new ResourceTreeNode instance for an auto-group with one parent resource.

Parameters:
name - the name
desc - the description
pEntityId - the Appdef parent entity id
ctype - the ctype
type - the type of this node

ResourceTreeNode

public ResourceTreeNode(java.lang.String name,
                        java.lang.String desc,
                        AppdefEntityID[] pEntityIds,
                        int ctype,
                        int type)
Creates a new ResourceTreeNode instance for an auto-group with multiple parent resources.

Parameters:
name - the name
desc - the description
pEntityIds - the Appdef parent entity ids
ctype - the ctype
type - the type of this node

ResourceTreeNode

public ResourceTreeNode(java.lang.String name,
                        java.lang.String desc,
                        AppdefEntityID rEntityId,
                        int type)
Creates a new ResourceTreeNode instance for a resource.

Parameters:
name - the name
desc - the description
pEntityIds - the Appdef parent entity ids
ctype - the ctype
type - the type of this node
Method Detail

autoGroupData

public static void autoGroupData(ResourceTreeNode[] data)

alphaSortNodes

public static void alphaSortNodes(ResourceTreeNode[] children)

alphaSortNodes

public static void alphaSortNodes(ResourceTreeNode[] children,
                                  boolean reverse)

getEntityIds

public AppdefEntityID[] getEntityIds()
If our type is a resource, then we return the resource ids. If our type is an AUTO_GROUP then we return the parent ids.


getType

public int getType()
Return the type of this node.

Specified by:
getType in interface IResourceTreeNode
Returns:
the node type

setType

public void setType(int type)
Set the type of this node.

Parameters:
type - the node type

isPromotable

public boolean isPromotable()
Is this node promotable to an auto-group

Returns:
true if promotable, false if not

getUpChildren

public ITreeNode[] getUpChildren()
Overridden from TreeNode to ensure that the array is of type IResourceTreeNode[].

Specified by:
getUpChildren in interface ITreeNode
Overrides:
getUpChildren in class TreeNode
Returns:
the children above this node

getDownChildren

public ITreeNode[] getDownChildren()
Overridden from TreeNode to ensure that the array is of type IResourceTreeNode[].

Specified by:
getDownChildren in interface ITreeNode
Overrides:
getDownChildren in class TreeNode
Returns:
the children above this node

getREntityId

public AppdefEntityID getREntityId()
Get the resource's Appdef entity id.

Returns:
rEntityId Appdef entity id

getPEntityIds

public AppdefEntityID[] getPEntityIds()
Get the parents' Appdef entity ids.

Returns:
pEntityIds the Appdef entity ids

setREntityId

public void setREntityId(AppdefEntityID rEntityId)
Set the resource's Appdef entity id.

Parameters:
pEntityIds - the Appdef entity id

setPEntityIds

public void setPEntityIds(AppdefEntityID[] pEntityIds)
Set the parents' Appdef entity ids.

Parameters:
pEntityIds - the Appdef entity ids

getCtype

public int getCtype()
Get the ctype.

Returns:
the ctype

setCtype

public void setCtype(int ctype)
Set the ctype.

Parameters:
ctype - the ctype

equals

public boolean equals(java.lang.Object o)
Determines whether two objects are equal.

Overrides:
equals in class TreeNode
Returns:
true or false

hashCode

public int hashCode()
Returns the hashcode of this object.

Overrides:
hashCode in class TreeNode
Returns:
hash code.

hasCtype

public boolean hasCtype()
Returns true if this node is an autogroup and has a ctype, false otherwise.

Returns:
true or false

promote

public void promote()
Promote a resource node to an auto-group node.


toString

public java.lang.String toString()
Return a string representation of this node.

Overrides:
toString in class TreeNode
Returns:
string representation of this node

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.