com.adventnet.snmp.snmp2.agent
Class TrapRequestEvent

java.lang.Object
  |
  +--com.adventnet.utils.agent.AgentEventObject
        |
        +--com.adventnet.snmp.snmp2.agent.TrapRequestEvent

public class TrapRequestEvent
extends AgentEventObject

The TrapRequestEvent is fired by sources which are interested in sending traps to managers at specified ports The data source for the manager could be specified by users either through a TrapForwardingTable , in the Event itself or through acl files which are loaded by the TrapListeners

See Also:
TrapRequestListener, SnmpTrapService, MicroSnmpTrapService, TrapForwardingTableInterface, Serialized Form

Field Summary
static int ACL
          Use this value to indicate the Source for trap information This indicates that information is in the ACL files
static int DEFAULT
          Use these values in the source DEFAULT value picks up the trap details including the managerHost and port from the Event itself
(package private)  java.lang.String enterpriseOID
           
static int MIBS
          Use this when MIB support is available
static int MIBS_TFTABLE
          Use this when MIB support and TrapForwarding Table suuport is available
(package private)  OidandValue[] oidvalues
           
(package private)  int sourceForTrapInfo
           
(package private)  boolean subAgent
           
static int TFTABLE
          Use this value when the TrapRequestListener has a TrapForwardingTable associated with it
(package private)  long timeticks
           
(package private)  int trapIndex
           
(package private)  java.util.Vector varbinds
           
 
Fields inherited from class com.adventnet.utils.agent.AgentEventObject
source
 
Constructor Summary
TrapRequestEvent(java.lang.Object source)
          This constructor is used when there are no variables for TrapRequestEvent
TrapRequestEvent(java.lang.Object source, int sourceForTrapInfo, long timeticks)
          This constructor is used when there are no variables for TrapRequestEvent
TrapRequestEvent(java.lang.Object source, java.util.Vector varbinds, int sourceForTrapInfo, long timeticks)
          The constructor for TrapRequestEvent
TrapRequestEvent(java.lang.Object source, java.util.Vector varbinds, int sourceForTrapInfo, java.lang.String enterpriseOID, int index)
          The constructor for TrapRequestEvent
 
Method Summary
 java.lang.String getAgentAddress()
          Gets the agent address to be used for the TrapRequest to be sent.
 java.lang.String getEnterpriseOID()
          gets the enterprise oid associated with this TrapRequestEvent.
 OidandValue[] getOidandValueList()
          Getter for OidandValueList
 int getSourceForTrapInfo()
          The source of the MibTrap valid values are DEFAULT , MIBS and ACL a value DEFAULT indicates the event contains all the details
 boolean getSubAgent()
          gets whether the agent is running as standalone or sub-agent
 long getTimeTicks()
          Getter for timeticks
 int getTrapIndex()
          gets the enterprise specific trap index associated with this TrapRequestEvent.
 java.util.Vector getVarBinds()
          Getter for varbinds which are used to send in the trap PDU.
 void setAgentAddress(java.lang.String agentAddress)
          Sets the agent address to be used for the TrapRequest to be sent.
 void setOidandValueList(OidandValue[] val)
          Setter for OidandValueList.
 void setSourceForTrapInfo(int source)
          setter for the source of the MibTrap, valid values are DEFAULT , MIBS and ACL.
 void setSubAgent(boolean val)
          If this flag is set to true, traps will be forwaded to windows-master agent.
 void setTimeTicks(long timeticks)
          Setter for timeticks
 
Methods inherited from class com.adventnet.utils.agent.AgentEventObject
getSource, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enterpriseOID

java.lang.String enterpriseOID

trapIndex

int trapIndex

DEFAULT

public static final int DEFAULT
Use these values in the source DEFAULT value picks up the trap details including the managerHost and port from the Event itself

TFTABLE

public static final int TFTABLE
Use this value when the TrapRequestListener has a TrapForwardingTable associated with it

ACL

public static final int ACL
Use this value to indicate the Source for trap information This indicates that information is in the ACL files

MIBS

public static final int MIBS
Use this when MIB support is available

MIBS_TFTABLE

public static final int MIBS_TFTABLE
Use this when MIB support and TrapForwarding Table suuport is available

