org.glassfish.admin.amx.intf.config
Class AMXConfigHelper

java.lang.Object
  extended by org.glassfish.admin.amx.intf.config.AMXConfigHelper

@Taxonomy(stability=UNCOMMITTED)
public class AMXConfigHelper
extends java.lang.Object

Various shortcut methods for working with AMX config MBeans, particularly attributes and metadata.

Author:
llc

Constructor Summary
AMXConfigHelper(AMXConfigProxy amx)
           
 
Method Summary
 javax.management.Descriptor attributeDescriptor(java.lang.String attrName)
          Get the JMX Descriptor for an Attribute.
 java.lang.Object attributeDescriptorField(java.lang.String attrName, java.lang.String fieldName)
          Get the field value for an Attribute and specified field name, if any.
 java.util.Set<java.lang.String> attributeNamesByDescriptorField(java.lang.String fieldName, java.lang.String value)
          match all attributes that have a Descriptor field with the specified value.
 java.lang.String dataType(java.lang.String attrName)
          Return the dataType (if any) for the specified attribute eg java.lang.Boolean,
 java.lang.String defaultValue(java.lang.String attrName)
          Return the default value of the attribute, or null if no default value.
 boolean key(java.lang.String attrName)
          return true if the Attribute is a key value
 java.lang.Long max(java.lang.String attrName)
          Return the maximum value (if any) for the specified numeric attribute.
 java.lang.Long min(java.lang.String attrName)
          Return the minimum value (if any) for the specified numeric attribute.
 boolean notNull(java.lang.String attrName)
          return true if the Attribute may not be null (is required)
 java.lang.String regexPattern(java.lang.String attrName)
          Return the regex pattern (if any) for the specified attribute.
 java.lang.Boolean required(java.lang.String attrName)
          Return whether the attribute is required.
 java.util.Set<java.lang.String> simpleAttributes()
          Get simple attribute names; those that are not Element kind.
 java.util.Map<java.lang.String,java.lang.Object> simpleAttributesMap()
          Get simple attributes; those that are not Element kind.
 java.lang.String units(java.lang.String attrName)
          Return the units (if any) for the specified attribute.
 java.lang.String xmlName(java.lang.String attrName)
          Return the xml name of the attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMXConfigHelper

public AMXConfigHelper(AMXConfigProxy amx)
Method Detail

attributeNamesByDescriptorField

public java.util.Set<java.lang.String> attributeNamesByDescriptorField(java.lang.String fieldName,
                                                                       java.lang.String value)
match all attributes that have a Descriptor field with the specified value. (could be extended to use regexp for value and/or field name).

Parameters:
amx - the proxy
fieldName - name of the field in the Descriptor for each Attribute
value - value of the field in the Descriptor for each Attribute

simpleAttributes

public java.util.Set<java.lang.String> simpleAttributes()
Get simple attribute names; those that are not Element kind.


simpleAttributesMap

public java.util.Map<java.lang.String,java.lang.Object> simpleAttributesMap()
Get simple attributes; those that are not Element kind.


attributeDescriptor

public final javax.management.Descriptor attributeDescriptor(java.lang.String attrName)
Get the JMX Descriptor for an Attribute.

See Also:
AMXConfigConstants

attributeDescriptorField

public final java.lang.Object attributeDescriptorField(java.lang.String attrName,
                                                       java.lang.String fieldName)
Get the field value for an Attribute and specified field name, if any.

Parameters:
attrName -
fieldName -
See Also:
AMXConfigConstants

units

public java.lang.String units(java.lang.String attrName)
Return the units (if any) for the specified attribute.

Parameters:
attrName -

min

public java.lang.Long min(java.lang.String attrName)
Return the minimum value (if any) for the specified numeric attribute.

Parameters:
attrName -

max

public java.lang.Long max(java.lang.String attrName)
Return the maximum value (if any) for the specified numeric attribute.

Parameters:
attrName -

dataType

public java.lang.String dataType(java.lang.String attrName)
Return the dataType (if any) for the specified attribute eg java.lang.Boolean,

Parameters:
attrName - java.lang.Integer, java.lang.Long, java.lang.String

regexPattern

public java.lang.String regexPattern(java.lang.String attrName)
Return the regex pattern (if any) for the specified attribute.

Parameters:
attrName -

key

public boolean key(java.lang.String attrName)
return true if the Attribute is a key value

Parameters:
attrName -

notNull

public boolean notNull(java.lang.String attrName)
return true if the Attribute may not be null (is required)

Parameters:
attrName -

required

public java.lang.Boolean required(java.lang.String attrName)
Return whether the attribute is required. This can be implied by several different annotations or field; this method checks them all.

Parameters:
attrName -

xmlName

public java.lang.String xmlName(java.lang.String attrName)
Return the xml name of the attribute.

Parameters:
attrName -

defaultValue

public java.lang.String defaultValue(java.lang.String attrName)
Return the default value of the attribute, or null if no default value.

Parameters:
attrName -


Copyright © 2012 GlassFish Community. All Rights Reserved.