com.adventnet.snmp.snmp2.agent.vacm
Class VacmAccessTableRequestHandler

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
        |
        +--com.adventnet.snmp.snmp2.agent.vacm.VacmAccessTableRequestHandler

public class VacmAccessTableRequestHandler
extends SimpleRequestHandler

Handles all requests under vacmAccessTable group.


Field Summary
protected  SnmpAgent agentName
          The Reference for the Snmp Agent Instance.
(package private)  java.lang.String fileDir
           
(package private)  java.lang.String format
           
(package private) static int VACMACCESSCONTEXTMATCH
           
(package private) static int VACMACCESSCONTEXTPREFIX
           
(package private)  java.util.Vector vacmAccessEntryVector
           
(package private) static int VACMACCESSNOTIFYVIEWNAME
           
(package private) static int VACMACCESSREADVIEWNAME
           
(package private) static int VACMACCESSSECURITYLEVEL
           
(package private) static int VACMACCESSSECURITYMODEL
           
(package private) static int VACMACCESSSTATUS
           
(package private) static int VACMACCESSSTORAGETYPE
           
(package private) static int VACMACCESSWRITEVIEWNAME
           
(package private)  VacmGroupAccessTable vacmGroupAccessTable
           
(package private)  VacmAccessTableXMLToVector xmlToVector
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
VacmAccessTableRequestHandler(SnmpAgent agentRef)
          Constructor for the VacmAccessTableRequestHandler with agent Reference.
VacmAccessTableRequestHandler(SnmpAgent agentRef, java.lang.String dirStr, java.lang.String fileName, java.lang.String format)
          The Secondary Constructor with the agent Name and Persistence Support.
 
Method Summary
(package private)  boolean checkForRowStatus(VacmAccessEntry entry)
           
 boolean createAndAddVacmAccessEntry(java.lang.String groupName, java.lang.String contextPrefix, java.lang.Integer securityModel, java.lang.Integer securityLevel, java.lang.Integer contextMatch, java.lang.String readView, java.lang.String writeView, java.lang.String notifyView, java.lang.Integer storageType, java.lang.Integer rowStatus)
          The Method to Create and Add a new VacmGroupEntry to VacmGroupAccessTable.
static VacmAccessEntry createVacmAccessEntry(java.lang.String contextPrefix, java.lang.Integer securityModel, java.lang.Integer securityLevel, java.lang.Integer contextMatch, java.lang.String readView, java.lang.String writeView, java.lang.String notifyView, java.lang.Integer storageType, java.lang.Integer rowStatus)
          The Static Method to create a VacmAccessEntry.
 java.util.Vector getGroupAccessTableVector()
          The method to return the Vector of VacmGroupAccessEntries present in the VacmGroupAccessTable.
 int[] getOidRep()
          Retrives the integer representation of OID
protected  int[] getSubidList()
          Gets the subid list of the oid.
 java.util.Hashtable getTableValues()
          Using this method one can get the list of VacmAccessEntries in VacmAccessTable
 java.util.Vector getTableVector()
          Deprecated. - This method has some limitations.Use getTableValues() The method to return the Vector of VacmAccessEntries present in the VacmGroupAccessControlTable.
static int[] getVacmAccessTableOidRep()
          Getter for the Vacm Access Table Oid Representation.
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, VacmAccessEntry entry, byte[] groupName)
          Process the Get Request message for the given params.
protected  void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Process the Set Request message which is received from PduRequestHandler.
 void serialize(java.io.ObjectOutputStream outMain)
          This method Serializes the Output Stream.
 boolean setTableValues(java.util.Hashtable values)
          This method can be used for providing the list of VacmAccessEntries to be added in VacmAccess Table
 void setTableVector(java.util.Vector vacmGroupVec)
          Deprecated. - This method has some limitations.Use setTableValues() The method to set the Vector of VacmAccessEntries.
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
addInstrumentHandler, addRegistrationListener, addTableListener, addUpdateListener, getInstrument, getMibVarHash, getNextRequest, getObjectHash, getObjectTypeHash, getRequest, getTableListener, 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

VACMACCESSCONTEXTPREFIX

static final int VACMACCESSCONTEXTPREFIX

VACMACCESSSECURITYMODEL

static final int VACMACCESSSECURITYMODEL

VACMACCESSSECURITYLEVEL

static final int VACMACCESSSECURITYLEVEL

VACMACCESSCONTEXTMATCH

static final int VACMACCESSCONTEXTMATCH

VACMACCESSREADVIEWNAME

static final int VACMACCESSREADVIEWNAME

VACMACCESSWRITEVIEWNAME

static final int VACMACCESSWRITEVIEWNAME

VACMACCESSNOTIFYVIEWNAME

static final int VACMACCESSNOTIFYVIEWNAME

VACMACCESSSTORAGETYPE

static final int VACMACCESSSTORAGETYPE

VACMACCESSSTATUS

static final int VACMACCESSSTATUS

agentName

protected SnmpAgent agentName
The Reference for the Snmp Agent Instance.

xmlToVector

VacmAccessTableXMLToVector xmlToVector

vacmGroupAccessTable

VacmGroupAccessTable vacmGroupAccessTable

vacmAccessEntryVector

java.util.Vector vacmAccessEntryVector

format

java.lang.String format

fileDir

java.lang.String fileDir
Constructor Detail

VacmAccessTableRequestHandler

public VacmAccessTableRequestHandler(SnmpAgent agentRef)
Constructor for the VacmAccessTableRequestHandler with agent Reference.
Parameters:
agentRef - The Reference for the Snmp Agent.

VacmAccessTableRequestHandler

public VacmAccessTableRequestHandler(SnmpAgent agentRef,
                                     java.lang.String dirStr,
                                     java.lang.String fileName,
                                     java.lang.String format)
The Secondary Constructor with the agent Name and Persistence Support.
Parameters:
agentRef - The Agent Name Reference.
dirStr - The Location of the File.
fileName - The fileName String.
format - The file format(eg., "xml").
Method Detail

getVacmAccessTableOidRep

public static int[] getVacmAccessTableOidRep()
Getter for the Vacm Access Table Oid Representation.
Returns:
The Vacm Access Table Oid Representation.

getOidRep

public int[] getOidRep()
Description copied from class: SimpleRequestHandler
Retrives the integer representation of OID
Overrides:
getOidRep in class SimpleRequestHandler
Tags copied from 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
Tags copied from 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
Tags copied from 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,
                                 VacmAccessEntry entry,
                                 byte[] groupName)
                          throws AgentSnmpException
Process the Get Request message for the given params.
Parameters:
varb - The received VarBind.
req - The request given.
pe - The Varbind Request Event created after thid Event.
entry - The Vacm Access Entry for the Request.
groupName - The Group name for get Request.
Throws:
This - wraps all the Exceptions thrown by the Agent while Processing this event.

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
Tags copied from 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
Tags copied from 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(VacmAccessEntry entry)
                    throws AgentException

createAndAddVacmAccessEntry

public boolean createAndAddVacmAccessEntry(java.lang.String groupName,
                                           java.lang.String contextPrefix,
                                           java.lang.Integer securityModel,
                                           java.lang.Integer securityLevel,
                                           java.lang.Integer contextMatch,
                                           java.lang.String readView,
                                           java.lang.String writeView,
                                           java.lang.String notifyView,
                                           java.lang.Integer storageType,
                                           java.lang.Integer rowStatus)
The Method to Create and Add a new VacmGroupEntry to VacmGroupAccessTable.
Parameters:
groupName - The groupName with which the entry is to be created.
contextPrefix - The contextPrefix with which the entry is to be created.
securityModel - The securityModel with which the entry is to be created(Default - USM (3)).
securityLevel - The securityLevel with which the entry is to be created.
contextMatch - The contextMatch with which the entry is to be created(can be either Included(1) or Excluded(2).
readView - The readView with which the entry is to be created.
writeView - The writeView with which the entry is to be created.
notifyView - The notifyView with which the entry is to be created.
storageType - The storageType for the Entry.
rowStatus - the RowStatus Integer for the Entry.
Returns:
the boolean specifying whether the row is added Successfylly or Not.
See Also:
createVacmAccessEntry.

createVacmAccessEntry

public static VacmAccessEntry createVacmAccessEntry(java.lang.String contextPrefix,
                                                    java.lang.Integer securityModel,
                                                    java.lang.Integer securityLevel,
                                                    java.lang.Integer contextMatch,
                                                    java.lang.String readView,
                                                    java.lang.String writeView,
                                                    java.lang.String notifyView,
                                                    java.lang.Integer storageType,
                                                    java.lang.Integer rowStatus)
The Static Method to create a VacmAccessEntry.
Parameters:
contextPrefix - The contextPrefix with which the entry is to be created.
securityModel - The securityModel with which the entry is to be created(Default - USM (3)).
securityLevel - The securityLevel with which the entry is to be created.
contextMatch - The contextMatch with which the entry is to be created(can be either Included(1) or Excluded(2).
readView - The readView with which the entry is to be created.
writeView - The writeView with which the entry is to be created.
notifyView - The notifyView with which the entry is to be created.
storageType - The storageType for the Entry.
rowStatus - the RowStatus Integer for the Entry.
Returns:
The created VacmAccessEntry Object.
See Also:
createAndAddVacmAccessEntry.

serialize

public void serialize(java.io.ObjectOutputStream outMain)
This method Serializes the Output Stream.
Parameters:
outMain - The objet Output stream to be serialized.

getGroupAccessTableVector

public java.util.Vector getGroupAccessTableVector()
The method to return the Vector of VacmGroupAccessEntries present in the VacmGroupAccessTable.
Returns:
The Vector of VacmGroupAccessEntries.

getTableVector

public java.util.Vector getTableVector()
Deprecated. - This method has some limitations.Use getTableValues() The method to return the Vector of VacmAccessEntries present in the VacmGroupAccessControlTable.

Returns:
The Vector of VacmAccessEntries.

setTableVector

public void setTableVector(java.util.Vector vacmGroupVec)
Deprecated. - This method has some limitations.Use setTableValues() The method to set the Vector of VacmAccessEntries.

Parameters:
The - Vector of VacmAccessEntries.

getTableValues

public java.util.Hashtable getTableValues()
Using this method one can get the list of VacmAccessEntries in VacmAccessTable
Returns:
Hashtable having "vacmGroupName(String) - Vector of VacmAccessEntries corresponding to this vacmGroupName" pairs

setTableValues

public boolean setTableValues(java.util.Hashtable values)
This method can be used for providing the list of VacmAccessEntries to be added in VacmAccess Table
Parameters:
values - The hashtable having "vacmGroupName(String) - vector of vacmAccessEntries corresponding to this vacmGroupName" pairs
Returns:
true, if the vacmAccessEntries are added sucessfully, false otherwise