com.adventnet.snmp.snmp2.agent
Class TrapTableRequestHandler

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
      extended by com.adventnet.snmp.snmp2.agent.TrapTableRequestHandler
All Implemented Interfaces:
VarBindRequestListener, AgentEventListener

public class TrapTableRequestHandler
extends SimpleRequestHandler

Handles all requests under trapTable group


Field Summary
(package private) static int AGENTCOMMUNITY
           
(package private) static int AGENTHOST
           
(package private) static int AGENTHOSTTYPE
           
(package private)  SnmpAgent agentName
           
(package private) static int AGENTSTATUS
           
(package private) static int AGENTTRAPPORTNUMBER
           
(package private) static int COLUMNCOUNT
           
(package private)  AgentTableModel tModelComplete
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
TrapTableRequestHandler(SnmpAgent agentRef)
          Default constructor that takes the SnmpAgent as the argument.
TrapTableRequestHandler(SnmpAgent agentRef, java.lang.String dir, java.lang.String fileName, boolean fToVPersistence)
          Constructor that takes the SnmpAgent as the argument and persistence properties.
 
Method Summary
(package private)  boolean checkForRowStatus(TrapEntry entry)
           
 void createAndAddTrapFilteringEntry(java.lang.Integer hostType, java.lang.String host, java.lang.Integer port, java.lang.String community, java.lang.Integer status)
          To Create TrapEntry for the TrapFilteringTable with the corresponding values.
 void createAndAddTrapFilteringEntry(java.lang.String host, java.lang.Integer port, java.lang.String community, java.lang.Integer status)
          Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values.
 void createAndAddTrapFilteringEntry(java.lang.String host, int port, java.lang.String community)
          Deprecated. use the other method To Create TrapEntry for the TrapFilteringTable with the corresponding values.
static TrapEntry createTrapFilteringEntry(java.lang.Integer hostType, java.lang.String host, java.lang.Integer port, java.lang.String community, java.lang.Integer status)
          To Create TrapEntry for the TrapFilteringTable with the corresponding values.
static TrapEntry createTrapFilteringEntry(java.lang.Integer hostType, java.lang.String host, int port, java.lang.String community)
          To Create TrapEntry for the TrapFilteringTable with the corresponding values with the RowStatus value as Active(1).
static TrapEntry createTrapFilteringEntry(java.lang.String host, java.lang.Integer port, java.lang.String community, java.lang.Integer status)
          Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values.
static TrapEntry createTrapFilteringEntry(java.lang.String host, int port, java.lang.String community)
          Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values with the RowStatus value as Active(1).
 AgentTableModel getAgentTableModel()
          Getter for the Table Model which maintains the Table Entries
static java.util.Hashtable getMibVarHash()
          Deprecated. - use getObjectHash() for getting the details of Sub-Ids Method to retrun the HashTable of MibVars.
 java.util.Hashtable getObjectHash()
          Same as method getMibVarHash, but non-static.Duplicated to have backward compatibility Method to retrun the HashTable of AttributeName - SubId pairs
 int[] getOidRep()
          Retrives the integer representation of OID
protected  int[] getSubidList()
          Gets the subid list of the oid.
 java.util.Vector getTableVector()
          Getter for Table Entries Vector
 TrapEntry getTrapEntryInstance()
          Method to get the New TrapEntry instance.
static int[] getTrapTableOidRep()
          Gets the TrapTable entry OID - int[] of {1,3,6,1,4,1,2162,10,3,1,2,3,5,1}
(package private)  void initTableVector()
           
protected  void processGetNextRequest(java.util.Vector varbinds, java.util.Vector nodes, VarBindRequestEvent pe)
          This method is used for processing the incoming GETNEXT Requests
protected  void processGetRequest(java.util.Vector varbinds, java.util.Vector nodes, VarBindRequestEvent pe)
          This method along with processReadRequest is used for processing the GET Requests
protected  java.util.Vector processReadRequest(VarBindRequestEvent pe, TrapEntry entry, java.util.Vector attributesList, java.util.Hashtable varbindIndexHash)
          This method along with processGetRequest, will be used for processing the incoming GET Requests
protected  void processSetRequest(java.util.Vector varbinds, java.util.Vector nodes, VarBindRequestEvent pe)
          This method along with processWriteRequest is used for processing the incoming SET Requests
 java.util.Vector processWriteRequest(java.lang.String instanceString, java.util.Vector list, VarBindRequestEvent pe, java.util.Hashtable varbindIndexHash)
          This method along with the ProcessSetRequest is used for processing the Incoming Set Requests
 void setTableVector(java.util.Vector tableVector)
          Setter for the Table Entries for sysORTable
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
addInstrumentHandler, addRegistrationListener, addTableListener, addUpdateListener, getInstrument, getNextRequest, getNextRequest, getObjectTypeHash, getRequest, getTableListener, getUpdateListener, isWriteEachTime, processGetNextRequest, processGetRequest, processSetRequest, removeRegistrationListener, removeUpdateListener, setRequest, setWriteEachTime, writeIntoFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGENTHOSTTYPE

