|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.jmx.adaptor.snmp.agent.RequestHandlerSupport
Implement RequestHandler with simple tracing of incoming requests. Derived classes are expected to implement actual behaviour.
Field Summary | |
protected Clock (src) |
clock
the agent clock |
protected Logger (src) |
log
Logger object |
protected java.lang.String |
resourceName
the file name to get mapping info from |
protected MBeanServer (src) |
server
the MBeanServer |
Constructor Summary | |
RequestHandlerSupport()
Default CTOR |
Method Summary | |
void |
initialize(java.lang.String resourceName,
MBeanServer (src) server,
Logger (src) log,
Clock (src) uptime)
Initialize |
void |
SnmpAgentSessionError(SnmpAgentSession session,
int error,
java.lang.Object ref)
This method is invoked if an error occurs in the session. |
SnmpPduRequest |
snmpReceivedGet(SnmpPduPacket pdu,
boolean getNext)
This method is defined to handle SNMP Get requests that are received by the session. |
void |
snmpReceivedPdu(SnmpAgentSession session,
java.net.InetAddress manager,
int port,
SnmpOctetString community,
SnmpPduPacket pdu)
This method is defined to handle SNMP requests that are received by the session. |
SnmpPduRequest |
snmpReceivedSet(SnmpPduPacket pdu)
This method is defined to handle SNMP Set requests that are received by the session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger (src) log
protected MBeanServer (src) server
protected java.lang.String resourceName
protected Clock (src) clock
Constructor Detail |
public RequestHandlerSupport()
Method Detail |
public void initialize(java.lang.String resourceName, MBeanServer (src) server, Logger (src) log, Clock (src) uptime) throws java.lang.Exception
initialize
in interface RequestHandler (src)
resourceName
- file containing mappinginfoserver
- the mbean server to forward mapped get/set requestsuptime
- the snmp agent uptime
java.lang.Exception
- in case of initialization problempublic SnmpPduRequest snmpReceivedGet(SnmpPduPacket pdu, boolean getNext)
This method is defined to handle SNMP Get requests that are received by the session. The request has already been validated by the system. This routine will build a response and pass it back to the caller.
pdu
- The SNMP pdugetNext
- The agent is requesting the lexically NEXT item after each
item in the pdu.
public SnmpPduRequest snmpReceivedSet(SnmpPduPacket pdu)
This method is defined to handle SNMP Set requests that are received by the session. The request has already been validated by the system. This routine will build a response and pass it back to the caller.
pdu
- The SNMP pdu
public void snmpReceivedPdu(SnmpAgentSession session, java.net.InetAddress manager, int port, SnmpOctetString community, SnmpPduPacket pdu)
This method is defined to handle SNMP requests that are received by the session. The parameters allow the handler to determine the host, port, and community string of the received PDU
session
- The SNMP sessionmanager
- The remote senderport
- The remote senders portcommunity
- The community stringpdu
- The SNMP pdupublic void SnmpAgentSessionError(SnmpAgentSession session, int error, java.lang.Object ref)
This method is invoked if an error occurs in the session. The error code that represents the failure will be passed in the second parameter, 'error'. The error codes can be found in the class SnmpAgentSession class.
If a particular PDU is part of the error condition it will be passed in the third parameter, 'pdu'. The pdu will be of the type SnmpPduRequest or SnmpPduTrap object. The handler should use the "instanceof" operator to determine which type the object is. Also, the object may be null if the error condition is not associated with a particular PDU.
session
- The SNMP Sessionerror
- The error condition value.ref
- The PDU reference, or potentially null.
It may also be an exception.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |