org.glassfish.flashlight.datatree
Interface TreeNode

All Superinterfaces:
TreeElement

public interface TreeNode
extends TreeElement

TreeNode maintains all the Runtime Monitoring Data

Author:
Harpreet Singh

Method Summary
 TreeNode addChild(TreeNode newChild)
           
 String getCategory()
           
 TreeNode getChild(String childName)
           
 Collection<TreeNode> getChildNodes()
           
 String getCompletePathName()
           
 String getDescription()
           
 Collection<TreeNode> getEnabledChildNodes()
           
 TreeNode getNode(String completeName)
           
 List<TreeNode> getNodes(String pattern)
          Behaves as {@link #getNodes (String, boolean, boolean) with ignoreDisabled set to true and gfV2Compatible set to true Pattern is considered to be a GFV2 Compatible Pattern
 List<TreeNode> getNodes(String pattern, boolean ignoreDisabled, boolean gfv2Compatible)
          Returns all nodes that match the given Regex pattern as specified by the Pattern class.
 TreeNode getParent()
           
 TreeNode getPossibleParentNode(String pattern)
          Get the "parent" matching the given pattern.
 boolean hasChildNodes()
           
 boolean isEnabled()
           
 void removeChild(TreeNode oldChild)
           
 void setCategory(String category)
           
 void setDescription(String description)
           
 void setEnabled(boolean enabled)
           
 void setParent(TreeNode parent)
           
 List<TreeNode> traverse(boolean ignoreDisabled)
          Performs a depth first traversal of the tree.
 
Methods inherited from interface org.glassfish.flashlight.datatree.TreeElement
getName, getValue, setName
 

Method Detail

getCategory

String getCategory()

setCategory

void setCategory(String category)

isEnabled

boolean isEnabled()

setEnabled

void setEnabled(boolean enabled)

setDescription

void setDescription(String description)

getDescription

String getDescription()

addChild

TreeNode addChild(TreeNode newChild)

removeChild

void removeChild(TreeNode oldChild)

setParent

void setParent(TreeNode parent)

getParent

TreeNode getParent()

getCompletePathName

String getCompletePathName()
Returns:
complete dotted name to this node

hasChildNodes

boolean hasChildNodes()

getChildNodes

Collection<TreeNode> getChildNodes()
Returns:
Collection collection of children

getEnabledChildNodes

Collection<TreeNode> getEnabledChildNodes()
Returns:
Collection collection of children

getNode

TreeNode getNode(String completeName)
Parameters:
completeName - dotted name to the node
Returns:
TreeNode uniquely identified tree node. Null if no matching tree node.

traverse

List<TreeNode> traverse(boolean ignoreDisabled)
Performs a depth first traversal of the tree. Returns all the nodes in the tree unless ignoreDisabled flag is turned on.

Parameters:
ignoreDisabled - will ignore a disabled node and its children
Returns:
List lists all nodes under the current sub tree.

getNodes

List<TreeNode> getNodes(String pattern,
                        boolean ignoreDisabled,
                        boolean gfv2Compatible)
Returns all nodes that match the given Regex pattern as specified by the Pattern class. Admin CLI in GlassFish v2 did not use Pattern's specified in java.util.Pattern. It had a simpler mechanism where * was equivalent to .* from Pattern If the V2Compatible flag is turned on, then the pattern is considered a v2 pattern.

Parameters:
pattern - Find a node that matches the pattern. By default pattern should follow the conventions outlined by the java.util.regex.Pattern class.
ignoreDisabled - will ignore a disabled node and its children
gfv2Compatible - in this mode, * has the same meaning as .* in the Pattern class. The implementation should consider pattern as a v2 pattern.
Returns:

getNodes

List<TreeNode> getNodes(String pattern)
Behaves as {@link #getNodes (String, boolean, boolean) with ignoreDisabled set to true and gfV2Compatible set to true Pattern is considered to be a GFV2 Compatible Pattern


getChild

TreeNode getChild(String childName)

getPossibleParentNode

TreeNode getPossibleParentNode(String pattern)
Get the "parent" matching the given pattern. E.g "server.jvm.memory.maxheapsize-count" is the parent of "server.jvm.memory.maxheapsize-count-count" Note that in V3 the latter will NOT be found with getNodes()

Parameters:
pattern - Find a node that matches the pattern. By default pattern should follow the conventions outlined by the java.util.regex.Pattern class.
Returns:
The parent node if found otherwise null.


Copyright © 2012 GlassFish Community. All Rights Reserved.