|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.adventnet.snmp.snmp2.agent.Cache
|
+--com.adventnet.snmp.snmp2.agent.BaseSnmpStore
|
+--com.adventnet.snmp.snmp2.agent.SnmpStore
|
+--com.adventnet.snmp.snmp2.agent.SnmpProxy
SnmpProxy class is used to implement the Proxy bean.
The associated getRequest, getnextRequest, setRequest is proxied to another snmp agent specified as this bean's properties.
This class implements the VarBindRequestListener for handling the appropriate snmp requests and proxies to real agent.
It also extends SnmpStore for getting the SnmpAPI and proxy-session from the cache
VarBindRequestListener,
SnmpStore, Serialized Form| Field Summary | |
(package private) java.lang.String |
agentHost
|
(package private) int |
agentPortNumber
|
(package private) long |
agentTimeOut
|
(package private) SnmpAPI |
api
The Snmp API thread used for callbacks by SnmpAgent |
(package private) java.lang.String |
community
|
protected SnmpPDU |
pdu
|
(package private) SnmpSession |
proxySession
The Snmp Session used for proxying by SnmpAgent |
(package private) java.lang.String |
registeredOid
|
(package private) int |
retries
|
(package private) int |
status
|
(package private) boolean |
userBasedCommunityPolicy
|
| Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpStore |
debugLevel,
localAddress,
oldAddress,
oldPort,
protocol,
session,
snmpLog |
| Fields inherited from class com.adventnet.snmp.snmp2.agent.Cache |
cache,
debug |
| Constructor Summary | |
SnmpProxy()
No Arg constructor Initialises the ProxySession which is shared by all the SnmpProxy. |
|
| Method Summary | |
void |
addRegistrationListener(RegistrationListener l)
adds the registration listener for this bean.This listener maintains the registration tree where VarBindRequestListeners can register for their interested OID. |
java.lang.String |
getAgentHost()
Gets the proxy host name. |
int |
getAgentPortNumber()
Get the agent Port Number to be proxied |
long |
getAgentTimeOut()
Gets the timeout value for the response PDU which is to be proxied |
(package private) java.lang.String |
getkey()
|
void |
getNextRequest(VarBindRequestEvent pe,
AgentResource agentSource)
method handles GetNextRequests from the manager Implementation of the VarBindRequestListener interface. |
java.lang.String |
getRegisteredOid()
gets the OID which needs to be proxied |
void |
getRequest(VarBindRequestEvent pe)
method handles GetRequests from the manager. |
protected SnmpPDU |
getRespPdu()
This method is used when this agent acts as a proxy Agent. |
protected java.util.Vector |
getRespPdu(VarBindRequestEvent pe,
byte command)
|
int |
getRetries()
Getter for the retries count of this entry. |
int |
getRowStatus()
Getter for the status of this Proxy entry. |
int[] |
getSubidList()
The subids under the Object being proxied dummy implementation of VarBindRequestListener Since we expect all the OIDS that falls under the registeredOid tree to be proxied rather than restricting to subIdList |
int |
getVersion()
The Getter for the SNMP Version through the which the query has to be made. |
(package private) void |
initProxySession()
This method should be called by SnmpAgent and no one else |
boolean |
isProxySessionAlive()
Gets the status of the proxy session. |
boolean |
isProxyTimeOuts()
Getter for Proxy TimeOuts. |
boolean |
isUserBasedCommunityPolicy()
Getter which indicates whether we require a userBasedCommunityPolicy.Only if this boolean is true the community set in setCommunity method will take into effect. |
void |
removeRegistrationListener(RegistrationListener l)
removes the registration listener for this bean. |
void |
setAgentHost(java.lang.String host)
Set the agentHost name to which the pdu should be proxied. |
void |
setAgentPortNumber(int port)
Set the agent Port Number to be proxied |
void |
setAgentTimeOut(long timeout)
Set the timeout value for the response PDU which is to be proxied |
void |
setCommunity(java.lang.String community)
Community for sending proxy, typically the SnmpAgent will fill based on incoming pdu |
void |
setProxyTimeOuts(boolean proxyTimeOuts)
Setter for Proxy Time outs. |
void |
setRegisteredOid(java.lang.String oid)
sets the OID which needs to be proxied. |
void |
setRequest(VarBindRequestEvent pe)
method handles setRequest from the manager Implementation of the VarBindRequestListener interface. |
void |
setRetries(int retries)
Setter for the retries count for this proxy event. |
void |
setRowStatus(int rs)
Method to set the Status value of this Proxy event. |
void |
setUserBasedCommunityPolicy(boolean policy)
Set this to false to indicate that the Proxy request should be sent with the community of in the DynamicRegistrationEntry. |
void |
setVersion(int version)
The Setter for the SNMP Version through the which the query has to be made. |
void |
startProxySession()
Opens the proxy session to proxy the SnmpPDU calls the getProxySession in SnmpStore. |
void |
stopProxySession()
Stop the proxy Session and stop the api Thread associated with it. |
| Methods inherited from class com.adventnet.snmp.snmp2.agent.SnmpStore |
getProxySession,
getTrapReceiverSession,
initSnmpStore |
| Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseSnmpStore |
closeAll,
createProtocolOptions,
finalize,
getSnmpAPI,
getSnmpSession,
getSnmpSession,
initSession,
initSnmpStore,
isAlive,
isDebug,
killSnmpAgent,
setDebug |
| Methods inherited from class com.adventnet.snmp.snmp2.agent.Cache |
getFromCache,
getMibOperations,
putInCache,
setMibOperations |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
java.lang.String agentHost
int agentPortNumber
long agentTimeOut
protected SnmpPDU pdu
SnmpSession proxySession
SnmpAPI api
java.lang.String community
boolean userBasedCommunityPolicy
java.lang.String registeredOid
int retries
int status
| Constructor Detail |
public SnmpProxy()
| Method Detail |
public void setAgentHost(java.lang.String host)
host - the name of the host to proxy.public java.lang.String getAgentHost()
public void setAgentPortNumber(int port)
port - proxy agent port numberpublic int getAgentPortNumber()
public void setAgentTimeOut(long timeout)
timeout - the timer valuepublic long getAgentTimeOut()
java.lang.String getkey()
public void setCommunity(java.lang.String community)
Applications such as ProxyByHost use this method to have a gateway between received community and community used to proxy
community - the name of the communitypublic void setUserBasedCommunityPolicy(boolean policy)
policy - the community policy to be followedpublic boolean isUserBasedCommunityPolicy()
public void startProxySession()
void initProxySession()
throws SnmpException
protected SnmpPDU getRespPdu()
throws AgentSnmpException
public void getRequest(VarBindRequestEvent pe)
throws AgentSnmpException
pe - the VarBindRequestEvent contains varbinds and information
about the manager.
public void getNextRequest(VarBindRequestEvent pe,
AgentResource agentSource)
throws AgentSnmpException
pe - the VarBindRequestEvent contains varbinds and information
about the manager.agentSource - the AgentResource created for this request.
public void setRequest(VarBindRequestEvent pe)
throws AgentSnmpException
pe - the VarBindRequestEvent contains varbinds and information
about the manager.public int[] getSubidList()
Hence the subidlist is null.i.e registered for the full tree.
protected java.util.Vector getRespPdu(VarBindRequestEvent pe,
byte command)
public boolean isProxySessionAlive()
public void stopProxySession()
throws SnmpException
initProxySession()public void setRegisteredOid(java.lang.String oid)
Default value is ".1.3.6.1.2"
For example, If any other VarBindRequestListener is registered for oid .1.3.6.1.2.1.1.1 - SysDecr ,and if incoming pdu is for SysDecr then it will be given to that Listener rather proxying it to real Agent.
oid - value of the OIDpublic java.lang.String getRegisteredOid()
public void addRegistrationListener(RegistrationListener l)
l - the registration listener to whom this SnmpProxy registers.public void removeRegistrationListener(RegistrationListener l)
l - the registration listener to whom this SnmpProxy has registered.public boolean isProxyTimeOuts()
public void setProxyTimeOuts(boolean proxyTimeOuts)
proxyTimeOuts - The proxy Agent's timeout option.
public void setVersion(int version)
throws java.lang.IllegalArgumentException
version - the SNMP Version in which the proxy queries are to be forwarded. 1 for Snmp Version 1 and 2 for Snmp Version 2public int getVersion()
public void setRetries(int retries)
retries - the number of times, MasterAgent should retry to get a
response from the SubAgent - default 0.public int getRetries()
public void setRowStatus(int rs)
rs - int specifying the status of this Proxy entry - default 1.public int getRowStatus()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||