Sends a PDU to the given target and returns the received
response PDU encapsulated in a ResponseEvent
object that also includes:
the transport address of the response sending peer,
the Target information of the target,
the request PDU,
the response PDU (if any).
Sends a PDU to the given target and returns the received
response PDU.
Type Parameters:
A - the Address type of target and response (i.e., must be the same)
Parameters:
pdu - the PDU to send.
target - the Target instance that specifies how and where to send
the PDU.
Returns:
the received response encapsulated in a ResponseEvent
instance. To obtain the received response PDU call
ResponseEvent.getResponse(). If the request timed out,
that method will return null. If the sent pdu
is an unconfirmed PDU (notification, response, or report), then
null will be returned.
target - the Target instance representing the target SNMP engine 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.
Returns:
the received response encapsulated in a ResponseEvent
instance. To obtain the received response PDU call
ResponseEvent.getResponse(). If the request timed out,
that method will return null. If the sent pdu
is an unconfirmed PDU (notification, response, or report), then
null will be returned.
target - the Target instance representing the target SNMP engine 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 user defined handle that is returned when the request is returned
via the listener object.
listener - a ResponseListener instance that is called when
pdu is a confirmed PDU and the request is either answered
or timed out.
Cancels an asynchronous request. Any asynchronous request must be canceled
when the supplied response listener is being called, even if the
ResponseEvent indicates an error.
voidsetLocalEngine(byte[] engineID,
int engineBoots,
int engineTime)
Sets the local engine ID for the SNMP entity represented by this
Snmp instance. This is a convenience method that sets
the local engine ID in the associated MPv3 and
USM.
Parameters:
engineID - a byte array containing the local engine ID. The length and content
has to comply with the constraints defined in the SNMP-FRAMEWORK-MIB.
engineBoots - the number of boots of this SNMP engine (zero based).
engineTime - the number of seconds since the value of engineBoots last changed.
Since:
3.0
getLocalEngineID
byte[]getLocalEngineID()
Gets the local engine ID if the MPv3 is available, otherwise a runtime
exception is thrown.