com.adventnet.snmp.snmp2.agent
Class SnmpTargetAddrTableRequestHandler

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

public class SnmpTargetAddrTableRequestHandler
extends SimpleRequestHandler

Handles all requests under snmpTargetAddrTable group


Field Summary
(package private)  SnmpAgent agentName
           
(package private)  SnmpAPI api
           
(package private) static int COLUMNCOUNT
           
(package private)  java.lang.String fileDir
           
(package private)  java.lang.String format
           
(package private)  java.util.Vector snmpTargetAddrEntryVector
           
(package private) static int SNMPTARGETADDRNAME
           
(package private) static int SNMPTARGETADDRPARAMS
           
(package private) static int SNMPTARGETADDRRETRYCOUNT
           
(package private) static int SNMPTARGETADDRROWSTATUS
           
(package private) static int SNMPTARGETADDRSTORAGETYPE
           
(package private) static int SNMPTARGETADDRTADDRESS
           
(package private) static int SNMPTARGETADDRTAGLIST
           
(package private) static int SNMPTARGETADDRTDOMAIN
           
(package private) static int SNMPTARGETADDRTIMEOUT
           
(package private)  SnmpTargetAddrTable targetAddrTable
           
(package private)  SnmpTargetAddrTableXMLToVector xmlToVector
           
 
Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler
instrumentHandler, listener, tableListener, writeEachTime
 
Constructor Summary
SnmpTargetAddrTableRequestHandler(SnmpAgent agentRef)
          Default constructor that takes the SnmpAgent as the argument.
SnmpTargetAddrTableRequestHandler(SnmpAgent agentRef, java.lang.String dirStr, java.lang.String fileName, java.lang.String format)
          Secondary constructor with Persistence Support.
 
Method Summary
(package private)  boolean checkForRowStatus(SnmpTargetAddrEntry entry)
           
 boolean createAndAddSnmpTargetAddrEntry(java.lang.String targetAddrName, java.lang.String targetAddrTDomain, java.lang.String targetAddrTAddress, java.lang.Integer targetAddrTimeout, java.lang.Integer targetAddrRetryCount, java.lang.String targetAddrTagList, java.lang.String targetAddrParams, java.lang.Integer targetAddrStorageType, java.lang.Integer targetAddrRowStatus)
          The method to create and Add a new Entry to the TargetAddrTable.
 SnmpTargetAddrEntry createSnmpTargetAddrEntry(java.lang.String targetAddrName, java.lang.String targetAddrTDomain, java.lang.String targetAddrTAddress, java.lang.Integer targetAddrTimeout, java.lang.Integer targetAddrRetryCount, java.lang.String targetAddrTagList, java.lang.String targetAddrParams, java.lang.Integer targetAddrStorageType, java.lang.Integer targetAddrRowStatus)
          The method to create a new SnmpTargetAddrEntry.
 int[] getOidRep()
          Retrives the integer representation of OID
static int[] getSnmpTargetAddrTableOidRep()
          Gets the SnmpTargetAddrTable entry OID - int[] of {1,3,6,1,6,3,12,1,2,1}
protected  int[] getSubidList()
          Gets the subid list of the oid.
 java.util.Vector getTableVector()
          The method to get the Vector of SnmpTargetAddrEntries present in the SnmpTargetAddrTable.
 byte[] getTargetAddrTAddress(java.lang.String targetHost, java.lang.String targetPort1)
           
protected  void processGetNextRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Handles all the GetNext Request.
protected  void processGetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Handles all the Get requests.
protected  void processGetRequest(SnmpVarBind varb, int req, VarBindRequestEvent pe, SnmpTargetAddrEntry entry, byte[] targetAddrName)
           
protected  void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe)
          Handles all the Snmp Set Requests.
 void serialize(java.io.ObjectOutputStream outMain)
          Method to serialize the targetAddrTable entries.
 void setTableVector(java.util.Vector targetAddrVec)
          The method to set the Vector of SnmpTargetAddrEntries.
 
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

SNMPTARGETADDRNAME

static final int SNMPTARGETADDRNAME

SNMPTARGETADDRTDOMAIN

static final int SNMPTARGETADDRTDOMAIN

SNMPTARGETADDRTADDRESS

static final int SNMPTARGETADDRTADDRESS

SNMPTARGETADDRTIMEOUT

static final int SNMPTARGETADDRTIMEOUT

SNMPTARGETADDRRETRYCOUNT

static final int SNMPTARGETADDRRETRYCOUNT

SNMPTARGETADDRTAGLIST

static final int SNMPTARGETADDRTAGLIST

SNMPTARGETADDRPARAMS

static final int SNMPTARGETADDRPARAMS

SNMPTARGETADDRSTORAGETYPE

static final int SNMPTARGETADDRSTORAGETYPE

SNMPTARGETADDRROWSTATUS

static final int SNMPTARGETADDRROWSTATUS

COLUMNCOUNT

static final int COLUMNCOUNT

agentName

SnmpAgent agentName

api

SnmpAPI api

targetAddrTable

SnmpTargetAddrTable targetAddrTable

snmpTargetAddrEntryVector

