com.adventnet.snmp.snmp2.agent
Class BaseAclTableRequestHandler

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
        |
        +--com.adventnet.snmp.snmp2.agent.BaseTableRequestHandler
              |
              +--com.adventnet.snmp.snmp2.agent.BaseAclTableRequestHandler
Direct Known Subclasses:
AclTableRequestHandler

public abstract class BaseAclTableRequestHandler
extends BaseTableRequestHandler

This is required if you want to give Remote Configuration Access for the aclTable. Handles all requests for aclTable(in AGENT-SNMP-CONFIG-MIB).

This class allows us to configure the aclTable at run-time by snmp-sets. Both AclTableRequestHandler and MicroAclTableRequestHandler extend this class and make use of the methods available in this class.

See Also:
AclTableRequestHandler, MicroAclTableRequestHandler

Field Summary
(package private) static int ACLACCESS
           
(package private) static int ACLCOMMUNITY
           
(package private) static int ACLMANAGERS
           
(package private) static int ACLSTATUS
           
 BaseAclTable aclTable
          The BaseAclTable associated with this Handler.
(package private) static int COLUMNCOUNT
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseTableRequestHandler
agentName, listenerList, tModelComplete
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
BaseAclTableRequestHandler()
           
BaseAclTableRequestHandler(BaseSnmpAgent agentRef, BaseAclTable table)
          The primary constructor to BaseAclTableRequestHandler This constructor gets the agent reference to which this community table should associate with and the BaseAclTable which needs remote configuration.
 
Method Summary
(package private)  boolean checkForRowStatus(AclEntryInterface entry)
           
static AclEntry createAclEntry(java.lang.String community, java.lang.Integer access, java.lang.String managers)
          Creates an AclEntry object for the Access Control values in the aclTable This method creates and makes the Row Active immediately
static AclEntry createAclEntry(java.lang.String community, java.lang.Integer access, java.lang.String managers, java.lang.Integer status)
          Creates an AclEntry object for the Access Control values in the aclTable
static AclEntry createAclEntry(java.lang.String community, int access, java.lang.String managers)
          Creates an AclEntry object for the Access Control values in the aclTable This method creates and makes the Row Active immediately
 AclEntryInterface getAclEntryInstance()
          Deprecated. this has been moved to the AclTable class. API users can override this method to have their own AclEntryInterface. This method will be called for all AclEntry instance creation.
static int[] getAclTableOidRep()
          Gets the AclTable entry OID by default {1,3,6,1,4,1,2162,10,3,1,2,1,1,1}
 int[] getOidRep()
          Gets the AclTable entry OID by default {1,3,6,1,4,1,2162,10,3,1,2,1,1,1}
 java.lang.String getRegisteredOid()
          Getter for the Registered OID.
protected  int[] getSubidList()
          Getter of the subIdList registered to the aclTable
protected  void processGetNextRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the GetNextRequest message from the manager for the aclTable.
protected  void processGetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the GetRequest message from the manager for the aclTable.
protected  void processGetRequest(SnmpVarBind varb, int req, VarBindRequestEvent pe, AclEntryInterface entry)
          Processes the GetRequest message from the manager for the aclTable.
protected  void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Processes the SetRequest message from the manager for the aclTable.
 void setOidRep(int[] aclTableOidRep)
          This method will be useful for the api users for setting their own acl table entry OID instead of AdventNet aclTable entry oid in AGENT-SNMP-CONFIG-MIB.
 void setRegisteredOid(java.lang.String oid)
          Setter to set the userBased Table's Entry OID as the registered OID instead of the AdventNet aclTable entry oid in AGENT-SNMP-CONFIG-MIB.
 void setTableVector(java.util.Vector tableVector)
          Setter for the Table Vector.
 
Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseTableRequestHandler
addChangeListener, createChangeEvent, fireChangeEvent, getTableVector, removeChangeListener
 
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

ACLCOMMUNITY

static final int ACLCOMMUNITY

ACLACCESS

static final int ACLACCESS

ACLMANAGERS

static final int ACLMANAGERS

ACLSTATUS

static final int ACLSTATUS

COLUMNCOUNT

static final int COLUMNCOUNT

aclTable

public BaseAclTable aclTable
The BaseAclTable associated with this Handler.
Constructor Detail

BaseAclTableRequestHandler

public BaseAclTableRequestHandler(BaseSnmpAgent agentRef,
                                  BaseAclTable table)
The primary constructor to BaseAclTableRequestHandler This constructor gets the agent reference to which this community table should associate with and the BaseAclTable which needs remote configuration.
Parameters:
agentRef - The BaseSnmpAgent Reference.
table - The BaseAclTable instance associated with the Agent.
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

BaseAclTableRequestHandler

public BaseAclTableRequestHandler()
Method Detail

getAclTableOidRep

public static int[] getAclTableOidRep()
Gets the AclTable entry OID by default {1,3,6,1,4,1,2162,10,3,1,2,1,1,1}
Returns:
The registered Table Entry OID as an int array

getOidRep

public int[] getOidRep()
Gets the AclTable entry OID by default {1,3,6,1,4,1,2162,10,3,1,2,1,1,1}
Overrides:
getOidRep in class SimpleRequestHandler
Returns:
The registered Table Entry OID as an int array

