All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----com.sun.jaw.impl.adaptor.generic.AdaptorServer
|
+----com.sun.jaw.impl.adaptor.snmp.AdaptorServerImpl
AdaptorServerImpl class implements an adaptor on top
of the SNMP protocol.
When this adaptor is started it creates a datagram socket and is able to receive requests and send traps. When it is stopped, the socket is closed and no requests and no traps are processed.
The default port number of the socket is 161. This default value can be changed by specifying a port number in :
portdomain:com.sun.jaw.impl.adaptor.snmp.AdaptorServerImpl.port=44450,protocol=snmp
The SNMP adaptor supports versions 1 and 2 of the SNMP protocol in a stateless way :
when it receives an v1 request, it replies with a v1 response, when it receives
a v2 request it replies with a v2 response. The method sendTrap sends
traps using SNMP v1 format. The method sendV2Trapsends traps using
SNMP v2 format.
To receive data packets, the SNMP adaptor uses a buffer whose size
can be configured using the property bufferSize (default
value is 1024). Packets which does not fit in buffer are rejected.
Increasing bufferSize allows to exchange bigger packets.
However the underlying networking system may impose a limit on the
size of UDP packets. Packets bigger than this limit will rejected too,
no matter the value of bufferSize.
AdaptorServerImpl using the default port (161).
AdaptorServerImpl using the specified port.
AdaptorServerImpl using the default port (161)and the
specified IPAclSrvIf
implementation.
AdaptorServerImpl using the specified port and the
specified IPAclSrvIf
implementation.
AdaptorServerImpl sends a response in case
of authentication failure.
AdaptorServerImpl.
AdaptorServerImpl.
AdaptorServerImpl.
AdaptorServerImpl for sending traps.
AdaptorServerImpl sends a response in case
of authentication failure.
AdaptorServerImpl (default 1024).
AdaptorServerImpl for sending traps.
AdaptorServerImpl.
public AdaptorServerImpl()
AdaptorServerImpl using the default port (161).
public AdaptorServerImpl(int p)
AdaptorServerImpl using the specified port.
public AdaptorServerImpl(IPAclSrvIf acl)
AdaptorServerImpl using the default port (161)and the
specified IPAclSrvIf
implementation.
public AdaptorServerImpl(IPAclSrvIf acl,
int p)
AdaptorServerImpl using the specified port and the
specified IPAclSrvIf
implementation.
public String getClassVersion()
public Integer getPort()
AdaptorServerImpl.
This is the port used when creating the UDP socket. Its value
is specified at creation time. But it can be changed by initCmf
if the ObjectName assigned to the adaptor contains a 'port' key.
public Integer getTrapPort()
AdaptorServerImpl for sending traps.
By default, port 162 is used.
public void setTrapPort(Integer v)
AdaptorServerImpl for sending traps.
By default, port 162 is used.
public String getProtocol()
AdaptorServerImpl.
public Integer getBufferSize()
AdaptorServerImpl.
public void setBufferSize(Integer s)
AdaptorServerImpl (default 1024).
public void usePduFactory(SnmpPduFactoryIf factory)
AdaptorServerImpl.
public boolean isAuthTrapEnabled()
When this feature is enabled, the AdaptorServerImpl sends
an authenticationFailure trap each time an authentication
fails.
The default behaviour is to send authentication traps.
true if authentication traps are enable.
public boolean getAuthTrapEnabled()
When this feature is enabled, the AdaptorServerImpl sends
an authenticationFailure trap each time an authentication
fails.
The default behaviour is to send authentication traps.
true if authentication traps are enable.
public void setAuthTrapEnabled(boolean enabled)
public boolean isAuthRespEnabled()
AdaptorServerImpl sends a response in case
of authentication failure.
When this feature is enabled, the adaptor sends a response with noSuchName or readOnly when the authentication failed. If the flag is disable, the adaptor trashes the pdu silently.
The default behavior is to send responses.
public boolean getAuthRespEnabled()
AdaptorServerImpl sends a response in case
of authentication failure.
When this feature is enabled, the adaptor sends a response with noSuchName or readOnly when the authentication failed. If the flag is disable, the adaptor trashes the pdu silently.
The default behavior is to send responses.
public void setAuthRespEnabled(boolean enabled)
public void addMib(SnmpMib mib) throws IllegalArgumentException
Adds a new MIB in the adaptor. This method is called automatically by
SnmpMib.setSnmpAdaptor.
public Boolean removeMib(SnmpMib mib)
Removes a MIB from the adaptor. This method is called automatically by
SnmpMib.setSnmpAdaptor(null).
public String[] getMibs()
public void sendTrap(int generic,
int specific,
Vector varBindList) throws IOException, SnmpStatusException
bufferSize
public void sendV2Trap(SnmpOid trapOid,
Vector varBindList) throws IOException, SnmpStatusException
sysUpTime.0 with its current value
snmpTrapOid.0 with the value specified by trapOid
all the (oid,values) from varBindList
bufferSize
public String getEnterpriseOid()
sendTrap to fill
the 'enterprise' field of the trap request.
public void setEnterpriseOid(String oid) throws IllegalArgumentException
public Long getSnmpOutTraps()
public Long getSnmpOutGetResponses()
public Long getSnmpOutGenErrs()
public Long getSnmpOutBadValues()
public Long getSnmpOutNoSuchNames()
public Long getSnmpOutTooBigs()
public Long getSnmpInASNParseErrs()
public Long getSnmpInBadCommunityUses()
public Long getSnmpInBadCommunityNames()
public Long getSnmpInBadVersions()
public Long getSnmpOutPkts()
public Long getSnmpInPkts()
public Long getSnmpInGetRequests()
public Long getSnmpInGetNexts()
public Long getSnmpInSetRequests()
public Long getSnmpInTotalSetVars()
public Long getSnmpInTotalReqVars()
public void updateRequestCounters(int pduType)
public void updateErrorCounters(int errorStatus)
public void updateVarCounters(int pduType,
int n)
public void incSnmpInASNParseErrs(int n)
public void incSnmpInBadVersions(int n)
public void incSnmpInBadCommunityUses(int n)
public void incSnmpInBadCommunityNames(int n)
public void initCmf(Framework f,
ObjectName name,
boolean db,
ModificationList list) throws InstanceAlreadyExistException
This method add SNMP specific processing to the ancestor initCmf(). It parses the object name to find a port key: if this key is found, its value supersedes the current port number.
public void performStop()
All Packages Class Hierarchy This Package Previous Next Index