java.util.Vector snmpTargetAddrEntryVector

xmlToVector

SnmpTargetAddrTableXMLToVector xmlToVector

format

java.lang.String format

fileDir

java.lang.String fileDir
Constructor Detail

SnmpTargetAddrTableRequestHandler

public SnmpTargetAddrTableRequestHandler(SnmpAgent agentRef)
Default constructor that takes the SnmpAgent as the argument.
Parameters:
agentRef - instance of the SnmpAgent.

SnmpTargetAddrTableRequestHandler

public SnmpTargetAddrTableRequestHandler(SnmpAgent agentRef,
                                         java.lang.String dirStr,
                                         java.lang.String fileName,
                                         java.lang.String format)
Secondary constructor with Persistence Support.
Parameters:
agentRef - instance of the SnmpAgent.
fileName - the fileName String.
format - the Format of Storage.("xml")
Method Detail

getSnmpTargetAddrTableOidRep

public static int[] getSnmpTargetAddrTableOidRep()
Gets the SnmpTargetAddrTable entry OID - int[] of {1,3,6,1,6,3,12,1,2,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
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
Handles all the Get requests.
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,
                                 SnmpTargetAddrEntry entry,
                                 byte[] targetAddrName)
                          throws AgentSnmpException

processSetRequest

protected void processSetRequest(SnmpVarBind varb,
                                 AgentNode node,
                                 VarBindRequestEvent pe)
                          throws AgentSnmpException
Handles all the Snmp Set Requests.
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
Handles all the GetNext Request.
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(SnmpTargetAddrEntry entry)
                    throws AgentException

createAndAddSnmpTargetAddrEntry

public boolean createAndAddSnmpTargetAddrEntry(java.lang.String targetAddrName,
                                               java.lang.String targetAddrTDomain,
                                               java.lang.String targetAddrTAddress,
                                               java.lang.Integer targetAddrTimeout,
                                               java.lang.Integer targetAddrRetryCount,
                                               java.lang.String targetAddrTagList,
                                               java.lang.String targetAddrParams,
                                               java.lang.Integer targetAddrStorageType,
                                               java.lang.Integer targetAddrRowStatus)
The method to create and Add a new Entry to the TargetAddrTable.
Parameters:
targetAddrName - The targetAddrName with which the entry is to be created.
targetAddrTDomain - The targetAddrTDomain with which the entry is to be created.
targetAddrTAddress - The targetAddrTAddress with which the entry is to be created.
targetAddrTimeout - The targetAddrTimeout with which the entry is to be created.
targetAddrRetryCount - The targetAddrRetryCount with which the entry is to be created.
targetAddrTagList - The targetAddrTagList with which the entry is to be created.
targetAddrParams - The targetAddrParams with which the entry is to be created.
targetAddrStorageType - The storageType for the Entry.
targetAddrRowStatus - The RowStatus Integer for the Entry.
Returns:
boolean specifying whether the Entry is successfully added.
See Also:
createSnmpTargetAddrEntry.

createSnmpTargetAddrEntry

public SnmpTargetAddrEntry createSnmpTargetAddrEntry(java.lang.String targetAddrName,
                                                     java.lang.String targetAddrTDomain,
                                                     java.lang.String targetAddrTAddress,
                                                     java.lang.Integer targetAddrTimeout,
                                                     java.lang.Integer targetAddrRetryCount,
                                                     java.lang.String targetAddrTagList,
                                                     java.lang.String targetAddrParams,
                                                     java.lang.Integer targetAddrStorageType,
                                                     java.lang.Integer targetAddrRowStatus)
The method to create a new SnmpTargetAddrEntry.
Parameters:
targetAddrName - The targetAddrName with which the entry is to be created.
targetAddrTDomain - The targetAddrTDomain with which the entry is to be created.
targetAddrTAddress - The targetAddrTAddress with which the entry is to be created.
targetAddrTimeout - The targetAddrTimeout with which the entry is to be created.
targetAddrRetryCount - The targetAddrRetryCount with which the entry is to be created.
targetAddrTagList - The targetAddrTagList with which the entry is to be created.
targetAddrParams - The targetAddrParams with which the entry is to be created.
targetAddrStorageType - The storageType for the Entry.
targetAddrRowStatus - The RowStatus Integer for the Entry.
Returns:
SnmpTargetAddrEntry object created.
See Also:
createAndAddSnmpTargetAddrEntry.

setTableVector

public void setTableVector(java.util.Vector targetAddrVec)
The method to set the Vector of SnmpTargetAddrEntries.
Parameters:
targetAddeVec - The Vector of SnmpTargetAddrEntries.

getTableVector

public java.util.Vector getTableVector()
The method to get the Vector of SnmpTargetAddrEntries present in the SnmpTargetAddrTable.
Returns:
The Vector of SnmpTargetAddrEntries.

serialize

public void serialize(java.io.ObjectOutputStream outMain)
Method to serialize the targetAddrTable entries.
Parameters:
outMain - the ObjectOutputStream for serializing.

getTargetAddrTAddress

public byte[] getTargetAddrTAddress(java.lang.String targetHost,
                                    java.lang.String targetPort1)