|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.snmp.manager.SnmpPeer
This class holds information about a SNMP agent. Such information is used to communicate with the agent. These are the IP address, port number, SNMP parameters, and peer channel parameters (such as the maximum request packet size, maximum number of varbinds in a packet, retries, and timeouts). Changing these would affect all active requests.
The class contains the following properties:
SnmpSession
,
SnmpRequest
,
SnmpParameters
,
SnmpConst
, Serialized FormField Summary | |
protected int |
maxRetries
Number of times to retry before giving up. |
protected int |
maxSnmpPacketSize
Maximum packet size of Request PDU. |
protected int |
maxVarbindLimit
Maximum number of OIDs which can be encoded in a single request packet. |
protected SnmpPduFactoryIf |
pduFactory
The PDU factory. |
protected int |
portNum
Port number of the destination host. |
protected int |
timeout
The amount of time to wait for a response from the peer. |
Constructor Summary | |
SnmpPeer(java.net.InetAddress netaddr)
Creates an SNMP peer object for a device. |
|
SnmpPeer(java.lang.String host)
Creates an SNMP peer object for a device. |
|
SnmpPeer(java.lang.String host,
int port)
Creates an SNMP peer object for a device with the specified port. |
Method Summary | |
boolean |
allowSnmpSets()
Determines if a SNMP set operation is allowed using this
peer object. |
boolean |
equals(java.lang.Object obj)
Compares the two peer objects to determine if they are the same. |
void |
finalize()
Sets all the references to the SnmpPeer
object to null . |
long |
getAvgRtt()
Gets the average round trip time for a packet with the peer. |
java.net.InetAddress |
getDestAddr()
Gets the InetAddress object for this peer. |
java.net.InetAddress[] |
getDestAddrList()
Gets the list of alternate InetAddress configured for this peer. |
int |
getDestPort()
Gets the destination port number of the peer to which SNMP requests are to be sent. |
java.lang.String |
getDevName()
Gets the name specified in the constructor while creating this object. |
int |
getMaxRetries()
Gets the number of times to retry before giving up. |
long |
getMaxRtt()
Gets the maximum round trip time for a packet with the peer. |
int |
getMaxSnmpPktSize()
Gets the maximum request packet size that is currently used. |
long |
getMinRtt()
Gets the minimum round trip time for a packet with the peer. |
SnmpPduFactoryIf |
getPduFactory()
Gets the PDU factory. |
SnmpParameters |
getSnmpParam()
Gets the SnmpParameter object associated with the peer. |
int |
getTimeout()
Gets the timeout to wait for a response from the peer. |
int |
getVarbindLimit()
Gets the maximum number of varbinds that can be sent to a peer. |
java.lang.String |
ipAddressInUse()
Returns the dot-formatted IP address string (for example 171.69.220.224). |
void |
setDestPort(int newPort)
Changes the port address of the destination for the request. |
void |
setMaxRetries(int newMaxRetries)
Changes the maximun number of times to retry before giving up. |
void |
setMaxSnmpPktSize(int newsize)
Configures the maximum packet size that can be used when generating an SNMP request. |
void |
setPduFactory(SnmpPduFactoryIf factory)
Sets the PDU factory. |
void |
setSnmpParam(SnmpParameters param)
Sets the SnmpParameter object associated with the peer. |
void |
setTimeout(int newTimeout)
Changes the timeout to wait for a response from the peer. |
void |
setVarbindLimit(int limit)
Configures the maximum number of varbinds that can be sent to a peer. |
java.lang.String |
toString()
Returns the string representation for this SnmpPeer . |
void |
useAddressList(java.net.InetAddress[] adrList)
Specifies the list of address to be used. |
void |
useIPAddress(java.lang.String ipaddr)
Sets a specific IP address where the peer will communicate. |
void |
useNextAddress()
Causes all subsequent requests to go to the new address that is obtained from the specified list of alternate addresses. |
Methods inherited from class java.lang.Object |
clone,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected int portNum
protected int maxVarbindLimit
protected int maxSnmpPacketSize
protected int maxRetries
protected int timeout
protected SnmpPduFactoryIf pduFactory
SnmpPduFactory
.Constructor Detail |
public SnmpPeer(java.lang.String host) throws java.net.UnknownHostException
host
- The peer name.public SnmpPeer(java.net.InetAddress netaddr)
netaddr
- The peer InetAddress
.public SnmpPeer(java.lang.String host, int port) throws java.net.UnknownHostException
host
- The peer name.port
- The port number.Method Detail |
public final void useIPAddress(java.lang.String ipaddr) throws java.net.UnknownHostException
ipaddr
- Dot formatted IP address. It can also be a name.public final java.lang.String ipAddressInUse()
public final void useAddressList(java.net.InetAddress[] adrList)
useNextAddress
.adrList
- The list of InetAddresses
.public final void useNextAddress()
public boolean allowSnmpSets()
set
operation is allowed using this
peer object. For now it just makes sure parameter is configured for a
write operation.set
is allowed and parameter is configured;
false otherwise.public boolean equals(java.lang.Object obj)
obj
- The object to compare this
with.public final java.net.InetAddress[] getDestAddrList()
InetAddress
configured for this peer.InetAddress
of the peer.InetAddress
public final java.net.InetAddress getDestAddr()
InetAddress
of the peer.InetAddress
public final int getDestPort()
public final void setDestPort(int newPort)
newPort
- The destination port.public final int getTimeout()
public final void setTimeout(int newTimeout)
newTimeout
- The timeout (in milliseconds).public final int getMaxRetries()
public final void setMaxRetries(int newMaxRetries)
newMaxRetries
- The maximun number of retries.public final java.lang.String getDevName()
public java.lang.String toString()
SnmpPeer
.public final int getVarbindLimit()
varbinds
that can be sent to a peer.varbind
that can be encoded into a request packet.public final void setVarbindLimit(int limit)
varbinds
that can be sent to a peer.limit
- The desired limit.public final SnmpParameters getSnmpParam()
SnmpParameter
object associated with the peer.public final void setSnmpParam(SnmpParameters param)
SnmpParameter
object associated with the peer.param
- The desired parameter.public final void setMaxSnmpPktSize(int newsize)
newsize
- The desired packet size.public final int getMaxSnmpPktSize()
public final void setPduFactory(SnmpPduFactoryIf factory)
factory
- The new factory. If null
is passed, the
default factory will be set.public final SnmpPduFactoryIf getPduFactory()
public void finalize()
SnmpPeer
object to null
.public long getMinRtt()
public long getMaxRtt()
public long getAvgRtt()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |