com.adventnet.snmp.snmp2.agent
Class VaclTableRequestHandler

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

public class VaclTableRequestHandler
extends BaseTableRequestHandler

Handles all requests under vaclTable group


Field Summary
(package private) static int COLUMNCOUNT
           
(package private) static int MIBVIEWS
           
(package private) static int VIEWSTATUS
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseTableRequestHandler
listenerList, tModelComplete
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
VaclTableRequestHandler(SnmpAgent agentRef, boolean persistence)
          Deprecated. persistence has been moved to VaclTable. Primary construtor with Agent Reference and persistence flag.
VaclTableRequestHandler(SnmpAgent agentRef, java.lang.String dirStr, java.lang.String fileName, boolean fToVPersistence)
          Deprecated. persistence has been moved to VaclTable. Primary construtor with Agent Reference and directory & fileName of persistence to the FileSystem.
VaclTableRequestHandler(SnmpAgent agentRef, VaclTable table)
          The primary constructor to VaclTableRequestHandler This constructor gets the agent reference to which this table should associate with and the VaclTable which needs remote configuration.
 
Method Summary
(package private)  boolean checkForRowStatus(VaclEntry entry)
           
static VaclEntry createVaclEntry(java.lang.String community, java.lang.String[] mibViews)
          To Create VaclEntry for the VaclTable with the corresponding values and RowStatus value as Active(1).
static VaclEntry createVaclEntry(java.lang.String community, java.lang.String[] mibViews, java.lang.Integer status)
          To Create VaclEntry for the VaclTable with the corresponding values.
 int[] getOidRep()
          Getter for the OID representation of the VaclTable.
 java.lang.String getRegisteredOid()
          Getter of the registered TableEntry OID.
protected  int[] getSubidList()
          Getter of the sub id List of the VaclTable.
 int[] getVaclTableOidRep()
          Getter for the OID representation of the VaclTable.
 boolean isFToVPersistence()
          Deprecated. persistence has been moved to VaclTable. Gettter for fToV Persistence flag.
 boolean isPersistence()
          Deprecated. persistence has been moved to VaclTable. Getter of the persistence flag.
protected  void processGetNextRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Process the GetNext Request message which is received from PduRequestHandler.
protected  void processGetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Process the Get Request message which is received from PduRequestHandler.
protected  void processGetRequest(SnmpVarBind varb, int req, VarBindRequestEvent pe, VaclEntry entry)
           
protected  void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Process the Set Request message which is received from PduRequestHandler.
 void setFToVPersistence(boolean fToVPersistence)
          Deprecated. - use the method in the VaclTable. Setter of File To Vector persistence flag.
 void setPersistence(boolean persistence)
          Deprecated. use the method in the VaclTable. Setter for the persistence flag.
 void setRegisteredOid(java.lang.String oid)
          Setter for the TableEntry OID representation for allowing users to have their own VaclTable.
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseTableRequestHandler
addChangeListener, createChangeEvent, fireChangeEvent, getTableVector, removeChangeListener, setTableVector
 
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

MIBVIEWS

static final int MIBVIEWS
See Also:
Constant Field Values

VIEWSTATUS

static final int VIEWSTATUS
See Also:
Constant Field Values

COLUMNCOUNT

static final int COLUMNCOUNT
See Also:
Constant Field Values
Constructor Detail

VaclTableRequestHandler

public VaclTableRequestHandler(SnmpAgent agentRef,
                               boolean persistence)
Deprecated. persistence has been moved to VaclTable. Primary construtor with Agent Reference and persistence flag.

Parameters:
agentRef - The Agent Reference.
persistence - The persistence flag.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

VaclTableRequestHandler

public VaclTableRequestHandler(SnmpAgent agentRef,
                               java.lang.String dirStr,
                               java.lang.String fileName,
                               boolean fToVPersistence)
Deprecated. persistence has been moved to VaclTable. Primary construtor with Agent Reference and directory & fileName of persistence to the FileSystem.

Parameters:
agentRef - The Agent Reference.
dirStr - The directory Name of the persistence.
fileName - The file Name of the persistence.
fToVPersistence - boolean to specify the storage format.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

VaclTableRequestHandler

public VaclTableRequestHandler(SnmpAgent agentRef,
                               VaclTable table)
The primary constructor to VaclTableRequestHandler This constructor gets the agent reference to which this table should associate with and the VaclTable which needs remote configuration.

Parameters:
agentRef - The Snmp Agent Reference.
table - The VaclTable instance associated with the Agent.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
Method Detail

getVaclTableOidRep

