public class SnmpPeer
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
defaultRemotePort
The default remote port.
|
static int |
defaultRetries
The library default for the number of retries.
|
static int |
defaultTimeout
The library default for the number of milliseconds
to wait for a reply from the remote agent.
|
private SnmpParameters |
m_params
The default parameters for communicating with
the agent.
|
private java.net.InetAddress |
m_peer
The internet address of the peer
|
private int |
m_port
The remote port of the agent.
|
private int |
m_retries
The number of time to resend the datagram
to the host.
|
private java.net.InetAddress |
m_serveraddress
The local address to bind
|
private int |
m_serverport
The local port of the agent.
|
private int |
m_timeout
The length of time to wait on the remote
agent to respond.
|
Constructor and Description |
---|
SnmpPeer(java.net.InetAddress peer)
Class constructor.
|
SnmpPeer(java.net.InetAddress peer,
int port)
Class constructor.
|
SnmpPeer(java.net.InetAddress peer,
int port,
java.net.InetAddress laddr,
int lport)
Class constructor.
|
SnmpPeer(SnmpPeer second)
Class copy constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Used to get a newly created copy of
the current object.
|
SnmpParameters |
getParameters()
Retuns the current parameters for the
peer agent.
|
java.net.InetAddress |
getPeer()
Returns the peer agent's internet address to the
caller
|
int |
getPort()
Returns the remote agent's port for communications
|
int |
getRetries()
Returns the currently set number of retries
defined by this peer
|
java.net.InetAddress |
getServerAddress()
Returns the local agent's bound address
|
int |
getServerPort()
Returns the local agent's port for communications
|
int |
getTimeout()
Retreives the currently configured timeout for
the remote agent in milliseconds (1/1000th second).
|
void |
setParameters(SnmpParameters params)
Used to set the current parameters for the
SnmpPeer object.
|
void |
setPeer(java.net.InetAddress addr)
Used to set the peer's internet address for
the remote agent.
|
void |
setPeer(java.net.InetAddress addr,
int port)
Used to set the peer's internet address and port
for communications.
|
void |
setPort(int port)
Used to set the remote communication port
|
void |
setRetries(int retry)
Used to set the default number of retries
for this peer agent.
|
void |
setServerAddress(java.net.InetAddress laddr)
Used to set the local binding address
|
void |
setServerPort(int port)
Used to set the local communication port
|
void |
setTimeout(int timeout)
Sets the millisecond timeout for the communications
with the remote agent.
|
private java.net.InetAddress m_peer
private int m_port
private java.net.InetAddress m_serveraddress
private int m_serverport
private int m_retries
private int m_timeout
private SnmpParameters m_params
public static final int defaultRemotePort
public static final int defaultRetries
public static final int defaultTimeout
public SnmpPeer(java.net.InetAddress peer)
peer
- The remote internet addresspublic SnmpPeer(java.net.InetAddress peer, int port)
peer
- The remote agent addressport
- The snmp port on the remotepublic SnmpPeer(java.net.InetAddress peer, int port, java.net.InetAddress laddr, int lport)
peer
- The remote agent addressport
- The snmp port on the remoteladdr
- The local address to bindlport
- The local port to bindpublic SnmpPeer(SnmpPeer second)
second
- The peer object to copy.public java.net.InetAddress getPeer()
public void setPeer(java.net.InetAddress addr)
addr
- The remote agents internet addresspublic void setPeer(java.net.InetAddress addr, int port)
addr
- The remote agent's internet addressport
- The remote agent's portpublic int getPort()
public void setPort(int port)
port
- The remote communication portpublic int getServerPort()
public void setServerPort(int port)
port
- The local communication portpublic java.net.InetAddress getServerAddress()
public void setServerAddress(java.net.InetAddress laddr)
port
- The local binding addresspublic int getRetries()
public void setRetries(int retry)
retry
- The new number of retries for the peerpublic int getTimeout()
public void setTimeout(int timeout)
timeout
- The timeout in millisecondspublic SnmpParameters getParameters()
public void setParameters(SnmpParameters params)
public java.lang.Object clone()
clone
in class java.lang.Object
Generated by iurt on 2015.