org.snmp4j
Class CommandResponderEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.snmp4j.CommandResponderEvent
All Implemented Interfaces:
java.io.Serializable

public class CommandResponderEvent
extends java.util.EventObject

The CommandResponderEvent is fired by the MessageDispatcher to listeners that potentially can process the included request, report, or trap/notification.

Version:
1.1
Author:
Jochen Katz & Frank Fock
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
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.
 
Method Summary
 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()
           
 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)
           
protected  void setTransportMapping(TransportMapping transportMapping)
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandResponderEvent

public 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.

Parameters:
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.

CommandResponderEvent

public 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.

Parameters:
source - the (new) source of event copy to create.
other - the CommandResponderEvent to copy.
Since:
1.1
Method Detail

getMessageDispatcher

public MessageDispatcher getMessageDispatcher()
Gets the message dispatcher instance that received the command (request PDU) or unconfirmed PDU like a report, trap, or notification..

Returns:
the MessageDispatcher instance that received the command.

getSecurityModel

public int getSecurityModel()
Gets the security model used by the command.

Returns:
int

setSecurityModel

public void setSecurityModel(int securityModel)

setSecurityLevel

public void setSecurityLevel(int securityLevel)

getSecurityLevel

public int getSecurityLevel()

setMaxSizeResponsePDU

public void setMaxSizeResponsePDU(int maxSizeResponsePDU)

getMaxSizeResponsePDU

public int getMaxSizeResponsePDU()

setPduHandle

public void setPduHandle(PduHandle pduHandle)

getPduHandle

public PduHandle getPduHandle()

setStateReference

public void setStateReference(StateReference stateReference)

getStateReference

public StateReference getStateReference()

setPDU

public void setPDU(PDU pdu)

getPDU

public PDU getPDU()

setMessageProcessingModel

public void setMessageProcessingModel(int messageProcessingModel)

getMessageProcessingModel

public int getMessageProcessingModel()

setSecurityName

public void setSecurityName(byte[] securityName)

getSecurityName

public byte[] getSecurityName()

setProcessed

public void setProcessed(boolean processed)
Sets the status of this PDU.

Parameters:
processed - If set to true, the dispatcher stops dispatching this event to other event listeners, because it has been successfully processed.

isProcessed

public boolean isProcessed()
Checks whether this event is already processed or not.

Returns:
true if this event has been processed, false otherwise.

getPeerAddress

public Address getPeerAddress()
Gets the transport address of the sending entity.

Returns:
the Address of the PDU sender.

getTransportMapping

public TransportMapping getTransportMapping()
Returns the transport mapping that received the PDU that triggered this event.

Returns:
a TransportMapping instance.

setPeerAddress

public void setPeerAddress(Address peerAddress)
Sets the transport address of the sending entity.

Parameters:
peerAddress - the Address of the PDU sender.

setTransportMapping

protected void setTransportMapping(TransportMapping transportMapping)

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.