public int[] getVaclTableOidRep()
Getter for the OID representation of the VaclTable.

Returns:
the int[] representation of {1,3,6,1,4,1,2162,10,3,1,2,1,2,1}

setRegisteredOid

public void setRegisteredOid(java.lang.String oid)
Setter for the TableEntry OID representation for allowing users to have their own VaclTable.

Parameters:
oid - The string representation of Table's Entry OID similar to ".1.3.6.1.4.1.2162.1.2.3.2.1".

getRegisteredOid

public java.lang.String getRegisteredOid()
Getter of the registered TableEntry OID.

Returns:
".1.3.6.1.4.1.2162.1.2.3.2.1" by default.

getOidRep

public int[] getOidRep()
Getter for the OID representation of the VaclTable. This method is generated to preserve the old API.

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

getSubidList

protected int[] getSubidList()
Getter of the sub id List of the VaclTable.

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

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Description copied from class: SimpleRequestHandler
Process the Get Request message which is received from PduRequestHandler.

Overrides:
processGetRequest in class SimpleRequestHandler
Parameters:
varb - The received varbind .
node - The node for which Get Request is to be done.
pe - The VarBind Request Event created by this Get request.
Throws:
AgentSnmpException - This wraps all the Exceptions thrown while Processing the Event.

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 int req,
                                 VarBindRequestEvent pe,
                                 VaclEntry entry)
                          throws AgentSnmpException
Throws:
AgentSnmpException

processSetRequest

protected void processSetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Description copied from class: SimpleRequestHandler
Process the Set Request message which is received from PduRequestHandler.

Overrides:
processSetRequest in class SimpleRequestHandler
Parameters:
varb - The received varbind.
node - The node for which Get Next Request is to be done.
pe - The VarBind Request Event created by this GetNext request.
Throws:
AgentSnmpException - This wraps all the Exceptions thrown while Processing the Event.

processGetNextRequest

protected void processGetNextRequest(SnmpVarBind varb,
                                     AgentNode node,
                                     VarBindRequestEvent pe)
                              throws AgentSnmpException
Description copied from class: SimpleRequestHandler
Process the GetNext Request message which is received from PduRequestHandler.

Overrides:
processGetNextRequest in class SimpleRequestHandler
Parameters:
varb - The received varbind.
node - The node for which Get Next Request is to be done.
pe - The VarBind Request Event created by this GetNext request.
Throws:
AgentSnmpException - This wraps all the Exceptions thrown while Processing the Event.

checkForRowStatus

boolean checkForRowStatus(VaclEntry entry)
                    throws AgentException
Throws:
AgentException

setPersistence

public void setPersistence(boolean persistence)
Deprecated. use the method in the VaclTable. Setter for the persistence flag.

Parameters:
persistence - The persistence of ViewAccessControlTable.txt to the fileSystem.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

isPersistence

public boolean isPersistence()
Deprecated. persistence has been moved to VaclTable. Getter of the persistence flag.

Returns:
true if the persistence is turned ON. false if the persistence is turned OFF.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

createVaclEntry

public static VaclEntry createVaclEntry(java.lang.String community,
                                        java.lang.String[] mibViews)
To Create VaclEntry for the VaclTable with the corresponding values and RowStatus value as Active(1). Check whether you have added the community before adding the VaclEntry created through this method.

Parameters:
community - The community for which the Entry is created.
mibViews - The mibViews string array containing the string representations of the OIDs for View Access.
Returns:
The VaclEntry created with the community and Mib View with RowStatus ACTIVE.

createVaclEntry

public static VaclEntry createVaclEntry(java.lang.String community,
                                        java.lang.String[] mibViews,
                                        java.lang.Integer status)
To Create VaclEntry for the VaclTable with the corresponding values. Check whether you have added the community before adding the VaclEntry created through this method.

Parameters:
community - The community for which the Entry is created.
mibViews - The mibViews string array containing the string representations of the OIDs for View Access.
status - the RowStatus value (1 - 5)with which this Row has to be created
Returns:
The VaclEntry created with the community and Mib View with RowStatus value set.

setFToVPersistence

public void setFToVPersistence(boolean fToVPersistence)
Deprecated. - use the method in the VaclTable. Setter of File To Vector persistence flag.

Parameters:
fToVPersistence - the FToV persistence flag.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
isFToVPersistence()

isFToVPersistence

public boolean isFToVPersistence()
Deprecated. persistence has been moved to VaclTable. Gettter for fToV Persistence flag.

Returns:
true if fToV Persistence is set else false.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0
See Also:
setFToVPersistence(boolean fToVPersistence)