sourceForTrapInfo

int sourceForTrapInfo

oidvalues

OidandValue[] oidvalues

varbinds

java.util.Vector varbinds

timeticks

long timeticks

subAgent

boolean subAgent
Constructor Detail

TrapRequestEvent

public TrapRequestEvent(java.lang.Object source,
                        java.util.Vector varbinds,
                        int sourceForTrapInfo,
                        long timeticks)
The constructor for TrapRequestEvent
Parameters:
source - - source of the event
varbinds - - list of varbind
sourceForTrapInfo - - the source for Trap Information
timeticks - - timer value
See Also:
getSource

TrapRequestEvent

public TrapRequestEvent(java.lang.Object source,
                        int sourceForTrapInfo,
                        long timeticks)
This constructor is used when there are no variables for TrapRequestEvent
Parameters:
source - - source of the event
sourceForTrapInfo - - the source for Trap Information
timeticks - - timer value
See Also:
getSource

TrapRequestEvent

public TrapRequestEvent(java.lang.Object source)
This constructor is used when there are no variables for TrapRequestEvent
Parameters:
source - source of the event

TrapRequestEvent

public TrapRequestEvent(java.lang.Object source,
                        java.util.Vector varbinds,
                        int sourceForTrapInfo,
                        java.lang.String enterpriseOID,
                        int index)
The constructor for TrapRequestEvent
Parameters:
source - source of the event
varbinds - list of varbind
enterpriseOID - the EnterpriseOID for Trap Information
sourceForTrapInfo - the source for Trap Information
timeticks - timer value
index - the trap index(enterprise-specific).
Method Detail

getEnterpriseOID

public java.lang.String getEnterpriseOID()
gets the enterprise oid associated with this TrapRequestEvent.
Returns:
The Enterprise OID of this Event.

getTrapIndex

public int getTrapIndex()
gets the enterprise specific trap index associated with this TrapRequestEvent.
Returns:
The TrapIndex int of this Event.

getSourceForTrapInfo

public int getSourceForTrapInfo()
The source of the MibTrap valid values are DEFAULT , MIBS and ACL a value DEFAULT indicates the event contains all the details
Returns:
the sourceForTrapInfo

setSourceForTrapInfo

public void setSourceForTrapInfo(int source)
setter for the source of the MibTrap, valid values are DEFAULT , MIBS and ACL. A value DEFAULT indicates the event contains all the details
Parameters:
source - the Source for this Trap info.

getAgentAddress

public java.lang.String getAgentAddress()
Gets the agent address to be used for the TrapRequest to be sent. Mainly used when the Subagent's trap is forwarded to the SNMP Manager from the Master Agent to show the actual address from where the trap is received.
Returns:
the agent address for this Trap Request Event

setAgentAddress

public void setAgentAddress(java.lang.String agentAddress)
Sets the agent address to be used for the TrapRequest to be sent. Mainly used when the Subagent's trap is forwarded to the SNMP Manager from the Master Agent to show the actual address from where the trap is received.
Parameters:
agentAddress - the agent address for this Trap Request Event

setOidandValueList

public void setOidandValueList(OidandValue[] val)
Setter for OidandValueList. This must be set if sourceForTrapInfo is MIBS or MIBS_TFT
Parameters:
val - the Oidandvalue[]

getOidandValueList

public OidandValue[] getOidandValueList()
Getter for OidandValueList
Returns:
The OidandValue array.

getVarBinds

public java.util.Vector getVarBinds()
Getter for varbinds which are used to send in the trap PDU.
Returns:
Vector of varbinds which are to be sent in the trap PDU

getTimeTicks

public long getTimeTicks()
Getter for timeticks
Returns:
The TimeTicks value.

setTimeTicks

public void setTimeTicks(long timeticks)
Setter for timeticks
Parameters:
timeticks - the TimeTicks value to be set.

getSubAgent

public boolean getSubAgent()
gets whether the agent is running as standalone or sub-agent
Returns:
boolean true if subAgent.

setSubAgent

public void setSubAgent(boolean val)
If this flag is set to true, traps will be forwaded to windows-master agent. Otherwise traps will be sent to the managers who are registered through trap forwarding table.
Parameters:
true - to set windows SubAgent.