|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.utils.jmx.Utilities
This class acts as the Utility class for the intrumentation level of the JMX Agent.
| Field Summary | |
(package private) static java.lang.Class |
cl
|
static java.lang.ClassLoader |
classLoader
|
(package private) static java.lang.String |
temp
|
| Constructor Summary | |
Utilities()
NoArg constructor, currently does nothing. |
|
| Method Summary | |
static void |
changeTheRootOID(MBeanInfo mbeaninfo,
java.lang.String oldRoot,
java.lang.String newRoot)
This method will be useful for changing the rootOID for SNMP protocol for all the attributes defined in the incoming mbeaninfo object. |
static boolean |
checkExternalIndex(java.lang.Object externalIndexHandler,
CompositeData comp,
java.lang.String[] indexNames,
boolean[] externalIndexFlags)
|
static java.lang.Object |
checkForDateAndTime(java.lang.Object obj)
|
static boolean |
checkPattern(java.lang.String info,
java.lang.String pat,
boolean wc)
|
static int |
compare(java.lang.Object[] str1,
java.lang.Object[] str2)
This method compares two Object[]. |
static int |
compareTo(java.lang.Object[] obj1,
java.lang.Object[] obj2)
Compares the Object array obj1 with Object array obj2 |
static java.lang.Object |
convertStringToObject(java.lang.String type,
java.lang.String value)
Converts the String value to Object of type specified in this methods parameter. |
static java.lang.String |
convertTimeTicks(long value)
Utility method to convert a long value into the Standard Snmp TimeTicks format. |
static java.math.BigInteger |
convertTimeTicksToBigInteger(java.lang.String value)
Utility method to convert TimeTicks in the Standard String format to long value. |
static java.lang.Long |
convertTimeTicksToLongValue(java.lang.String value)
Utility method to convert TimeTicks in the Standard String format to long value. |
static ModelMBeanInfo |
convertXmlToModelMBeanInfo(java.io.InputStream is)
This utility method is used to convert the AdventNet modelmbean XML descriptor inputstream to javax.management.modelmbean.ModelMBeanInfo object. |
static ModelMBeanInfo |
convertXmlToModelMBeanInfo(java.lang.String fileName)
This utility method is used to convert the AdventNet modelmbean XML descriptor file to javax.management.modelmbean.ModelMBeanInfo object. |
static java.lang.String |
createXMLFilePath(java.lang.String xmlFile)
Creates the file path name for the input file content. |
static java.lang.String |
dateString(byte[] datearray)
Converts the byte[] values to String representing the DateandTime. |
static byte[] |
dateStringToByteArray(java.lang.String dateStr)
Converts the String representing the dateandtime value to byte[] . |
static boolean |
followsObjectNamePattern(java.lang.String string,
java.lang.String pattern)
|
static java.lang.Object |
getAttribute(java.lang.Object mbean,
java.lang.String attribute)
Allows the value of a specified attribute of the specified Dynamic MBean object to be obtained. |
static AttributeList |
getAttributes(java.lang.Object mbean,
java.lang.String[] attributes)
Enables the values of specified several attributes of the specified Dynamic MBean object. |
static java.lang.Class |
getClassForPrimitive(java.lang.String type)
|
static java.lang.String |
getColumnarSnmpType(ObjectName objName,
java.lang.String attrbName,
MBeanServer server)
This method is used to get the SnmpType of a Columnar node in a table. |
static java.lang.String |
getCompositeDataString(CompositeData entry)
This method is used to get the key-value pairs in the CompositeData as a String. |
static java.lang.Object |
getEntryFromCompositeData(java.lang.Object tableOrVector,
CompositeData comp,
java.lang.String[] indexNames,
java.lang.String entryName)
|
static java.lang.Object |
getField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName)
Invokes a "get" method for the given attribute called fieldName in the argument on the Object obj. |
static java.lang.Object |
getField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName,
java.lang.ClassLoader loader)
Invokes a "get" method for the given attribute called fieldName in the argument on the Object obj. |
static java.lang.Object[] |
getIndexValues(java.lang.String[] indexNames,
java.lang.Object entry)
The static method which returns the indexValues from the given entry |
static java.lang.Class |
getProperClass(java.lang.String type)
This method returns the appropriate Wrapper Class if the string value of the primitive data type is given. |
static java.lang.String |
getScalarSnmpType(ObjectName objName,
java.lang.String attrbName,
MBeanServer server)
This method is used to get the SnmpType of a Scalar node. |
static TabularData |
getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.util.Hashtable table,
java.lang.Class entryName,
java.lang.String tabularParameterInfoDescr)
The static method which returns TabularData from the table of entries |
static TabularData |
getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.util.Hashtable table,
java.lang.String entryName,
java.lang.String tabularParameterInfoDescr)
The static method which returns TabularData from the table of entries |
static TabularData |
getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.lang.Object tableOrVector,
java.lang.Class entryName,
java.lang.String tabularParameterInfoDescr)
The static method which returns TabularData from the vector of entries |
static TabularData |
getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.lang.Object tableOrVector,
java.lang.String entryName,
java.lang.String tabularParameterInfoDescr)
The static method which returns TabularData from the vector of entries |
static java.lang.String |
getTabularDataString(TabularData table)
This method is used to get the TabularData contents as a String. |
static java.util.Vector |
getVectorFromCompositeData(CompositeData cd,
java.lang.String[] names)
This class is a utility class to get the contents of rowObject (Composite Data ) It can be used also to fetch all the row contents of the table. |
static java.util.Vector |
getVectorFromCompositeData(CompositeData cd,
java.lang.String[] names,
boolean dateAndTimeConvertion)
This class is a utility class to get the contents of rowObject (Composite Data ) It can be used also to fetch all the row contents of the table. |
static java.util.Vector |
getVectorFromTabularData(TabularData tda,
java.lang.String[] names)
|
static java.util.Vector |
getVectorFromTabularData(TabularData tda,
java.lang.String[] names,
boolean dateAndTimeConvert)
|
static java.lang.Object |
invoke(java.lang.Object mbean,
java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
Allows an action to be invoked on the specified Dynamic MBean object. |
static boolean |
isPrimitiveArrayDataType(java.lang.String type)
|
static boolean |
isValidIpAddress(java.lang.String ipString)
This method is used to check whether the given IpAddress is a valid one. |
static byte[] |
longToDateBytes(long time)
The Utility method to convert the Time in milliseconds to DateAndTime Textual Convention byte Array |
static java.lang.String |
longToDateString(long time)
The Utility method to convert the Time in milliseconds to DateAndTime Textual Convention String NOTE: Supports only GMT string... |
static boolean |
objectNameSpecificChecks(java.lang.String string,
java.lang.String pattern)
|
static java.lang.Object[] |
primitiveDataArrayToObjectArray(java.lang.String type,
java.lang.Object value)
|
static void |
printModelMBeanInfo(ModelMBeanInfo info)
Prints the modelmbeaninfo object |
static void |
quickSort(java.lang.Object[] a,
int lo0,
int hi0)
This is a generic version of C.A.R Hoare's Quick Sort algorithm. |
static void |
setAttribute(java.lang.Object mbean,
Attribute attribute)
Sets the value of the specified attribute of the specified Dynamic MBean object. |
static AttributeList |
setAttributes(java.lang.Object mbean,
AttributeList attributes)
Sets the values of specified several attributes of the specified Dynamic MBean object. |
static void |
setClassLoader(java.lang.ClassLoader cls)
|
static void |
setField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName,
java.lang.Object value)
Invokes a "set" method for the given attribute called fieldName in the argument on the Object obj. |
static void |
sortIndex(java.lang.Object[] indicesArray)
This method is used to sort the indices in a table. |
static java.lang.Object[] |
stringArrayToObjectArray(java.lang.String type,
java.lang.String[] values)
Converts the String[] values to Object[] of type specified in this methods parameter. |
static java.lang.Object |
stringArrayToPrimitiveObject(java.lang.String type,
java.lang.String[] values)
|
static boolean |
wildcardMatch(java.lang.String pattern,
java.lang.String string)
|
static boolean |
wildCPattern(java.lang.String p_string,
java.lang.String p_pattern)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static java.lang.ClassLoader classLoader
static java.lang.Class cl
static java.lang.String temp
| Constructor Detail |
public Utilities()
| Method Detail |
public static void setClassLoader(java.lang.ClassLoader cls)
public static java.lang.Object getEntryFromCompositeData(java.lang.Object tableOrVector,
CompositeData comp,
java.lang.String[] indexNames,
java.lang.String entryName)
public static java.lang.Object[] getIndexValues(java.lang.String[] indexNames,
java.lang.Object entry)
throws java.lang.Exception
indexNames - the String array denoting the index names.entry - the entry object
public static java.lang.Object getField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName,
java.lang.ClassLoader loader)
obj - the Object on which the introspection is done.className - the className of the object.fieldName - the attribute's name.loader - the classloader of entry file
public static TabularData getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.util.Hashtable table,
java.lang.String entryName,
java.lang.String tabularParameterInfoDescr)
throws java.lang.Exception
source - the Source table object which makes call to this method.indexNames - the String array denoting the index names.table - the Hashtable which has all the entries as values.entryName - the name of the entry file.tabularParameterInfoDescr - the string which describes the TabularParameterInfo
public static TabularData getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.util.Hashtable table,
java.lang.Class entryName,
java.lang.String tabularParameterInfoDescr)
throws java.lang.Exception
source - the Source table object which makes call to this method.indexNames - the String array denoting the index names.table - the Hashtable which has all the entries as values.entryName - the Class Object of the table entry.tabularParameterInfoDescr - the string which describes the TabularParameterInfo
public static TabularData getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.lang.Object tableOrVector,
java.lang.String entryName,
java.lang.String tabularParameterInfoDescr)
throws java.lang.Exception
source - the Source table object which makes call to this method.indexNames - the String array denoting the index names.tableOrVector - the Hashtable/Vector which has all the entries as values.entryName - the name of the entry file.tabularParameterInfoDescr - the string which describes the TabularParameterInfo
public static TabularData getTabularData(java.lang.Object source,
java.lang.String[] indexNames,
java.lang.Object tableOrVector,
java.lang.Class entryName,
java.lang.String tabularParameterInfoDescr)
throws java.lang.Exception
source - the Source table object which makes call to this method.indexNames - the String array denoting the index names.tableOrVector - the Hashtable/Vector which has all the entries as values.entryName - the Class object of the entry file.tabularParameterInfoDescr - the string which describes the TabularParameterInfo
public static java.lang.Object getField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName)
obj - the Object on which the introspection is done.className - the className of the object.fieldName - the attribute's name.
public static void setField(java.lang.Object obj,
java.lang.String className,
java.lang.String fieldName,
java.lang.Object value)
throws AgentException
obj - the Object on which the introspection is done.className - the className of the object.fieldName - the attribute's name.
public static java.lang.Object getAttribute(java.lang.Object mbean,
java.lang.String attribute)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
mbean - the DynamicMBean objectattribute - The name of the attribute to be retrieved
public static AttributeList getAttributes(java.lang.Object mbean,
java.lang.String[] attributes)
mbean - the DynamicMBean objectattributes - A list of the attributes to be retrieved.
public static java.lang.Object invoke(java.lang.Object mbean,
java.lang.String actionName,
java.lang.Object[] params,
java.lang.String[] signature)
throws MBeanException,
ReflectionException
mbean - the DynamicMBean objectactionName - The name of the action to be invoked.params - An array containing the parameters to be set when the action is
invoked.signature - An array containing the signature of the action. The class
objects will be loaded through the same class loader as the one used for
loading the MBean on which the action is invoked.public static java.lang.Class getClassForPrimitive(java.lang.String type)
public static java.lang.Class getProperClass(java.lang.String type)
type - The String representation of the primitive data type
public static void setAttribute(java.lang.Object mbean,
Attribute attribute)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
mbean - the DynamicMBean objectattribute - The identification of the attribute to be set and the value it
is to be set to.
public static AttributeList setAttributes(java.lang.Object mbean,
AttributeList attributes)
mbean - the DynamicMBean objectattributes - A list of attributes: The identification of the attributes to be
set and the values they are to be set to.
public static boolean checkExternalIndex(java.lang.Object externalIndexHandler,
CompositeData comp,
java.lang.String[] indexNames,
boolean[] externalIndexFlags)
public static int compareTo(java.lang.Object[] obj1,
java.lang.Object[] obj2)
public static java.lang.Object convertStringToObject(java.lang.String type,
java.lang.String value)
throws java.lang.Exception
type - the type of the object to be returned.value - the value from which the returned object is derived.
public static java.lang.Object[] stringArrayToObjectArray(java.lang.String type,
java.lang.String[] values)
throws java.lang.Exception
type - the type of the objects to be returned in the array.values - the values from which the returned object array is derived.
public static java.lang.Object stringArrayToPrimitiveObject(java.lang.String type,
java.lang.String[] values)
throws java.lang.Exception
public static boolean isPrimitiveArrayDataType(java.lang.String type)
public static java.lang.Object[] primitiveDataArrayToObjectArray(java.lang.String type,
java.lang.Object value)
public static java.lang.String dateString(byte[] datearray)
throws java.lang.Exception
datearray - the array of bytes to be returned as a String representing
the DateandTime.
public static byte[] dateStringToByteArray(java.lang.String dateStr)
throws java.lang.Exception
dateStr - the String representing the DateandTime that is to be
converted to the byte[].
public static byte[] longToDateBytes(long time)
throws java.lang.Exception
time - The current Time in milliseconds.
public static java.lang.String longToDateString(long time)
throws java.lang.Exception
time - The current Time in milliseconds.
public static java.lang.String getScalarSnmpType(ObjectName objName,
java.lang.String attrbName,
MBeanServer server)
objName - The ObjectName of the MBean.attrbName - The attribute name. eg) AgentDescrserver - The instance of the MBeanServer
public static java.lang.String getColumnarSnmpType(ObjectName objName,
java.lang.String attrbName,
MBeanServer server)
objName - The ObjectName of the MBean.attrbName - The attribute name.server - The instance of the MBeanServer
public static ModelMBeanInfo convertXmlToModelMBeanInfo(java.lang.String fileName)
throws java.lang.Exception
public static ModelMBeanInfo convertXmlToModelMBeanInfo(java.io.InputStream is)
throws java.lang.Exception
public static void printModelMBeanInfo(ModelMBeanInfo info)
public static void changeTheRootOID(MBeanInfo mbeaninfo,
java.lang.String oldRoot,
java.lang.String newRoot)
mbeaninfo - the MBeanInfo objectoldRoot - the rootOID present in the incoming mbeaninfo attribute's protocolMapnewRoot - the new root OID to be set.
public static java.lang.String createXMLFilePath(java.lang.String xmlFile)
throws java.lang.Exception
public static void sortIndex(java.lang.Object[] indicesArray)
index - The Object array of object arrays to be sorted. Each
element in the Object array is an object array by
itself which represents the indices of a row.quickSort()
public static void quickSort(java.lang.Object[] a,
int lo0,
int hi0)
throws java.lang.Exception
a - an integer arraylo0 - left boundary of array partitionhi0 - right boundary of array partition
public static int compare(java.lang.Object[] str1,
java.lang.Object[] str2)
public static boolean isValidIpAddress(java.lang.String ipString)
ipString - The IpAddress as a String.public static java.lang.String convertTimeTicks(long value)
long - value to be converted into timeticks format.public static java.lang.Long convertTimeTicksToLongValue(java.lang.String value)
String - value to be converted into long.
Eg) 3 days, 12 hours, 4 minutes, 24 seconds, 480 milliseconds.public static java.math.BigInteger convertTimeTicksToBigInteger(java.lang.String value)
String - value to be converted into long.
Eg) 3 days, 12 hours, 4 minutes, 24 seconds, 480 milliseconds.public static java.lang.String getCompositeDataString(CompositeData entry)
entry - The CompositeData Object.getTabularDataString(TabularData)public static java.lang.String getTabularDataString(TabularData table)
table - The TabularData.getCompositeDataString(CompositeData)
public static java.util.Vector getVectorFromCompositeData(CompositeData cd,
java.lang.String[] names)
public static java.util.Vector getVectorFromCompositeData(CompositeData cd,
java.lang.String[] names,
boolean dateAndTimeConvertion)
public static java.util.Vector getVectorFromTabularData(TabularData tda,
java.lang.String[] names)
public static java.util.Vector getVectorFromTabularData(TabularData tda,
java.lang.String[] names,
boolean dateAndTimeConvert)
public static java.lang.Object checkForDateAndTime(java.lang.Object obj)
public static boolean followsObjectNamePattern(java.lang.String string,
java.lang.String pattern)
throws java.lang.Exception
public static boolean objectNameSpecificChecks(java.lang.String string,
java.lang.String pattern)
throws java.lang.Exception
public static boolean checkPattern(java.lang.String info,
java.lang.String pat,
boolean wc)
public static boolean wildCPattern(java.lang.String p_string,
java.lang.String p_pattern)
public static boolean wildcardMatch(java.lang.String pattern,
java.lang.String string)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||