public class CommandResponderEvent
extends java.util.EventObject
CommandResponderEvent
is fired by the
MessageDispatcher
to listeners that potentially can process
the included request, report, or trap/notification.Modifier and Type | Field and Description |
---|---|
private int |
maxSizeResponsePDU |
private int |
messageProcessingModel |
private PDU |
pdu |
private PduHandle |
pduHandle |
private Address |
peerAddress |
private boolean |
processed |
private int |
securityLevel |
private int |
securityModel |
private byte[] |
securityName |
private static long |
serialVersionUID |
private StateReference |
stateReference |
private TransportStateReference |
tmStateReference |
private TransportMapping |
transportMapping |
Constructor and Description |
---|
CommandResponderEvent(MessageDispatcher messageDispatcher,
TransportMapping transportMapping,
Address sourceAddress,
int messageProcessingModel,
int securityModel,
byte[] securityName,
int securityLevel,
PduHandle pduHandle,
PDU pdu,
int maxSizeResponseScopedPDU,
StateReference stateReference)
Constructs an event for processing an incoming request or notification PDU.
|
CommandResponderEvent(java.lang.Object source,
CommandResponderEvent other)
Creates shallow copy of the supplied
CommandResponderEvent
but the source of the event is set to the supplied source. |
Modifier and Type | Method and Description |
---|---|
int |
getMaxSizeResponsePDU() |
MessageDispatcher |
getMessageDispatcher()
Gets the message dispatcher instance that received the command
(request PDU) or unconfirmed PDU like a report, trap, or notification..
|
int |
getMessageProcessingModel() |
PDU |
getPDU() |
PduHandle |
getPduHandle() |
Address |
getPeerAddress()
Gets the transport address of the sending entity.
|
int |
getSecurityLevel() |
int |
getSecurityModel()
Gets the security model used by the command.
|
byte[] |
getSecurityName() |
StateReference |
getStateReference() |
TransportStateReference |
getTmStateReference()
Gets the transport model state reference as defined by RFC 5590.
|
TransportMapping |
getTransportMapping()
Returns the transport mapping that received the PDU that triggered this
event.
|
boolean |
isProcessed()
Checks whether this event is already processed or not.
|
void |
setMaxSizeResponsePDU(int maxSizeResponsePDU) |
void |
setMessageProcessingModel(int messageProcessingModel) |
void |
setPDU(PDU pdu) |
void |
setPduHandle(PduHandle pduHandle) |
void |
setPeerAddress(Address peerAddress)
Sets the transport address of the sending entity.
|
void |
setProcessed(boolean processed)
Sets the status of this PDU.
|
void |
setSecurityLevel(int securityLevel) |
void |
setSecurityModel(int securityModel) |
void |
setSecurityName(byte[] securityName) |
void |
setStateReference(StateReference stateReference) |
void |
setTmStateReference(TransportStateReference tmStateReference)
Sets the transport model state reference as defined by RFC 5590.
|
protected void |
setTransportMapping(TransportMapping transportMapping) |
java.lang.String |
toString() |
private static final long serialVersionUID
private int securityModel
private int securityLevel
private int maxSizeResponsePDU
private PduHandle pduHandle
private StateReference stateReference
private PDU pdu
private int messageProcessingModel
private byte[] securityName
private boolean processed
private Address peerAddress
private transient TransportMapping transportMapping
private TransportStateReference tmStateReference
public CommandResponderEvent(MessageDispatcher messageDispatcher, TransportMapping transportMapping, Address sourceAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PduHandle pduHandle, PDU pdu, int maxSizeResponseScopedPDU, StateReference stateReference)
messageDispatcher
- the source of the event. May be used to send response PDUs.transportMapping
- the TransportMapping
which received the PDU.sourceAddress
- the source transport address of the SNMP message.messageProcessingModel
- the message processing model ID.securityModel
- the security model ID.securityName
- the principal.securityLevel
- the requested security level.pduHandle
- the PDU handle that uniquely identifies the pdu
.pdu
- the SNMP request PDU to process.maxSizeResponseScopedPDU
- the maximum size of a possible response PDU.stateReference
- needed for responding a request, will be null
for
notifications.public CommandResponderEvent(java.lang.Object source, CommandResponderEvent other)
CommandResponderEvent
but the source of the event is set to the supplied source.source
- the (new) source of event copy to create.other
- the CommandResponderEvent
to copy.public MessageDispatcher getMessageDispatcher()
MessageDispatcher
instance that received the command.public int getSecurityModel()
public void setSecurityModel(int securityModel)
public void setSecurityLevel(int securityLevel)
public int getSecurityLevel()
public void setMaxSizeResponsePDU(int maxSizeResponsePDU)
public int getMaxSizeResponsePDU()
public void setPduHandle(PduHandle pduHandle)
public PduHandle getPduHandle()
public void setStateReference(StateReference stateReference)
public StateReference getStateReference()
public void setPDU(PDU pdu)
public PDU getPDU()
public void setMessageProcessingModel(int messageProcessingModel)
public int getMessageProcessingModel()
public void setSecurityName(byte[] securityName)
public byte[] getSecurityName()
public void setProcessed(boolean processed)
processed
- If set to true
, the dispatcher stops dispatching this
event to other event listeners, because it has been successfully
processed.public boolean isProcessed()
true
if this event has been processed, false
otherwise.public Address getPeerAddress()
Address
of the PDU sender.public TransportMapping getTransportMapping()
TransportMapping
instance.public void setPeerAddress(Address peerAddress)
peerAddress
- the Address
of the PDU sender.protected void setTransportMapping(TransportMapping transportMapping)
public TransportStateReference getTmStateReference()
TransportStateReference
instance if the transport and/or
the security model supports it or null
otherwise.public void setTmStateReference(TransportStateReference tmStateReference)
tmStateReference
- the transport model (mapping) state information associated with
this command responder event.public java.lang.String toString()
toString
in class java.util.EventObject