|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.snmp2.TcpProtocolOptionsImpl
Implemention of the ProtocolOptions interface for TCP/IP protocol.
Constructor Summary | |
TcpProtocolOptionsImpl()
The default constructor which will assign default values to all the variables in this class. |
|
TcpProtocolOptionsImpl(java.net.InetAddress remoteAddress,
int remotePort)
Constructs a new TcpProtocolOptions object with
remoteAddress and remotePort as
target host and port. |
|
TcpProtocolOptionsImpl(java.lang.String remoteHost,
int remotePort)
Constructor that creates TcpProtocolOptionsImpl with remoteHost and remotePort as target host and port. |
|
TcpProtocolOptionsImpl(java.lang.String remoteHost,
int remotePort,
int localPort)
Constructor that creates the TcpProtocolOptionsImpl object. |
Method Summary | |
java.lang.String |
getLocalAddress()
Get the local address configured. |
int |
getLocalPort()
Get the local port configured. |
int |
getReceiveBufferSize()
This method returns the previously set buffer size or zero. |
java.net.InetAddress |
getRemoteAddress()
This method gets the remoteAddress as an InetAddress object. |
java.lang.String |
getRemoteHost()
Get the remote host with which this SNMP entity will communicate. |
int |
getRemotePort()
Get the remote port with which this SNMP entity will communicate. |
java.lang.String |
getSessionId()
Get a unique session id that is associated with each SNMP session initiated from this SNMP entity. |
void |
setLocalPort(int port)
This method sets the local port on which the session should be opened. |
void |
setReceiveBufferSize(int size)
This method sets the buffer size of this receiver when the receiver is ready for receiving the next packet. |
void |
setRemoteHost(java.lang.String host)
This method sets the remoteHost to this TcpProtocolOptionsImpl object. |
void |
setRemotePort(int port)
This method sets the remotePort to which the SNMP packets should be sent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TcpProtocolOptionsImpl()
public TcpProtocolOptionsImpl(java.lang.String remoteHost, int remotePort, int localPort)
public TcpProtocolOptionsImpl(java.lang.String remoteHost, int remotePort)
public TcpProtocolOptionsImpl(java.net.InetAddress remoteAddress, int remotePort)
TcpProtocolOptions
object with
remoteAddress
and remotePort
as
target host and port.
remoteAddress
- the target address to which a SNMP request is
to be sent.remotePort
- the target port to which a SNMP request is
to be sent.
java.lang.IllegalArgumentException
- If remoteAddress
is null.remotePort
is less than zero or greater
than 65535.Method Detail |
public java.lang.String getRemoteHost()
public void setRemoteHost(java.lang.String host)
host
- The remoteHost that is to be set.public int getRemotePort()
public int getLocalPort()
public void setRemotePort(int port)
port
- the remote port to which the SNMP packet should be
sent.
java.lang.IllegalArgumentException
- If the port is negative or
greater than 65535.public void setLocalPort(int port)
port
- the port at which the session should be opened.
java.lang.IllegalArgumentException
- If the port is negative or
greater than 65535.public java.lang.String getLocalAddress()
public void setReceiveBufferSize(int size)
The following should be done to set the receive buffer
size in the SnmpTransportProvider.
TcpProtocolOptions opt = (TcpProtocolOptions)session.getProtocolOptions();
if(opt != null)
{
opt.setReceiveBufferSize(size);
}
else
{
TcpProtocolOptions opt = new TcpProtocolOptions();
opt.setReceiveBufferSize(size);
session.setProtocolOptions(opt);
}
Usaually the protocolOptions in the session will not be
null, unless session.setProtocolOptions() is called with
a null value.
This method will accept only values that are greater than zero. If the value is less than or equal to zero, then an IllegalArgumentException will be thrown. The validity of the value that is passed should be done by the user. Any invalid value that is passed will not be set on the SnmpTransportProvider.
size
- the size of the buffer.
java.lang.IllegalArgumentException
- if the value is 0 or is
negative.public int getReceiveBufferSize()
The TcpProtocolOptionsImpl object that is used to open the SnmpSession will return the present buffer size of the socket.
public java.lang.String getSessionId()
getSessionId
in interface ProtocolOptions
public java.net.InetAddress getRemoteAddress()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |