org.snmp4j.agent.mo.jmx.types
Class TypedAttribute

java.lang.Object
  extended by org.snmp4j.agent.mo.jmx.types.TypedAttribute
All Implemented Interfaces:
java.io.Serializable, SMITransformType, TransformType
Direct Known Subclasses:
Boolean2IntegerType, BooleanBitsType, CombinedBitsType, CombinedTypedAttribute, EnumBitsType, EnumStringType, InverseBooleanType, MBeanProxyType, SplitStringType, TypedCompositeDataAttribute

public class TypedAttribute
extends java.lang.Object
implements java.io.Serializable, SMITransformType, TransformType

A TypedAttribute is the combination of a attribute name and a Class instance denoting the name and type of a MBean attribute value. Various transformation methods provide mappings to and from SNMP values.

Version:
1.0
Author:
Frank Fock
See Also:
Serialized Form

Constructor Summary
TypedAttribute(java.lang.String name, java.lang.Class type)
           
TypedAttribute(java.lang.String name, java.lang.String type)
           
 
Method Summary
 java.lang.String getName()
           
 java.lang.Class getType()
           
 boolean isNativeValueAlwaysNeeded()
          Indicates whether a caller of a "toNative" transformation needs to provide the old native value in order to get a successful transformation.
 java.lang.Object transformFromNative(java.lang.Object nativeValue, javax.management.ObjectName objectName)
           
 void transformObject2SMI(java.lang.Object object, org.snmp4j.smi.Variable value)
           
 java.lang.Object transformSMI2Object(org.snmp4j.smi.Variable value)
           
 java.lang.Object transformToNative(java.lang.Object transformedValue, java.lang.Object oldNativeValue, javax.management.ObjectName objectName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypedAttribute

public TypedAttribute(java.lang.String name,
                      java.lang.String type)
               throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

TypedAttribute

public TypedAttribute(java.lang.String name,
                      java.lang.Class type)
Method Detail

getName

public java.lang.String getName()

getType

public java.lang.Class getType()

transformObject2SMI

public void transformObject2SMI(java.lang.Object object,
                                org.snmp4j.smi.Variable value)
Specified by:
transformObject2SMI in interface SMITransformType

transformSMI2Object

public java.lang.Object transformSMI2Object(org.snmp4j.smi.Variable value)
Specified by:
transformSMI2Object in interface SMITransformType

transformFromNative

public java.lang.Object transformFromNative(java.lang.Object nativeValue,
                                            javax.management.ObjectName objectName)
Specified by:
transformFromNative in interface TransformType

transformToNative

public java.lang.Object transformToNative(java.lang.Object transformedValue,
                                          java.lang.Object oldNativeValue,
                                          javax.management.ObjectName objectName)
Specified by:
transformToNative in interface TransformType

isNativeValueAlwaysNeeded

public boolean isNativeValueAlwaysNeeded()
Description copied from interface: TransformType
Indicates whether a caller of a "toNative" transformation needs to provide the old native value in order to get a successful transformation. Otherwise the caller may provide a null to save CPU cycles.

Specified by:
isNativeValueAlwaysNeeded in interface TransformType
Returns:
true if the caller must always provide a none null value for the nativeValue parameter of the transformation methods.

Copyright 2006-2007 Frank Fock (SNMP4J.org)