snmpmonitor
Class Peer

java.lang.Object
  |
  +--snmpmonitor.Peer

public class Peer
extends java.lang.Object


Constructor Summary
Peer(java.lang.String host, int port, java.lang.String community, int retries, int timeout)
          Create an SNMP peer with a given set of parameters.
 
Method Summary
 java.lang.String getHost()
          Return the hostname of this peer.
 jmgmt.snmp.io.SnmpConnection getSnmpConnection()
          Return the JMGMT SnmpConnection object of this peer.
 jmgmt.snmp.io.SnmpPeer getSnmpPeer()
          Return the JMGMT SnmpPeer object of this peer.
 java.lang.Long retrieveLong(java.lang.String oid)
          Retrieve a single object specified by an instance OID from this peer.
 java.util.Hashtable retrieveObjectTable(java.lang.String oid)
          Retrieve a subtree of a given OID from this peer.
 java.lang.String toString()
          Return a string representing this peer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Peer

public Peer(java.lang.String host,
            int port,
            java.lang.String community,
            int retries,
            int timeout)
     throws java.net.UnknownHostException,
            java.net.SocketException
Create an SNMP peer with a given set of parameters.
Parameters:
host - The hostname of the SNMP peer.
port - The SNMP agent port of the peer.
community - The SNMP community string to be used for this peer.
retries - The number of requests to issue before giving up.
timeout - Milliseconds to wait before SNMP retries.
Method Detail

getHost

public java.lang.String getHost()
Return the hostname of this peer.
Returns:
The hostname.

getSnmpPeer

public jmgmt.snmp.io.SnmpPeer getSnmpPeer()
Return the JMGMT SnmpPeer object of this peer.
Returns:
The SnmpPeer object.

getSnmpConnection

public jmgmt.snmp.io.SnmpConnection getSnmpConnection()
Return the JMGMT SnmpConnection object of this peer.
Returns:
The SnmpConnection object.

toString

public java.lang.String toString()
Return a string representing this peer.
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this peer.

retrieveLong

public java.lang.Long retrieveLong(java.lang.String oid)
Retrieve a single object specified by an instance OID from this peer. The result is returned as a Long object.
Parameters:
oid - The OID.
Returns:
The value as a Long object.

retrieveObjectTable

public java.util.Hashtable retrieveObjectTable(java.lang.String oid)
Retrieve a subtree of a given OID from this peer. The results are returned in a hashtable that is indexed by the OID parts following the given OID. The hashtable values are objects, that the caller has to cast to appripriate Long, String, or OID objects.
Parameters:
oid - The common parent OID.
Returns:
The hashtable that contains all retrieved var-binds.