setOidRep

public void setOidRep(int[] aclTableOidRep)
This method will be useful for the api users for setting their own acl table entry OID instead of AdventNet aclTable entry oid in AGENT-SNMP-CONFIG-MIB. It expects the number of columns, its subids and its SYNTAX to remain same in the user defined table. This method will gain its purpose only when called before registering this class with the PduRequestHandler.
Parameters:
aclTableOidRep - intArray specifying the OID representation of the user's aclTable Entry OID

setRegisteredOid

public void setRegisteredOid(java.lang.String oid)
Setter to set the userBased Table's Entry OID as the registered OID instead of the AdventNet aclTable entry oid in AGENT-SNMP-CONFIG-MIB. This method will gain its purpose only when called before registering this class with the PduRequestHandler.
Parameters:
oid - The String OID representation of the user's Table Entry OID
See Also:
getRegisteredOid()

getRegisteredOid

public java.lang.String getRegisteredOid()
Getter for the Registered OID.
Returns:
The String representation of the registered aclTable Entry OID.
See Also:
setRegisteredOid(String oid)

getSubidList

protected int[] getSubidList()
Getter of the subIdList registered to the aclTable
Overrides:
getSubidList in class SimpleRequestHandler
Returns:
SubIdList of the aclTable

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Processes the GetRequest message from the manager for the aclTable.
Overrides:
processGetRequest in class SimpleRequestHandler
Parameters:
varb - specifies the SnmpVarBind to be processed.
node - The node for which the Get Request is given.
pe - The VarBindRequestEvent created for the Get Request.
Throws:
AgentSnmpException - on error while processing Get Request.

processGetRequest

protected void processGetRequest(SnmpVarBind varb,
                                 int req,
                                 VarBindRequestEvent pe,
                                 AclEntryInterface entry)
                          throws AgentSnmpException
Processes the GetRequest message from the manager for the aclTable.
Parameters:
varb - specifies the SnmpVarBind.
req - The column for which the Get Request is processed.
pe - The VarBindRequestEvent created for the Get Request.
entry - The row entry for which the Get Request is processed.
Throws:
AgentSnmpException - This Wraps all the Exceptions thrown while processing this event.

processSetRequest

protected void processSetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Processes the SetRequest message from the manager for the aclTable.
Overrides:
processSetRequest in class SimpleRequestHandler
Parameters:
varb - specifies the SnmpVarBind to be processed.
node - The node for which the Set Request is given.
pe - The VarBindRequestEvent created for the Set Request.
Throws:
AgentSnmpException - This Wraps all the Type of Exceptions thrown while processing this event.

processGetNextRequest

protected void processGetNextRequest(SnmpVarBind varb,
                                     AgentNode node,
                                     VarBindRequestEvent pe)
                              throws AgentSnmpException
Processes the GetNextRequest message from the manager for the aclTable.
Overrides:
processGetNextRequest in class SimpleRequestHandler
Parameters:
varb - specifies the SnmpVarBind.
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 While processing this event.

checkForRowStatus

boolean checkForRowStatus(AclEntryInterface entry)
                    throws AgentException

getAclEntryInstance

public AclEntryInterface getAclEntryInstance()
Deprecated. this has been moved to the AclTable class. API users can override this method to have their own AclEntryInterface. This method will be called for all AclEntry instance creation.

Returns:
The Acl Entry Instance Value.
Since:
AdventNet Agent Toolkit (Java\JMX Edition) 5.0

setTableVector

public void setTableVector(java.util.Vector tableVector)
Deprecated. use the method in the AclTable Setter for TableVector

Description copied from class: BaseTableRequestHandler
Setter for the Table Vector.
Overrides:
setTableVector in class BaseTableRequestHandler
Parameters:
tableVector - The TableVector of Entry objects
Since:
AdventNet Agent Toolkit (Java/JMX Edition) 5.0

createAclEntry

public static AclEntry createAclEntry(java.lang.String community,
                                      int access,
                                      java.lang.String managers)
Creates an AclEntry object for the Access Control values in the aclTable This method creates and makes the Row Active immediately
Parameters:
community - specifies the name of the community with access control
access - specifies the access allowed for this community
managers - specifies the managers list such as "hostName1;202.202.202.202;hostName2"
Returns:
AclEntry Object

createAclEntry

public static AclEntry createAclEntry(java.lang.String community,
                                      java.lang.Integer access,
                                      java.lang.String managers)
Creates an AclEntry object for the Access Control values in the aclTable This method creates and makes the Row Active immediately
Parameters:
community - specifies the name of the community with access control
access - specifies the access allowed for this community
managers - specifies the managers list such as "hostName1;202.202.202.202;hostName2"
Returns:
AclEntry Object

createAclEntry

public static AclEntry createAclEntry(java.lang.String community,
                                      java.lang.Integer access,
                                      java.lang.String managers,
                                      java.lang.Integer status)
Creates an AclEntry object for the Access Control values in the aclTable
Parameters:
community - specifies the name of the community with access control
access - specifies the access allowed for this community
managers - specifies the managers list such as "hostName1;202.202.202.202;hostName2"
status - the RowStatus value (1 - 5)with which this Row has to be created
Returns:
AclEntry Object