|
|||||||||
| 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.DynamicRegistration
public class DynamicRegistration
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 [])
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) static java.lang.String |
className
|
(package private) DynamicXMLToVector |
fileToVector
|
(package private) UpdateListener |
listener
|
(package private) java.lang.String |
managerHost
|
(package private) static int |
PROXYCOMMUNITY
|
(package private) static int |
PROXYHOST
|
(package private) static int |
PROXYOID
|
(package private) static int |
PROXYPORTNUMBER
|
(package private) static int |
PROXYRETRIES
|
(package private) static int |
PROXYROWSTATUS
|
(package private) static int |
PROXYTIMEOUT
|
(package private) static int |
PROXYVERSION
|
(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 | |
|---|---|
DynamicRegistration()
The default constructor for the Class |
|
DynamicRegistration(boolean persistence)
The primary constructor for the Class with the persistence flag. |
|
DynamicRegistration(boolean fToVPersistence,
java.lang.String dirStr,
java.lang.String fileName)
The secondary constructor for the Class for specifying the persistence format XML/FToV. |
|
DynamicRegistration(java.lang.String className,
boolean persistence)
This constructor is used to specify the SnmpProxy class used by the DynamicRegistration for Proxying. |
|
| 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 agentHost,
java.lang.Integer agentPort,
java.lang.Integer version,
java.lang.String community,
java.lang.Long timeOut,
java.lang.Long retries)
The static method for creating a DynamicRegistrationEntry with RowStatus value as Active(1). |
static DynamicRegistrationEntry |
createDynamicRegistrationEntry(java.lang.String proxyingOID,
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)
The 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. use 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 |
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. |
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 the Table Vector. |
boolean |
isPersistence()
Getter of the persistence flag of the persistence to the fileSystem. |
protected void |
processGetNextRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the GetNextRequest message from the manager for the aProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the GetRequest message from the manager for the aProxyTable. |
protected void |
processGetRequest(SnmpVarBind varb,
int req,
VarBindRequestEvent pe,
DynamicRegistrationEntry entry)
Processes the GetRequest message from the manager for the aProxyTable. |
protected void |
processSetRequest(SnmpVarBind varb,
AgentNode node,
VarBindRequestEvent pe)
Processes the SetRequest message from the manager for the aProxyTable. |
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 for file name. |
void |
setFToVPersistence(boolean fToVPersistence)
Setter for 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 for the persistence of the Table Values to fileSystem. |
void |
setRegisteredOid(java.lang.String oid)
Setter for registered oid. |
void |
setTableVector(java.util.Vector tableVector)
Setter for 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 java.lang.String className
DynamicXMLToVector fileToVector
static final int PROXYOID
static final int PROXYHOST
static final int PROXYPORTNUMBER
static final int PROXYVERSION
static final int PROXYCOMMUNITY
static final int PROXYTIMEOUT
static final int PROXYRETRIES
static final int PROXYROWSTATUS
AgentTableModel tModelComplete
int trapPort
java.lang.String managerHost
int trapVersion
java.util.Vector addVector
UpdateListener listener
RegistrationListener agent
| Constructor Detail |
|---|
public DynamicRegistration()
public DynamicRegistration(boolean persistence)
persistence - The persistence flag for the persistence of the Table values
in fileSystem.
public DynamicRegistration(boolean fToVPersistence,
java.lang.String dirStr,
java.lang.String fileName)
fToVPersistence - The fToVPersistence flag for the persistence of the Table values
in fileSystem as an FToV file.dirStr - The directory of persistence.fileName - The fileName of persistence.
public DynamicRegistration(java.lang.String className,
boolean persistence)
className - The Name of the Class to be used as the SnmpProxy.persistence - The persistence flag for the persistence of the Table values
in fileSystem.| Method Detail |
|---|
public void setRegisteredOid(java.lang.String oid)
oid - specifies the Entry Node OID of the Table which implements the Proxy Table
(by default the Registered OID is ".1.3.6.1.4.1.2162.10.3.1.2.3.2.1" Entry OID of
aProxyTable).getRegisteredOid()public java.lang.String getRegisteredOid()
setRegisteredOid(String oid)public void setExtraVarBind(java.util.Vector addVector)
addVector - the Vector of additional VarBinds.public java.util.Vector getExtraVarBind()
public void setTableVector(java.util.Vector tableVector)
tableVector - specifies the Vector of Row Entries
(DynamicRegistrationEntry objects of the aProxyTable).getTableVector()public java.util.Vector getTableVector()
setTableVector(Vector tableVector)public void setFileName(java.lang.String fileName)
fileName - specifies the fileName with which the file system stores the Table
entries persistently with the directory structure(by default the
value is "conf"+File.separator+"ProxyTable.xml").getFileName().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 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 - The column for which the Get Request is processedpe - The VarBindRequestEvent created for the Get Request.entry - specifies the Row 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 - specifies the UpdateListener for updating the file System.removeUpdateListener()public void removeUpdateListener()
removeUpdateListener in class SimpleRequestHandleraddUpdateListener(UpdateListener l)public void addRegistrationListener(RegistrationListener l)
Registration Listener methods
SimpleRequestHandler
addRegistrationListener in class SimpleRequestHandlerl - specifies the registration Listener to handle the Requests from the manager.removeRegistrationListener(RegistrationListener l)
public void addRegistrationListener(RegistrationListener l,
boolean remoteAccess)
Registration Listener methods
l - specifies the registration Listener to handle 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 is handling Requests from the manager.addRegistrationListener(RegistrationListener l, boolean remoteAccess)
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
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.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.version - specifies the timeOut parameter for the request to subAgent.community - specifies the community of the proxied subAgent.timeOut - specifies the timeOut parameter for the request to subAgent.retries - specifies the retries parameter for the request to subAgent.
public static DynamicRegistrationEntry createDynamicRegistrationEntry(java.lang.String proxyingOID,
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.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.version - specifies the timeOut parameter for the request to subAgent.community - specifies the community of the proxied subAgent.timeOut - specifies the timeOut parameter for the request to subAgent.retries - specifies the retries parameter for the request to subAgent.
public void setPersistence(boolean persistence)
persistence - The persistence flag.public boolean isPersistence()
public void setFToVPersistence(boolean fToVPersistence)
fToVPersistence - The FToV Persistence flag.public SnmpProxy getProxyCommand(java.lang.String oid)
oid - The OID registered as the SubAgent.
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 | ||||||||