|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.snmp4j.agent.agentx.AgentX
public class AgentX
The AgentX class implements the AgentX protocol that sends
and receives AgentX PDUs over one or more transport mappings.
| Constructor Summary | |
|---|---|
AgentX(AgentXMessageDispatcher dispatcher)
|
|
| Method Summary | |
|---|---|
void |
addCommandResponder(AgentXCommandListener listener)
Adds a AgentXCommandListener to this AgentX session. |
void |
addTransportMapping(org.snmp4j.TransportMapping transport)
|
protected void |
fireProcessPdu(AgentXCommandEvent event)
Fires a CommandResponderEvent event to inform listeners about
a received PDU. |
AgentXMessageDispatcher |
getMessageDispatcher()
|
void |
processCommand(AgentXCommandEvent event)
|
void |
removeCommandResponder(AgentXCommandListener listener)
Removes a AgentXCommandListener from this AgentX session. |
void |
removeTransportMapping(org.snmp4j.TransportMapping transport)
|
AgentXResponseEvent |
send(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport)
Sends a AgentXPDU to the given target and returns the response
synchronously. |
void |
send(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport,
java.lang.Object userHandle,
AgentXResponseListener listener)
Sends a AgentXPDU to the given target and returns the response
asynchronously. |
protected org.snmp4j.mp.PduHandle |
sendMessage(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport,
org.snmp4j.mp.PduHandleCallback pduHandleCallback)
Actually sends a PDU to a target and returns a handle for the sent PDU. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AgentX(AgentXMessageDispatcher dispatcher)
| Method Detail |
|---|
public void addTransportMapping(org.snmp4j.TransportMapping transport)
public void removeTransportMapping(org.snmp4j.TransportMapping transport)
public void removeCommandResponder(AgentXCommandListener listener)
AgentXCommandListener from this AgentX session.
listener - a previously added AgentXCommandListener instance.public void addCommandResponder(AgentXCommandListener listener)
AgentXCommandListener to this AgentX session.
The command responder will then be informed about incoming SNMP PDUs of
any kind that are not related to any outstanding requests of this SNMP
session.
listener - the AgentXCommandListener instance to be added.
public AgentXResponseEvent send(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport)
throws java.io.IOException
AgentXPDU to the given target and returns the response
synchronously.
pdu - a AgentXPDU instance.target - the AgentXTarget instance representing the target AgentX entity
where to send the pdu.transport - specifies the TransportMapping to be used when sending
the PDU. If transport is null, the associated
message dispatcher will try to determine the transport mapping by the
target's address.
AgentXResponseEvent
instance. To obtain the received response AgentXPDU call
AgentXResponseEvent.getResponse(). If the request timed out,
that method will return null.
java.io.IOException - if the message could not be sent.
public void send(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport,
java.lang.Object userHandle,
AgentXResponseListener listener)
throws java.io.IOException
AgentXPDU to the given target and returns the response
asynchronously.
pdu - a AgentXPDU instance.target - the AgentXTarget instance representing the target AgentX entity
where to send the pdu.transport - specifies the TransportMapping to be used when sending
the PDU. If transport is null, the associated
message dispatcher will try to determine the transport mapping by the
target's address.userHandle - an arbitrary user handle which is transparently returned to the response
listener.listener - the listener that should be informed about the reponse or timeout.
java.io.IOException - if the message could not be sent.
protected org.snmp4j.mp.PduHandle sendMessage(AgentXPDU pdu,
AgentXTarget target,
org.snmp4j.TransportMapping transport,
org.snmp4j.mp.PduHandleCallback pduHandleCallback)
throws java.io.IOException
pdu - the PDU instance to be sent.target - a AgentXTarget instance denoting the target AgentX entity.transport - the (optional) transport mapping to be used to send the request.
If transport is null a suitable transport
mapping is determined from the target address.pduHandleCallback - an optional callback instance that is informed (if not
null) about the newly assigned PduHandle just before the
message is sent out.
java.io.IOException - if the transport fails to send the PDU or the if the message cannot
be BER encoded.public void processCommand(AgentXCommandEvent event)
processCommand in interface AgentXCommandListenerprotected void fireProcessPdu(AgentXCommandEvent event)
CommandResponderEvent event to inform listeners about
a received PDU. If a listener has marked the event as processed further
listeners will not be informed about the event.
event - a CommandResponderEvent.public AgentXMessageDispatcher getMessageDispatcher()
|
Copyright 2005-2010 Frank Fock (SNMP4J.org) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||