static final int AGENTHOSTTYPE
See Also:
Constant Field Values

AGENTHOST

static final int AGENTHOST
See Also:
Constant Field Values

AGENTTRAPPORTNUMBER

static final int AGENTTRAPPORTNUMBER
See Also:
Constant Field Values

AGENTCOMMUNITY

static final int AGENTCOMMUNITY
See Also:
Constant Field Values

AGENTSTATUS

static final int AGENTSTATUS
See Also:
Constant Field Values

COLUMNCOUNT

static final int COLUMNCOUNT
See Also:
Constant Field Values

agentName

SnmpAgent agentName

tModelComplete

AgentTableModel tModelComplete
Constructor Detail

TrapTableRequestHandler

public TrapTableRequestHandler(SnmpAgent agentRef)
Default constructor that takes the SnmpAgent as the argument.

Parameters:
agentRef - instance of SnmpAgent

TrapTableRequestHandler

public TrapTableRequestHandler(SnmpAgent agentRef,
                               java.lang.String dir,
                               java.lang.String fileName,
                               boolean fToVPersistence)
Constructor that takes the SnmpAgent as the argument and persistence properties.

Parameters:
agentRef - instance of SnmpAgent
dir - the directory location String of the File.
fileName - the fileName String.
fToVPersistence - the boolean true for TextFile storage false for a XML format.
Method Detail

getTrapTableOidRep

public static int[] getTrapTableOidRep()
Gets the TrapTable entry OID - int[] of {1,3,6,1,4,1,2162,10,3,1,2,3,5,1}

Returns:
The registered Table Entry OID as an int array

getOidRep

public int[] getOidRep()
Description copied from class: SimpleRequestHandler
Retrives the integer representation of OID

Overrides:
getOidRep in class SimpleRequestHandler
Returns:
the integer array of OID

getSubidList

protected int[] getSubidList()
Description copied from class: SimpleRequestHandler
Gets the subid list of the oid.

Overrides:
getSubidList in class SimpleRequestHandler
Returns:
the integer array of subid list

getMibVarHash

public static java.util.Hashtable getMibVarHash()
Deprecated. - use getObjectHash() for getting the details of Sub-Ids Method to retrun the HashTable of MibVars.

Returns:
Hashatable of the MibVars.

getObjectHash

public java.util.Hashtable getObjectHash()
Same as method getMibVarHash, but non-static.Duplicated to have backward compatibility Method to retrun the HashTable of AttributeName - SubId pairs

Overrides:
getObjectHash in class SimpleRequestHandler

processReadRequest

protected java.util.Vector processReadRequest(VarBindRequestEvent pe,
                                              TrapEntry entry,
                                              java.util.Vector attributesList,
                                              java.util.Hashtable varbindIndexHash)
This method along with processGetRequest, will be used for processing the incoming GET Requests

Parameters:
pe - VarbindRequestEvent
entry - Entry Object, which contains getter/setter methods for the attributes in this Table Group
attributesList - List of SnmpVarbinds of Attributes for which GET Request is to be perfortmed
varbindIndexHash - Hashtable for storing the index of the incoming varbinds
Returns:
List of Objects, for which GET is failed

processWriteRequest

public java.util.Vector processWriteRequest(java.lang.String instanceString,
                                            java.util.Vector list,
                                            VarBindRequestEvent pe,
                                            java.util.Hashtable varbindIndexHash)
This method along with the ProcessSetRequest is used for processing the Incoming Set Requests

Parameters:
instanceString - Index of the row in which SET Request is to be performed
list - List of SnmpVarbinds of Attributes for which SET is performed
pe - VarbindRequest Event
varbindIndexHash - Hashtable for storing the index of the incoming varbinds
Returns:
List of Objects, for which SET is failed

processGetRequest

protected void processGetRequest(java.util.Vector varbinds,
                                 java.util.Vector nodes,
                                 VarBindRequestEvent pe)
This method along with processReadRequest is used for processing the GET Requests

Overrides:
processGetRequest in class SimpleRequestHandler
Parameters:
varbinds - List of SnmpVarbinds for which GET Request is to be performed
nodes - List of Agent Nodes for which GET Request is performed
pe - VarbindRequest Event

processSetRequest

