com.adventnet.snmp.snmp2.agent
Class SnmpV3Handler

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.SnmpV3Handler

 class SnmpV3Handler
extends java.lang.Object

This class acts as a delegate for the SnmpAgent's V3 functionality. Any functions related to V3 in the SnmpAgent will be delegated to the instance of SnmpV3Handler in the SnmpAgent.

See Also:
SnmpAgent

Field Summary
(package private)  SnmpAgent agent
           
(package private)  SnmpAPI api
           
(package private)  java.lang.String fileName
           
(package private)  SnmpV3 snmpV3
           
(package private)  UsmUserRequestHandler usmUserListener
           
(package private)  UsmUserTableRequestHandler usmUserTableListener
           
(package private)  SnmpVacm vacm
           
 
Constructor Summary
SnmpV3Handler(SnmpAgent agent, SnmpAPI api)
          Constructor that takes SnmpAgent instance and the API instance.
 
Method Summary
 void doV3Initialization()
          This method is responsible for initialising the V3 tables used by the agent.
 void doV3Initialization(java.lang.String dirStr, java.lang.String storageType, boolean communityAndTargetSupport)
          The method to initialize the V3 Settings with the storage type given.
 SnmpCommunityTableRequestHandler getSnmpCommunityTableListener()
          The method to get the SnmpCommunityTableListener.
 SnmpNotifyFilterProfileTableRequestHandler getSnmpNotifyFilterProfileTableListener()
          The method to get the SnmpNotifyFilterProfileTableListener.
 SnmpNotifyFilterTableRequestHandler getSnmpNotifyFilterTableListener()
          The method to get the SnmpNotifyFilterTableListener.
 SnmpNotifyTableRequestHandler getSnmpNotifyTableListener()
          The method to get the SnmpNotifyTableListener.
 SnmpTargetAddrExtTableRequestHandler getSnmpTargetAddrExtTableListener()
          The method to get the SnmpTargetAddrExtTableListener.
 SnmpTargetAddrTableRequestHandler getSnmpTargetAddrTableListener()
          The method to get the SnmpTargetAddrTableListener.
 SnmpTargetParamsTableRequestHandler getSnmpTargetParamsTableListener()
          The method to get the SnmpTargetParamsTableListener.
 SnmpVacm getSnmpVacm()
          Getter method for SnmpVacm
 UsmUserTableRequestHandler getUsmUserTableListener()
          The method to get the UsmUserTableListener.
 VacmAccessTableRequestHandler getVacmAccessTableListener()
          The method to get the VacmAccessTableListener.
 VacmContextTableRequestHandler getVacmContextTableListener()
          The method to get the VacmContextTableListener.
 VacmSecurityToGroupTableRequestHandler getVacmSecurityToGroupTableListener()
          The method to get the VacmSecurityToGroupTableListener.
 VacmViewTreeFamilyTableRequestHandler getVacmViewTreeFamilyTableListener()
          The method to get the VacmViewTreeFamilyTableListener.
 void initialiseV3Settings()
          Deprecated. - As now all the Tables will be registered from the Generated Agent Main File itself. This method is responsible for initialising the V3 tables used by the agent. By default, the V3 tables are populated by reading the snmpv3.ser file in the agent directory. If the user wants to read from his own storage, it should be specified in the SnmpAgent through the V3Initialiser interface.
 void initializeAndRegisterForV3Compliance()
           
 boolean isSnmpV3Compliance()
          Getter for SNMP V3 Compliance.
 void serializeTable()
          This method is called to serailize the different v3 parameters to the serialzed file .
 void setAcmUsed(boolean value)
          Setter method for configuring whether VACM Check should be used by the SnmpAgent.
 void setSerializeFileName(java.lang.String fileName)
          Setter for the serailized file used for storing the V3parameters.
 void setSnmpV3Compliance(boolean snmpV3Compliance)
          Setter for SNMP V3 Compliance.
 void setSnmpVacm()
          Initialises the SnmpVacm used from the SnmpAPI.
(package private)  void unregisterUSMTable()
          This method unregisters the USM Table from the PDU RequestHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

api

SnmpAPI api

agent

SnmpAgent agent

vacm

SnmpVacm vacm

snmpV3

SnmpV3 snmpV3

fileName

java.lang.String fileName

usmUserListener

UsmUserRequestHandler usmUserListener

usmUserTableListener

UsmUserTableRequestHandler usmUserTableListener
Constructor Detail

SnmpV3Handler

public SnmpV3Handler(SnmpAgent agent,
                     SnmpAPI api)
Constructor that takes SnmpAgent instance and the API instance.

Parameters:
agent - SnmpAgent instance
api - Instance of SnmpAPI
Method Detail

setSnmpVacm

public void setSnmpVacm()
Initialises the SnmpVacm used from the SnmpAPI.

See Also:
SnmpVacm

getSnmpVacm

public SnmpVacm getSnmpVacm()
Getter method for SnmpVacm

Returns:
SnmpVacm used by the SnmpV3Handler

setAcmUsed

public void setAcmUsed(boolean value)
Setter method for configuring whether VACM Check should be used by the SnmpAgent.

Parameters:
value - true if VACM should be enabled false otherwise

setSerializeFileName

