com.adventnet.snmp.snmp2.agent
Class BaseSysORTableRequestHandler

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
      extended by com.adventnet.snmp.snmp2.agent.BaseSysORTableRequestHandler
All Implemented Interfaces:
VarBindRequestListener, AgentEventListener
Direct Known Subclasses:
SysORTableRequestHandler

public class BaseSysORTableRequestHandler
extends SimpleRequestHandler

Handles all requests under sysORTable group Both SysORTableRequestHandler and MicroSysORTableRequestHandler extend this class.

See Also:
SysORTableRequestHandler, MicroSysORTableRequestHandler

Field Summary
(package private)  BaseSnmpAgent agentName
           
(package private)  java.util.Hashtable atomicTable
           
(package private)  java.lang.String[] descr
           
(package private)  int[] index
           
(package private)  java.lang.String[] Oid
           
(package private) static int SYSORDESCR
           
(package private) static int SYSORID
           
(package private) static int SYSORINDEX
           
(package private) static int SYSORUPTIME
           
 AgentTableModel tModelComplete
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
BaseSysORTableRequestHandler()
          Empty Constructor.
BaseSysORTableRequestHandler(BaseSnmpAgent agentRef)
          Default Constructor with BaseSnmpAgent reference.
BaseSysORTableRequestHandler(BaseSnmpAgent agentRef, java.lang.String tableDirectory, java.lang.String tableName)
          Constructor where the directory and table file name can be customised by the user
 
Method Summary
protected  void createLogger()
           
static SysOREntry createSysOREntry(int sysORIndex, java.lang.String sysORID, java.lang.String sysORDescr, long sysORUpTime)
          This is a static method for creating SysOREntry.
 AgentTableModel getAgentTableModel()
          Getter for the Table Model which maintains the Table Entries
 int[] getOidRep()
          Retrives the integer representation of OID
protected  int[] getSubidList()
          Gets the subid list of the oid.
static int[] getSysORTableOidRep()
          Gets the SysORTable entry OID - int[] of {1,3,6,1,2,1,1,9,1}
 java.util.Vector getTableVector()
          Getter for Table Entries Vector
protected  void processGetNextRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the GetNextRequest message from the manager for the sysORTable
protected  void processGetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the GetRequest message from the manager for the sysORTable
protected  void processGetRequest(SnmpVarBind varb, int req, VarBindRequestEvent pe, SysOREntry entry)
          Processes the GetRequest message from the manager for the sysORTable.
protected  void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the SetRequest message from the manager for the sysORTable
 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, getMibVarHash, getNextRequest, getNextRequest, getObjectHash, 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

SYSORINDEX

static final int SYSORINDEX
See Also:
Constant Field Values

SYSORID

static final int SYSORID
See Also:
Constant Field Values

SYSORDESCR

static final int SYSORDESCR
See Also:
Constant Field Values

SYSORUPTIME

static final int SYSORUPTIME
See Also:
Constant Field Values

agentName

BaseSnmpAgent agentName

tModelComplete

public AgentTableModel tModelComplete

atomicTable

java.util.Hashtable atomicTable

index

int[] index

Oid

java.lang.String[] Oid

descr

java.lang.String[] descr
Constructor Detail

BaseSysORTableRequestHandler

public BaseSysORTableRequestHandler()
Empty Constructor.


BaseSysORTableRequestHandler

public BaseSysORTableRequestHandler(BaseSnmpAgent agentRef)
Default Constructor with BaseSnmpAgent reference.

Parameters:
agentRef - The Agent Reference of the running Agent

BaseSysORTableRequestHandler

public BaseSysORTableRequestHandler(BaseSnmpAgent agentRef,
                                    java.lang.String tableDirectory,
                                    java.lang.String tableName)
Constructor where the directory and table file name can be customised by the user

Parameters:
agentRef - The Agent Reference of the running Agent
tableDirectory - The directory where the fileSystem stores the table file
tableName - The file Name in which the fileSystem stores the Table Entries
Method Detail

getSysORTableOidRep

public static int[] getSysORTableOidRep()
Gets the SysORTable entry OID - int[] of {1,3,6,1,2,1,1,9,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

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Processes the GetRequest message from the manager for the sysORTable

Overrides:
processGetRequest in class SimpleRequestHandler
Parameters:
varb - specifies the VarBind
node - The node for which the Get Request is given
pe - The VarBindRequestEvent created for the Get Request
Throws:
AgentSnmpException - this wraps all the exceptions thrown during this process.

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 int req,
                                 VarBindRequestEvent pe,
                                 SysOREntry entry)
                          throws AgentSnmpException
Processes the GetRequest message from the manager for the sysORTable.

Parameters:
varb - specifies the VarBind.
req - The column for which the Get Request is processed
pe - The VarBindRequestEvent created for the Get Request.
entry - specifies the Row Entry for which the Get Request is processed.
Throws:
AgentSnmpException - this wraps all the exceptions thrown during this process.

processSetRequest

protected void processSetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Processes the SetRequest message from the manager for the sysORTable

Overrides:
processSetRequest in class SimpleRequestHandler
Parameters:
varb - specifies the VarBind
node - The node for which the Set Request is given
pe - The VarBindRequestEvent created for the Set Request
Throws:
AgentSnmpException - this wraps all the exceptions thrown during this process.

processGetNextRequest

protected void processGetNextRequest(SnmpVarBind varb,
                                     AgentNode node,
                                     VarBindRequestEvent pe)
                              throws AgentSnmpException
Processes the GetNextRequest message from the manager for the sysORTable

Overrides:
processGetNextRequest in class SimpleRequestHandler
Parameters:
varb - specifies the VarBind
node - The node for which the Get Next Request is given
pe - The VarBindRequestEvent created for the Get Next Request
Throws:
AgentSnmpException - this wraps all the exceptions thrown during this process.

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)

createSysOREntry

public static SysOREntry createSysOREntry(int sysORIndex,
                                          java.lang.String sysORID,
                                          java.lang.String sysORDescr,
                                          long sysORUpTime)
This is a static method for creating SysOREntry.

Parameters:
sysORIndex - The Index of the SysOREntry
sysORId - The Object Identifier specifying the Agents enterprise OID
sysORDescr - The A textual description of the capabilities identified by the corresponding instance of sysORID.
sysORUpTime - The Agent UpTime when this row was created
Returns:
The created SysOREntry

createLogger

protected void createLogger()