net.sf.snmpadaptor4j.core.accessor
Class MBeanAttributeAccessor

java.lang.Object
  extended by net.sf.snmpadaptor4j.core.accessor.MBeanAttributeAccessor
All Implemented Interfaces:
AttributeAccessor

public final class MBeanAttributeAccessor
extends Object
implements AttributeAccessor

Object representing an accessor to an attribute of MBean.

Author:
Jean-Philippe MINETTI

Constructor Summary
MBeanAttributeAccessor(MBeanServer server, ObjectName mBeanName, MBeanAttributeMapping mapping)
          Constructor.
 
Method Summary
 Class<?> getJmxDataType()
          Returns the data type of JMX attribute.
 ObjectName getMBeanName()
          Returns the MBean name.
 SnmpOid getOid()
          Returns the Object IDentifier (OID) to locate the attribute in the MIB.
 SnmpDataType getSnmpDataType()
          Returns the SNMP data type of attribute.
 Object getValue()
          Returns the value of attribute.
 boolean isReadable()
          Returns TRUE if the attribute can be read (for SNMP write and read community), FALSE otherwise.
 boolean isWritable()
          Returns TRUE if the attribute can be write (for SNMP write community), FALSE otherwise.
 void setValue(Object value)
          Sets the value of attribute.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MBeanAttributeAccessor

public MBeanAttributeAccessor(MBeanServer server,
                              ObjectName mBeanName,
                              MBeanAttributeMapping mapping)
Constructor.

Parameters:
server - JMX agent where the MBean was registered.
mBeanName - MBean name.
mapping - Mapping for access to a MBean attribute.
Method Detail

getMBeanName

public ObjectName getMBeanName()
Returns the MBean name.

Returns:
MBean name.

getOid

public SnmpOid getOid()
Description copied from interface: AttributeAccessor
Returns the Object IDentifier (OID) to locate the attribute in the MIB.

Specified by:
getOid in interface AttributeAccessor
Returns:
Object Identifier to locate the attribute in the MIB.

getSnmpDataType

public SnmpDataType getSnmpDataType()
Description copied from interface: AttributeAccessor
Returns the SNMP data type of attribute.

Specified by:
getSnmpDataType in interface AttributeAccessor
Returns:
SNMP data type of attribute.

getJmxDataType

public Class<?> getJmxDataType()
Description copied from interface: AttributeAccessor
Returns the data type of JMX attribute.

Specified by:
getJmxDataType in interface AttributeAccessor
Returns:
Data type of JMX attribute.

getValue

public Object getValue()
                throws Exception
Description copied from interface: AttributeAccessor
Returns the value of attribute.

Specified by:
getValue in interface AttributeAccessor
Returns:
Value of attribute.
Throws:
Exception - Exception if an error occurred.

setValue

public void setValue(Object value)
              throws Exception
Description copied from interface: AttributeAccessor
Sets the value of attribute.

Specified by:
setValue in interface AttributeAccessor
Parameters:
value - New value of attribute.
Throws:
Exception - Exception if an error occurred.

isReadable

public boolean isReadable()
Description copied from interface: AttributeAccessor
Returns TRUE if the attribute can be read (for SNMP write and read community), FALSE otherwise.

Specified by:
isReadable in interface AttributeAccessor
Returns:
TRUE if the attribute can be read.

isWritable

public boolean isWritable()
Description copied from interface: AttributeAccessor
Returns TRUE if the attribute can be write (for SNMP write community), FALSE otherwise.

Specified by:
isWritable in interface AttributeAccessor
Returns:
TRUE if the attribute can be write.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.