|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.manager.SnmpPeer
public class SnmpPeer
Holds information about an SNMP agent. This 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 variable bindings in a packet, retries, and timeouts). Changing these would affect all active requests.
The class contains the following properties:
SnmpSession
,
SnmpRequest
,
SnmpParameters
,
Serialized FormField Summary | |
---|---|
static int |
defaultSnmpRequestPktSize
The default SNMP packet size of an SNMP request (2 * 1024). |
static int |
defaultSnmpResponsePktSize
The default SNMP packet size of an SNMP response (8 * 1024). |
Constructor Summary | |
---|---|
SnmpPeer(InetAddress netaddr)
Creates an SNMP peer object for a device. |
|
SnmpPeer(String host)
Creates an SNMP peer object for a device. |
|
SnmpPeer(String host,
int port)
Creates an SNMP peer object for a device with the specified port. |
Method Summary | |
---|---|
boolean |
allowSnmpSets()
Determines whether an SNMP set operation is allowed with this
peer object. |
boolean |
equals(Object obj)
Compares the two peer objects to determine whether they are the same. |
long |
getAvgRtt()
Gets the average round trip time for a packet with the peer. |
InetAddress |
getDestAddr()
Gets the InetAddress object for this peer. |
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. |
String |
getDevName()
Gets the name specified in the constructor while creating this object. |
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. |
int |
getMaxTries()
Gets the number of times to try before giving up. |
long |
getMinRtt()
Gets the minimum round trip time for a packet with the peer. |
SnmpParams |
getParams()
Gets the SnmpParams 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 variable bindings that can be sent to a peer. |
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 |
setMaxSnmpPktSize(int newsize)
Configures the maximum packet size that can be used when generating an SNMP request. |
void |
setMaxTries(int newMaxTries)
Changes the maximum number of times to try before giving up. |
void |
setParams(SnmpParams params)
Sets the SnmpParams 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 variable bindings that can be sent to a peer. |
String |
toString()
Returns the String representation for this SnmpPeer . |
void |
useAddressList(InetAddress[] adrList)
Specifies the list of addresses to be used. |
void |
useIPAddress(String ipaddr)
Sets a specific IP address to which the peer will communicate. |
void |
useNextAddress()
Causes all subsequent requests to go to the new address obtained from the specified list of alternate addresses. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int defaultSnmpRequestPktSize
public static int defaultSnmpResponsePktSize
Constructor Detail |
---|
public SnmpPeer(String host) throws UnknownHostException
host
- The peer name.
UnknownHostException
- If the host name cannot be resolved.public SnmpPeer(InetAddress netaddr)
netaddr
- The peer InetAddress
.public SnmpPeer(String host, int port) throws UnknownHostException
host
- The peer name.port
- The port number.
UnknownHostException
- If the host name cannot be resolved.Method Detail |
---|
public final void useIPAddress(String ipaddr) throws UnknownHostException
String
can either be a machine name, such as ibiza
,
or a String
representing its IP address, such as "206.26.48.100".
ipaddr
- Dot formatted IP address or logical host name.
UnknownHostException
- If the host name cannot be resolved.public final String ipAddressInUse()
public final void useAddressList(InetAddress[] adrList)
useNextAddress
.
adrList
- The list of InetAddresses
.public final void useNextAddress()
public boolean allowSnmpSets()
set
operation is allowed with this
peer object. For now it just makes sure a parameter is configured for a write operation.
true
if SNMP set
is allowed and the parameter is configured,
false
otherwise.public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare this
with.
true
if they are referring to same peer and using same address;
false
otherwise.public final InetAddress[] getDestAddrList()
InetAddress
configured for this peer.
InetAddress
of the peer.public final InetAddress getDestAddr()
InetAddress
object for this peer.
InetAddress
of the peer.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 getMaxTries()
public final void setMaxTries(int newMaxTries)
newMaxTries
- The maximum number of tries.public final String getDevName()
public String toString()
String
representation for this SnmpPeer
.
toString
in class Object
String
representation.public final int getVarBindLimit()
public final void setVarBindLimit(int limit)
limit
- The desired limit.public void setParams(SnmpParams params)
SnmpParams
object associated with the peer.
params
- The desired parameters.public SnmpParams getParams()
SnmpParams
object associated with the peer.
public final int getMaxSnmpPktSize()
public final void setMaxSnmpPktSize(int newsize)
newsize
- The desired packet size.public long getMinRtt()
public long getMaxRtt()
public long getAvgRtt()
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |