|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.snmp.snmp2.agent.PduRequestHandler
public class PduRequestHandler
This class handles all the SnmpPDU 's got to SnmpAgent retrieves appropriate VarBindRequestListener for a varbind and gives the pdu from the SnmpAgent as VarBindRequestEvent to the appropriate listener.
It is the source for all VarBindRequestEvents. VarBindRequestListener components will register with this class by triggering RegistrationEvents
VarBindRequestListener,
VarBindRequestEvent,
Serialized Form| Field Summary | |
|---|---|
(package private) BaseSnmpAgent |
agent
|
boolean |
isRollBack
boolean specifying the RollBack Support. |
(package private) VarBindRequestListenerManager |
manager
|
(package private) java.lang.String |
presentRoot
|
(package private) java.lang.String |
rootOid
|
(package private) java.util.Vector |
unProcessedListeners
Helps support for multi-varbind Events. |
(package private) boolean |
validCommand
|
| Constructor Summary | |
|---|---|
PduRequestHandler()
No arg Constructor for PduRequestHandler. |
|
| Method Summary | |
|---|---|
void |
addVarBindRequestListener(VarBindRequestListener pde,
java.lang.String key)
Adds a VarBindRequestListener with a particular OID. |
void |
addVarBindRequestListener(VarBindRequestListener pde,
java.lang.String key,
int[] subidList)
Adds a VarBindRequestListener with a particular OID(key). |
(package private) void |
cleanMultiVarbindListenerTable(AgentResource agentSource)
|
(package private) SnmpPDU |
getBulkRequest(java.util.Vector varbindList,
AgentResource agentSource)
|
(package private) static int |
getMinSize(int[] oid1,
int[] oid2)
|
(package private) SnmpPDU |
getNextRequest(java.util.Vector varbindList,
AgentResource agentSource)
Handles the GETNEXT_REQ message |
(package private) VarBindRequestListenerHolder |
getNextVarBindRequestListenerHolder(SnmpVarBind varbind,
AgentResource agentSource)
Get The next VarBindRequestListener Holder for the SnmpVarBind |
(package private) SnmpPDU |
getRequest(SnmpPDU commingPdu,
java.util.Vector varbindList,
byte command,
AgentResource agentSource)
The getRequest method handles the getRequest PDU |
java.util.Vector |
getVarBindRequestListeners()
This method returns the Vector of VarBindRequestListeners registered with the PduRequestHandler. |
boolean |
isRootOidChange(java.lang.String commingOID)
Method to support the RootOID change. |
(package private) boolean |
isValidErrValue(byte val)
|
(package private) boolean |
isValidOid(java.lang.String key)
|
(package private) void |
processFailedVarBind(VarBindAndFailure vbFail1,
byte command,
AgentResource agentSource)
|
(package private) SnmpVarBind |
processGetBulk(SnmpVarBind varb,
AgentResource agentSource)
processes the GetBulk Request |
(package private) SnmpVarBind |
processGetBulkRequest(SnmpVarBind varb,
AgentResource agentSource)
|
(package private) SnmpPDU |
processGetNextReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
This is where actual processing is done |
(package private) void |
processGetNextVarBinds(SnmpPDU newPdu,
VarBindRequestListenerHolder holder,
java.util.Vector varbindList,
AgentResource agentSource,
boolean forProxyGetNext)
Process the SNMP GETNEXT request. |
(package private) SnmpPDU |
processGetReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
This is where actual processing is done |
(package private) SnmpPDU |
processSetReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
Processes the SNMP Set Request |
void |
processSnmpPduRequest(SnmpPduRequestEvent p1)
This method is called by the callback thread of SnmpAgent. |
void |
registrationPerformed(RegistrationEvent re)
Method of interface RegistrationListener. |
void |
removeVarBindRequestListener(java.lang.String oid)
Removes the VarBindRequestListener with the specified oid. |
(package private) void |
setErrindex(int err,
AgentResource agentSource)
Setter for errstat used by VarBindRequestListenerHolder |
(package private) void |
setErrstat(int err,
AgentResource agentSource)
Setter for errstat used by VarBindRequestListenerHolder |
(package private) void |
setErrstatAndErrIndex(int errstat,
int index,
AgentResource agentSource)
|
(package private) void |
setErrstatAndErrindexForPdu(SnmpPDU pdu,
int errstat,
int index,
AgentResource agentSource)
|
(package private) void |
setErrvalue(SnmpVarBind varb1,
byte errval)
Utility method to setErrvalue |
(package private) SnmpPDU |
setRequest(SnmpPDU commingPdu,
java.util.Vector varbindList,
byte command,
AgentResource agentSource)
|
void |
setRollBackEnabled(boolean isRollBack)
The method for enabling or disabling the rollback functionality. |
void |
setRootOid(java.lang.String requiredRoot,
java.lang.String existingRoot)
Method to set a User's own OID as the RootOID. |
(package private) void |
setVarBind(SnmpVarBind varb,
int index,
SnmpPDU newPdu)
Accessed mostly PduRequestListenerHolder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
transient BaseSnmpAgent agent
transient VarBindRequestListenerManager manager
java.util.Vector unProcessedListeners
these listeners are processed at the end
public boolean isRollBack
java.lang.String rootOid
java.lang.String presentRoot
boolean validCommand
| Constructor Detail |
|---|
public PduRequestHandler()
| Method Detail |
|---|
public void registrationPerformed(RegistrationEvent re)
registrationPerformed in interface RegistrationListenerre - the RegistrationEvent to registerRegistrationEvent
public void addVarBindRequestListener(VarBindRequestListener pde,
java.lang.String key)
throws RegistrationListenerException
pde - the listener for the OID.key - the OID to listen .
java.util.TooManyListenersException - if more than one listener try to
register the same OID.
RegistrationListenerException
public void addVarBindRequestListener(VarBindRequestListener pde,
java.lang.String key,
int[] subidList)
throws RegistrationListenerException
pde - VarBindRequestListener to be added.key - String representation of the OID
the listener is interested in.subidlist - int[] of the subidlist under the key are also registered
for the same listener.
java.util.TooManyListenersException - if there is a listener
already registered for this key.
RegistrationListenerExceptionpublic void removeVarBindRequestListener(java.lang.String oid)
oid - the OID to remove the listener.public java.util.Vector getVarBindRequestListeners()
getVarBindRequestListeners in interface SnmpPduRequestListenerVarBindRequestListenerpublic void processSnmpPduRequest(SnmpPduRequestEvent p1)
In case of multiple agents registered for the this same SnmpPduRequestListener. The flow from this method is made asynchronous such that calls from different agents are not blocked.This is done inorder to facilitate multiple agent in the same JVM.
processSnmpPduRequest in interface SnmpPduRequestListenerp1 - the SnmpPduRequestEvent from SnmpAgent
SnmpPDU getRequest(SnmpPDU commingPdu,
java.util.Vector varbindList,
byte command,
AgentResource agentSource)
SnmpPDU processSetReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
throws AgentSnmpException
AgentSnmpException
SnmpPDU processGetReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
throws AgentSnmpException
AgentSnmpException
SnmpPDU processGetNextReqMesg(SnmpPDU newPdu,
AgentResource agentSource)
throws AgentSnmpException
AgentSnmpException
void processGetNextVarBinds(SnmpPDU newPdu,
VarBindRequestListenerHolder holder,
java.util.Vector varbindList,
AgentResource agentSource,
boolean forProxyGetNext)
throws AgentSnmpException
AgentSnmpException
SnmpVarBind processGetBulkRequest(SnmpVarBind varb,
AgentResource agentSource)
throws AgentSnmpException
AgentSnmpException
SnmpPDU getNextRequest(java.util.Vector varbindList,
AgentResource agentSource)
SnmpPDU -
VarBindRequestListenerHolder getNextVarBindRequestListenerHolder(SnmpVarBind varbind,
AgentResource agentSource)
SnmpPDU getBulkRequest(java.util.Vector varbindList,
AgentResource agentSource)
SnmpPDU setRequest(SnmpPDU commingPdu,
java.util.Vector varbindList,
byte command,
AgentResource agentSource)
boolean isValidOid(java.lang.String key)
SnmpVarBind processGetBulk(SnmpVarBind varb,
AgentResource agentSource)
throws AgentSnmpException
AgentSnmpException - if there is no next Objectboolean isValidErrValue(byte val)
void processFailedVarBind(VarBindAndFailure vbFail1,
byte command,
AgentResource agentSource)
void setVarBind(SnmpVarBind varb,
int index,
SnmpPDU newPdu)
void setErrstatAndErrindexForPdu(SnmpPDU pdu,
int errstat,
int index,
AgentResource agentSource)
void setErrstatAndErrIndex(int errstat,
int index,
AgentResource agentSource)
void setErrstat(int err,
AgentResource agentSource)
void setErrindex(int err,
AgentResource agentSource)
void setErrvalue(SnmpVarBind varb1,
byte errval)
void cleanMultiVarbindListenerTable(AgentResource agentSource)
public void setRollBackEnabled(boolean isRollBack)
setRollBackEnabled in interface SnmpPduRequestListenerisRollBack - The boolean to enable or disable Rollback.
public void setRootOid(java.lang.String requiredRoot,
java.lang.String existingRoot)
The required root will be set for the ExistingRoot. The RequiredRoot and the ExistingRoot should be of same length. Requires restart of the SnmpAgent.
requiredRoot - The RootOID required e.g., .1.3.6.1.4.1.2345existingRoot - The RootOID present e.g., .1.3.6.1.4.1.2162If the params are as given in the example the RootOID will be changed from .1.3.6.1.4.1.2162 to .1.3.6.1.4.1.2345
public boolean isRootOidChange(java.lang.String commingOID)
commingOID - The OID for which the Request is received.
static int getMinSize(int[] oid1,
int[] oid2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||