protected void processSetRequest(java.util.Vector varbinds,
                                 java.util.Vector nodes,
                                 VarBindRequestEvent pe)
This method along with processWriteRequest is used for processing the incoming SET Requests

Overrides:
processSetRequest in class SimpleRequestHandler
Parameters:
varbinds - List of SnmpVarbinds for which SET Request is performed
nodes - List of Agent Nodes for which SET Request is performed
pe - VarbindRequest Event

processGetNextRequest

protected void processGetNextRequest(java.util.Vector varbinds,
                                     java.util.Vector nodes,
                                     VarBindRequestEvent pe)
This method is used for processing the incoming GETNEXT Requests

Overrides:
processGetNextRequest in class SimpleRequestHandler
Parameters:
varbinds - List of varbinds for which the GETNEXT Request is to be performed
nodes - List of AgentNodes for which GETNEXT Request is to be performed
pe - VarbindRequest Event

checkForRowStatus

boolean checkForRowStatus(TrapEntry entry)
                    throws AgentException
Throws:
AgentException

getTrapEntryInstance

public TrapEntry getTrapEntryInstance()
Method to get the New TrapEntry instance.

Returns:
The new TrapEntry instance.

setTableVector

public void setTableVector(java.util.Vector tableVector)
Setter for the Table Entries for sysORTable

Parameters:
tableVector - The Vector of SysOREntry objects.
See Also:
getTableVector()

getAgentTableModel

public AgentTableModel getAgentTableModel()
Getter for the Table Model which maintains the Table Entries

Returns:
The AgentTableModel associated with this Table.

getTableVector

public java.util.Vector getTableVector()
Getter for Table Entries Vector

Returns:
The Vector of SysOREntry objects.
See Also:
setTableVector(Vector tableVector);

initTableVector

void initTableVector()

createAndAddTrapFilteringEntry

public void createAndAddTrapFilteringEntry(java.lang.String host,
                                           int port,
                                           java.lang.String community)
Deprecated. use the other method To Create TrapEntry for the TrapFilteringTable with the corresponding values.

Parameters:
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created

createAndAddTrapFilteringEntry

public void createAndAddTrapFilteringEntry(java.lang.String host,
                                           java.lang.Integer port,
                                           java.lang.String community,
                                           java.lang.Integer status)
Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values.

Parameters:
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
status - the RowStatus value (1 - 5) with which the Entry to be created

createAndAddTrapFilteringEntry

public void createAndAddTrapFilteringEntry(java.lang.Integer hostType,
                                           java.lang.String host,
                                           java.lang.Integer port,
                                           java.lang.String community,
                                           java.lang.Integer status)
To Create TrapEntry for the TrapFilteringTable with the corresponding values.

Parameters:
hostType - the type of the IPAddress of the host with which the Entry is to be created
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
status - the RowStatus value (1 - 5) with which the Entry to be created

createTrapFilteringEntry

public static TrapEntry createTrapFilteringEntry(java.lang.String host,
                                                 int port,
                                                 java.lang.String community)
Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values with the RowStatus value as Active(1).

Parameters:
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
Returns:
The TrapEntry instance created for the params

createTrapFilteringEntry

public static TrapEntry createTrapFilteringEntry(java.lang.Integer hostType,
                                                 java.lang.String host,
                                                 int port,
                                                 java.lang.String community)
To Create TrapEntry for the TrapFilteringTable with the corresponding values with the RowStatus value as Active(1).

Parameters:
hostType - the type of the IPAddress of the host with which the Entry is to be created
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
Returns:
The TrapEntry instance created for the params

createTrapFilteringEntry

public static TrapEntry createTrapFilteringEntry(java.lang.String host,
                                                 java.lang.Integer port,
                                                 java.lang.String community,
                                                 java.lang.Integer status)
Deprecated. - make use of the method with extra argument as the index has been changed. To Create TrapEntry for the TrapFilteringTable with the corresponding values.

Parameters:
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
status - the RowStatus value (1 - 5) with which the Entry to be created
Returns:
The TrapEntry instance created for the params

createTrapFilteringEntry

public static TrapEntry createTrapFilteringEntry(java.lang.Integer hostType,
                                                 java.lang.String host,
                                                 java.lang.Integer port,
                                                 java.lang.String community,
                                                 java.lang.Integer status)
To Create TrapEntry for the TrapFilteringTable with the corresponding values.

Parameters:
hostType - the type of the IPAddress of the host with which the Entry is to be created
host - the host with which the Entry is to be created
port - the port with which the Entry is to be created
community - the community with which the Entry is to be created
status - the RowStatus value (1 - 5) with which the Entry to be created
Returns:
The TrapEntry instance created for the params