|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.agent.SimpleRequestHandler
com.adventnet.utils.agent.DynamicRegistrationWithCommunity
public class DynamicRegistrationWithCommunity
Dynamically registers with SnmpAgent for requests
You could attach this under any table defined in your enterprise MIB
Use the table entry to do a setRegisteredOid (int [])
The subids (columnar leafNodes under the table )are:
Currently this class implements all the six states for row status textual convention.
| Field Summary | |
|---|---|
(package private) java.util.Vector |
addVector
|
(package private) RegistrationListener |
agent
|
(package private) UpdateListener |
listener
|
(package private) java.lang.String |
managerHost
|
(package private) static int |
PROXYCONTEXTCOMMUNITY
|
(package private) static int |
PROXYCONTEXTHOST
|
(package private) static int |
PROXYCONTEXTNAME
|
(package private) static int |
PROXYCONTEXTOID
|
(package private) static int |
PROXYCONTEXTPORTNUMBER
|
(package private) static int |
PROXYCONTEXTRETRIES
|
(package private) static int |
PROXYCONTEXTROWSTATUS
|
(package private) static int |
PROXYCONTEXTTIMEOUT
|
(package private) static int |
PROXYCONTEXTVERSION
|
(package private) java.util.Hashtable |
proxyTable
|
(package private) AgentTableModel |
tModelComplete
|
(package private) int |
trapPort
|
(package private) int |
trapVersion
|
| Fields inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler |
|---|
instrumentHandler, tableListener |
| Constructor Summary | |
|---|---|
DynamicRegistrationWithCommunity(SnmpAgent agentRef)
The default constructor for the Class with Agent Reference. |
|
DynamicRegistrationWithCommunity(SnmpAgent agentRef,
boolean persistence)
The secondary constructor with persistence flag |
|
DynamicRegistrationWithCommunity(SnmpAgent agentRef,
java.lang.String dirStr,
java.lang.String fileStr,
boolean fToVPersistence)
The seccondary constructor for the Class with Agent Reference and persistence format. |
|
| Method Summary | |
|---|---|
void |
addRegistrationListener(RegistrationListener l)
Deprecated. - use the other method. Add RegistrationListener(agent) to the Listener table. Registration Listener methods |
void |
addRegistrationListener(RegistrationListener l,
boolean remoteAccess)
Add RegistrationListener (agent) to the Listener table. |
void |
addUpdateListener(UpdateListener l)
Setter for UpdateListener. |
(package private) boolean |
checkForRowStatus(DynamicRegistrationEntry entry)
|
void |
checkSubAgentHeartBeat(boolean b,
java.lang.Long pollingInterval,
java.lang.Integer timeOut,
java.lang.Integer retries,
SnmpAgent agentRef)
This method is to enable Polling the SubAgent to see whether its alive. |
static DynamicRegistrationEntry |
createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String proxyName,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer agentVersion,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries)
This is static method for creating a DynamicRegistrationEntry with RowStatus value as Active(1). |
static DynamicRegistrationEntry |
createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String proxyName,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer agentVersion,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries,
java.lang.Integer status)
This is static method for creating a DynamicRegistrationEntry. |
static DynamicRegistrationEntry |
createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String agentHost,
java.lang.String community,
long timeOut,
int agentPort)
Deprecated. - Make use of the new method with the additional argumnets. This is static method for creating a DynamicRegistrationEntry. |
java.util.Vector |
getExtraVarBind()
Getter for the Vector of Additional VarBinds sent along with the SubAgent LinkUp or LinkDown Traps. |
java.lang.String |
getFileName()
Getter for file name. |
java.lang.String |
getLinkDownOid()
Getter for the LinkDownOid sent with the LinkUp Traps. |
java.lang.String |
getLinkUpOid()
Getter for the LinkUpOid sent with the LinkUp Traps. |
java.lang.String |
getRegisteredOid()
Getter for registered oid. |
protected int[] |
getSubidList()
This is the subid List which is registered with the source of SnmpPduRequestEvents. |
java.util.Vector |
getTableVector()
Getter of table elements |
boolean |
isPersistence()
Getter of the persistence flag. |
protected void |
processGetNextRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the GetNextRequest message from the manager for the contextBasedProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the GetRequest message from the manager for the contextBasedProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
int req,
VarBindRequestEvent pe,
DynamicRegistrationEntry entry)
Processes the GetRequest message from the manager for the contextBasedProxyTable. |
protected void |
processSetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the SetRequest message from the manager for the contextBasedProxyTable. |
void |
removeRegistrationListener(RegistrationListener l)
Removes RegistrationListener(agent) from Listener Table. |
void |
removeUpdateListener()
Sets UpdateListener to null. |
void |
setExtraVarBind(java.util.Vector addVector)
Method to set Additional VarBinds to be sent along with the SubAgent LinkUp or LinkDown Traps. |
void |
setFileName(java.lang.String fileName)
Setter of file name. |
void |
setFToVPersistence(boolean fToVPersistence)
Setter for the FToV Persistence flag. |
void |
setLinkDownOid(java.lang.String linkDownOid)
Setter for the LinkDownTrap OID. |
void |
setLinkUpOid(java.lang.String linkUpOid)
Setter for the LinkUpTrap OID. |
void |
setManagerHost(java.lang.String managerHost)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable. |
void |
setPersistence(boolean persistence)
Setter of the persistence flag. |
void |
setRegisteredOid(java.lang.String oid)
Setter for registered oid. |
void |
setTableVector(java.util.Vector tableVector)
Setter of Table Elements. |
void |
setTrapPort(int trapPort)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable. |
void |
setTrapVersion(int trapVersion)
Deprecated. The method is no Longer used. The Traps will be sent to the Entries in the ForwardingTable. |
| Methods inherited from class com.adventnet.snmp.snmp2.agent.SimpleRequestHandler |
|---|
addInstrumentHandler, addTableListener, getInstrument, getMibVarHash, getNextRequest, getNextRequest, getObjectHash, getObjectTypeHash, getOidRep, getRequest, getTableListener, getUpdateListener, isWriteEachTime, processGetNextRequest, processGetRequest, processSetRequest, setRequest, setWriteEachTime, writeIntoFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int PROXYCONTEXTOID
static final int PROXYCONTEXTNAME
static final int PROXYCONTEXTHOST
static final int PROXYCONTEXTPORTNUMBER
static final int PROXYCONTEXTVERSION
static final int PROXYCONTEXTCOMMUNITY
static final int PROXYCONTEXTTIMEOUT
static final int PROXYCONTEXTRETRIES
static final int PROXYCONTEXTROWSTATUS
java.util.Hashtable proxyTable
AgentTableModel tModelComplete
int trapPort
java.lang.String managerHost
int trapVersion
java.util.Vector addVector
UpdateListener listener
RegistrationListener agent
| Constructor Detail |
|---|
public DynamicRegistrationWithCommunity(SnmpAgent agentRef)
agentRef - The agent Name reference to update the community
with every addition of SubAgent entry.
public DynamicRegistrationWithCommunity(SnmpAgent agentRef,
java.lang.String dirStr,
java.lang.String fileStr,
boolean fToVPersistence)
agentRef - The agent Name reference to update the community
with every addition of SubAgent entry.dirStr - The directory Name for the persistent file.fileStr - The file Name for the persistent file.fToVPersistence - The FToV Persistence flag for type of persistence(FToV or XML).
public DynamicRegistrationWithCommunity(SnmpAgent agentRef,
boolean persistence)
agentRef - The agent Name reference to update the community
with every addition of SubAgent entry.persistence - The persistnce flag for the persistence of the Table Values
in the FileSystem.| Method Detail |
|---|
public void setRegisteredOid(java.lang.String oid)
oid - The String representation of OID of the Entry Node of the Table
which is used as the contextBasedProxyTable(default value is
".1.3.6.1.4.1.2162.10.3.1.2.3.3.1" Entry Node OID of contextBasedProxyTable in
AGENT-SNMP-CONFIG-MIB).getRegisteredOid()public java.lang.String getRegisteredOid()
setRegisteredOid(String oid)public void setTableVector(java.util.Vector tableVector)
tableVector - specifies the tableVector with all the row entries
(DynamicRegistrationEntry objects of contextBasedProxyTable).getTableVector()public java.util.Vector getTableVector()
setTableVector(Vector tableVector)public void setExtraVarBind(java.util.Vector addVector)
addVector - the Vector of additional VarBinds.public java.util.Vector getExtraVarBind()
public void setTrapPort(int trapPort)
public void setManagerHost(java.lang.String managerHost)
public void setTrapVersion(int trapVersion)
public void setLinkUpOid(java.lang.String linkUpOid)
The - LinkUpOid to be sent with the Traps.public java.lang.String getLinkUpOid()
public void setLinkDownOid(java.lang.String linkDownOid)
The - LinkDown Oid to be sent with the Traps.public java.lang.String getLinkDownOid()
public void checkSubAgentHeartBeat(boolean b,
java.lang.Long pollingInterval,
java.lang.Integer timeOut,
java.lang.Integer retries,
SnmpAgent agentRef)
b - true to enable polling.pollingInterval - The TimeInterval between consecutive polls.timeOut - The TimeOut value for which this Poller should wait
to getback the Response from the SubAgnet.retries - the Retries value to specify the number of polls to
get back the response.agentRef - the SnmpAgent reference.public void setFileName(java.lang.String fileName)
fileName - specifies the fileName of the file in which all the registration entries
are stored with the directory structure(similar to "conf"+File.separator+
"ProxyTable.xml").getFileName()public java.lang.String getFileName()
setFileName(String fileName)protected int[] getSubidList()
getSubidList in class SimpleRequestHandler
protected void processGetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
throws AgentSnmpException
processGetRequest in class SimpleRequestHandlervarb - specifies the VarBind.node - The node for which the Get Request is given.pe - The VarBindRequestEvent created for the Get Request.
AgentSnmpException - This Wraps all the Exceptions thrown while
processing this Event.
protected void processGetRequest(SnmpVarBind varb,
int req,
VarBindRequestEvent pe,
DynamicRegistrationEntry entry)
throws AgentSnmpException
varb - specifies the VarBind.req - specifies the subId for which the request is processed.pe - The VarBindRequestEvent created for the Get Request.entry - The entry in which the Get Request is processed.
AgentSnmpException - This Wraps all the Exceptions thrown while
processing this Event.
protected void processSetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
throws AgentSnmpException
processSetRequest in class SimpleRequestHandlervarb - specifies the VarBind.node - The node for which the Set Request is given.pe - The VarBindRequestEvent created for the Set Request.
AgentSnmpException - This Wraps all the Exceptions thrown while
processing this Event.
protected void processGetNextRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
throws AgentSnmpException
processGetNextRequest in class SimpleRequestHandlervarb - specifies the VarBind.node - The node for which the Get Next Request is given.pe - The VarBindRequestEvent created for the Get Next Request.
AgentSnmpException - This Wraps all the Exceptions thrown while
processing this Event.
boolean checkForRowStatus(DynamicRegistrationEntry entry)
throws AgentSnmpException
AgentSnmpExceptionpublic void addUpdateListener(UpdateListener l)
addUpdateListener in class SimpleRequestHandlerl - specifies the UpdateListener which updates the fileSystem.removeUpdateListener()public void removeUpdateListener()
removeUpdateListener in class SimpleRequestHandleraddUpdateListener(UpdateListener l)public void addRegistrationListener(RegistrationListener l)
SimpleRequestHandler
addRegistrationListener in class SimpleRequestHandlerl - specfies the RegistrationListener which processes the Requests from the manager.removeRegistrationListener(RegistrationListener l)
public void addRegistrationListener(RegistrationListener l,
boolean remoteAccess)
l - specfies the RegistrationListener which processes the Requests from the manager.remoteAccess - specifies whether this proxyTable is to be remotely Accessible or not.removeRegistrationListener(RegistrationListener l)public void removeRegistrationListener(RegistrationListener l)
removeRegistrationListener in class SimpleRequestHandlerl - The Registration Listener which handles the Requests from the manager.addRegistratioListener(RegistrationListener l, boolean remoteAccess)
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String proxyName,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer agentVersion,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries)
proxyingOID - specifies the actual proxying OID in the subAgent.proxyName - specifies the context for which the subAgent is to be contacted.agentHost - specifies the Host in which the subAgent is running(it may be in
IpAddress or the Host name format).agentPort - specifies the Port at which the subAgent is running.agentPort - specifies the Version with which the subAgent is to be proxied.community - specifies the community parameter for the request to subAgent.timeOut - specifies the timeOut parameter for the request to subAgent.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String proxyName,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer agentVersion,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries,
java.lang.Integer status)
proxyingOID - specifies the actual proxying OID in the subAgent.proxyName - specifies the context for which the subAgent is to be contacted.agentHost - specifies the Host in which the subAgent is running(it may be in
IpAddress or the Host name format).agentPort - specifies the Port at which the subAgent is running.agentPort - specifies the Version with which the subAgent is to be proxied.community - specifies the community parameter for the request to subAgent.timeOut - specifies the timeOut parameter for the request to subAgent.status - specifies the RowStatus value for this Entry (0 - 5).
public void setPersistence(boolean persistence)
persistence - The persistence flag for the persistence of the Table Values
to the fileSystem.public boolean isPersistence()
public void setFToVPersistence(boolean fToVPersistence)
fToVPersistence - The FToV Persistence flag for type of persistence.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String agentHost,
java.lang.String community,
long timeOut,
int agentPort)
proxyingOID - specifies the actual proxying OID in the subAgent.agentHost - specifies the Host in which the subAgent is running(it may be in
IpAddress or the Host name format).community - specifies the community of the proxied subAgent.timeOut - specifies the timeOut parameter for the request to subAgent.agentPort - specifies the Port at which the subAgent is running.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||