public void setSerializeFileName(java.lang.String fileName)
                          throws SnmpException
Setter for the serailized file used for storing the V3parameters.

Parameters:
fileName - name of the serialized file.
Throws:
SnmpException

serializeTable

public void serializeTable()
This method is called to serailize the different v3 parameters to the serialzed file . It is called from the different V3Table requestHandlers whenever a SnmpSet request comes .


initialiseV3Settings

public void initialiseV3Settings()
Deprecated. - As now all the Tables will be registered from the Generated Agent Main File itself. This method is responsible for initialising the V3 tables used by the agent. By default, the V3 tables are populated by reading the snmpv3.ser file in the agent directory. If the user wants to read from his own storage, it should be specified in the SnmpAgent through the V3Initialiser interface.

See Also:
V3Initialiser, in SnmpAgent

unregisterUSMTable

void unregisterUSMTable()
This method unregisters the USM Table from the PDU RequestHandler.


setSnmpV3Compliance

public void setSnmpV3Compliance(boolean snmpV3Compliance)
Setter for SNMP V3 Compliance.

Parameters:
snmpV3Compliance - The SNMP V3 compliance flag.
See Also:
isSnmpV3Compliance()

isSnmpV3Compliance

public boolean isSnmpV3Compliance()
Getter for SNMP V3 Compliance.

Returns:
The SNMP V3 compliance flag.
See Also:
setSnmpV3Compliance(boolean snmpV3Compliance)

initializeAndRegisterForV3Compliance

public void initializeAndRegisterForV3Compliance()

doV3Initialization

public void doV3Initialization()
This method is responsible for initialising the V3 tables used by the agent. By default, the V3 tables are populated by reading the snmpv3.ser file in the agent directory. If the user wants to read from his own storage, it should be specified in the SnmpAgent through the V3Initialiser interface.

See Also:
V3Initialiser, in SnmpAgent

doV3Initialization

public void doV3Initialization(java.lang.String dirStr,
                               java.lang.String storageType,
                               boolean communityAndTargetSupport)
The method to initialize the V3 Settings with the storage type given. Please note that calling this method will initialize the Handlers with the default file names as per the storagetype mentioned. Api Users need not call this met hod.

Parameters:
dirStr - The location where the files exists.
storageType - The storage type String for the V3Tables.
communityAndTargetSupport - The Community, Target and Notificaiton support.

getUsmUserTableListener

public UsmUserTableRequestHandler getUsmUserTableListener()
The method to get the UsmUserTableListener.

Returns:
the UsmUserTableRequestHandler reference of this Agent's SnmpAPI.

getVacmAccessTableListener

public VacmAccessTableRequestHandler getVacmAccessTableListener()
The method to get the VacmAccessTableListener.

Returns:
the VacmAccessTableRequestHandler reference of this Agent's SnmpAPI.

getVacmContextTableListener

public VacmContextTableRequestHandler getVacmContextTableListener()
The method to get the VacmContextTableListener.

Returns:
the VacmContextTableRequestHandler reference of this Agent's SnmpAPI.

getVacmSecurityToGroupTableListener

public VacmSecurityToGroupTableRequestHandler getVacmSecurityToGroupTableListener()
The method to get the VacmSecurityToGroupTableListener.

Returns:
the VacmSecurityToGroupTableRequestHandler reference of this Agent's SnmpAPI.

getVacmViewTreeFamilyTableListener

public VacmViewTreeFamilyTableRequestHandler getVacmViewTreeFamilyTableListener()
The method to get the VacmViewTreeFamilyTableListener.

Returns:
the VacmViewTreeFamilyTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpCommunityTableListener

public SnmpCommunityTableRequestHandler getSnmpCommunityTableListener()
The method to get the SnmpCommunityTableListener.

Returns:
the SnmpCommunityTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetAddrTableListener

public SnmpTargetAddrTableRequestHandler getSnmpTargetAddrTableListener()
The method to get the SnmpTargetAddrTableListener.

Returns:
the SnmpTargetAddrTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetAddrExtTableListener

public SnmpTargetAddrExtTableRequestHandler getSnmpTargetAddrExtTableListener()
The method to get the SnmpTargetAddrExtTableListener.

Returns:
the SnmpTargetAddrExtTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpTargetParamsTableListener

public SnmpTargetParamsTableRequestHandler getSnmpTargetParamsTableListener()
The method to get the SnmpTargetParamsTableListener.

Returns:
the SnmpTargetParamsTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyTableListener

public SnmpNotifyTableRequestHandler getSnmpNotifyTableListener()
The method to get the SnmpNotifyTableListener.

Returns:
the SnmpNotifyTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyFilterTableListener

public SnmpNotifyFilterTableRequestHandler getSnmpNotifyFilterTableListener()
The method to get the SnmpNotifyFilterTableListener.

Returns:
the SnmpNotifyFilterTableRequestHandler reference of this Agent's SnmpAPI.

getSnmpNotifyFilterProfileTableListener

public SnmpNotifyFilterProfileTableRequestHandler getSnmpNotifyFilterProfileTableListener()
The method to get the SnmpNotifyFilterProfileTableListener.

Returns:
the SnmpNotifyFilterProfileTableRequestHandler reference of this Agent's SnmpAPI.