|
|||||||||
| 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.DynamicRegistrationWithInstance
public class DynamicRegistrationWithInstance
DynamicRegistrationWithInstance helps in dynamically registring subtrees by remote sub agents
Uses SNMP for registration and forwarding the requests
The subids (columnar leafNodes under the table )are:
To use this table without agentEntryInstance value, For example : to proxy to a subagent s1 for .1.3.6.1.2.1.1(system group of rfc1213-mib), the entryInstance should be set to ".0.0" so that entryInstance column is not considered for proxying. This enables to use the instanceBasedProxyTable(row based proxy table) as a normal proxy table.
| Field Summary | |
|---|---|
(package private) java.util.Vector |
addVector
|
(package private) RegistrationListener |
agent
|
(package private) static java.lang.String |
DEFAULTINSTANCE
|
static java.lang.String |
fieldSeparator
The fieldSeparator of the file to Vector persistent files |
(package private) DynamicWithInstanceXMLToVector |
fileToVector
|
(package private) UpdateListener |
listener
|
(package private) java.lang.String |
managerHost
|
(package private) static int |
PROXYENTRYINSTANCE
|
(package private) static int |
PROXYENTRYOID
|
(package private) static int |
PROXYINSCOMMUNITY
|
(package private) static int |
PROXYINSHOST
|
(package private) static int |
PROXYINSPORTNUMBER
|
(package private) static int |
PROXYINSRETRIES
|
(package private) static int |
PROXYINSROWSTATUS
|
(package private) static int |
PROXYINSTIMEOUT
|
(package private) static int |
PROXYINSVERSION
|
(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 | |
|---|---|
DynamicRegistrationWithInstance()
The default constructor for the Class |
|
DynamicRegistrationWithInstance(boolean persistence)
The secondary constructor of the class with the persistence flag. |
|
DynamicRegistrationWithInstance(boolean fToVPersistence,
java.lang.String dirStr,
java.lang.String fileStr)
The secondary constructor of the class with the persistence format flag FToV/XML 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 entryInstance,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer version,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries)
This is static method for creating a DynamicRegistrationEntry with the RowStatus value as Active(1). |
static DynamicRegistrationEntry |
createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String entryInstance,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer version,
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 entryInstance,
java.lang.String proxyingOID,
java.lang.String agentHost,
java.lang.String community,
long timeOut,
int agentPort)
Deprecated. - make use of the other method with additional parameters. 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 |
getFieldSeparator()
Getter for FieldSeparator |
java.lang.String |
getFileName()
Getter for the fileName. |
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. |
SnmpProxy |
getProxyCommand(java.lang.String oid)
Getter for the Proxy command related to the oid registration specified. |
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 for 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 instanceBasedProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the GetRequest message from the manager for the instanceBasedProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
int req,
VarBindRequestEvent pe,
DynamicRegistrationEntry entry)
Processes the GetRequest message from the manager for the instanceBasedProxyTable. |
protected void |
processSetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the SetRequest message from the manager for the instanceBasedProxyTable. |
void |
registerSubAgent(DynamicSnmpProxy proxy,
SnmpVar var,
DynamicRegistrationEntry entry)
|
void |
removeRegistrationListener(RegistrationListener l)
Removes RegistrationListener(agent) from Listener Table. |
void |
removeSubAgent(DynamicRegistrationEntry ent)
Deprecated. Use the other method. |
void |
removeSubAgent(DynamicRegistrationEntry ent,
boolean isDestroy)
This method is to remove the SubAgent Registration. |
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 |
setFieldSeparator(java.lang.String separator)
Setter for FieldSeparator |
void |
setFileName(java.lang.String fileName)
Setter for 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)
sets 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 |
|---|
DynamicWithInstanceXMLToVector fileToVector
public static java.lang.String fieldSeparator
static final int PROXYENTRYOID
static final int PROXYENTRYINSTANCE
static final int PROXYINSHOST
static final int PROXYINSPORTNUMBER
static final int PROXYINSVERSION
static final int PROXYINSCOMMUNITY
static final int PROXYINSTIMEOUT
static final int PROXYINSRETRIES
static final int PROXYINSROWSTATUS
java.util.Hashtable proxyTable
static java.lang.String DEFAULTINSTANCE
AgentTableModel tModelComplete
int trapPort
java.lang.String managerHost
int trapVersion
java.util.Vector addVector
UpdateListener listener
RegistrationListener agent
| Constructor Detail |
|---|
public DynamicRegistrationWithInstance()
public DynamicRegistrationWithInstance(boolean persistence)
persistence - The persistence flag for the persistence to the fileSystem.
public DynamicRegistrationWithInstance(boolean fToVPersistence,
java.lang.String dirStr,
java.lang.String fileStr)
fToVPersistence - The fToVPersistence flag for the type of persistence to the
fileSystem FToV/XML.dirStr - The directory name for persistence.fileStr - The file name of the file in file system.| Method Detail |
|---|
public void setRegisteredOid(java.lang.String oid)
oid - specifies the Entry OID of the Table which is used as the
instancebasedProxyTable(similar to ".1.3.6.1.4.1.2162.10.3.1.2.3.4.1").getRegisteredOid()public java.lang.String getRegisteredOid()
setRegisteredOid(String oid)public void setTableVector(java.util.Vector tableVector)
tableVector - specifies the Vector of Row Entries(DynamicRegistrationEntry
objects of the instanceBasedProxyTable).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 - LinkUpOid 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 for the persistent fileSystem 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
protected void processGetRequest(SnmpVarBind varb,
int req,
VarBindRequestEvent pe,
DynamicRegistrationEntry entry)
throws AgentSnmpException
varb - specifies the VarBind.req - specifies the subId for which the Get request is processed.pe - The VarBindRequestEvent created for the Get Request.entry - specifies the table entry for which the Get Request is processed
AgentSnmpException
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
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
boolean checkForRowStatus(DynamicRegistrationEntry entry)
throws AgentSnmpException
AgentSnmpExceptionpublic void addUpdateListener(UpdateListener l)
addUpdateListener in class SimpleRequestHandlerl - The update listener for updating the file system.removeUpdateListener()public void removeUpdateListener()
removeUpdateListener in class SimpleRequestHandleraddUpdateListener(UpdateListener l)public void addRegistrationListener(RegistrationListener l)
SimpleRequestHandler
addRegistrationListener in class SimpleRequestHandlerl - The Registration Listener to listen for Requests from the manager.removeRegistrationListener(RegistrationListener l)
public void addRegistrationListener(RegistrationListener l,
boolean remoteAccess)
l - The Registration Listener to listen for 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 for an OID.addRegistrationListener(RegistrationListener l, boolean remoteAccess)
public void registerSubAgent(DynamicSnmpProxy proxy,
SnmpVar var,
DynamicRegistrationEntry entry)
public void removeSubAgent(DynamicRegistrationEntry ent)
public void removeSubAgent(DynamicRegistrationEntry ent,
boolean isDestroy)
ent - the DynamicRegistrationEntry for UnRegistration.isDestroy - boolean to sepcify the removal of the entry.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String entryInstance,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer version,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries)
proxyingOID - specifies the actual proxying OID in the subAgent.entryInstance - specifies the entry instance which is to be proxied.agentHost - specifies the Host in which the subAgent is running(it may be in
IpAddress or the Host name format).community - specifies the Version of the proxied subAgent.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.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
java.lang.String entryInstance,
java.lang.String agentHost,
java.lang.Integer agentPort,
java.lang.Integer version,
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.entryInstance - specifies the entry instance which is to be proxied.agentHost - specifies the Host in which the subAgent is running(it may be in
IpAddress or the Host name format).community - specifies the Version of the proxied subAgent.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.status - specifies the RowStatus value for this entry (1 - 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.public java.lang.String getFieldSeparator()
public void setFieldSeparator(java.lang.String separator)
fieldSeparator - The fieldSeparator valuepublic SnmpProxy getProxyCommand(java.lang.String oid)
oid - The OID registered as the SubAgent.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String entryInstance,
java.lang.String proxyingOID,
java.lang.String agentHost,
java.lang.String community,
long timeOut,
int agentPort)
entryInstance - specifies the entry instance which is to be proxied.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 | ||||||||