MySnmpCrawler API

snmp.lib
Class ServiceConnector

java.lang.Object
  |
  +--snmp.lib.ServiceConnector

public class ServiceConnector
extends java.lang.Object

The ServiceConnector class provides the simple interface to search the OID record from the MIB database, get the MBean attribute value, or set the MBean attribute value.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:48 $
Author:
Scott Cheng

Field Summary
private static ServiceConnector instance
           
 
Constructor Summary
private ServiceConnector()
           
 
Method Summary
 SnmpVariable getAttribute(SnmpVariable var)
          Gets the MBean attribute value associating to the OID record.
static ServiceConnector getInstance()
          Gets the singleton object of the ServiceConnector.
 OidRecord getOidRecord(java.lang.String oid)
          Gets the OID record matching to the oid string from the MIB database.
private  void init()
           
 SnmpVariable setAttribute(SnmpVariable var)
          Sets the MBean attribute value associating to the OID record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static ServiceConnector instance
Constructor Detail

ServiceConnector

private ServiceConnector()
Method Detail

init

private void init()

getOidRecord

public OidRecord getOidRecord(java.lang.String oid)
                       throws SnmpException
Gets the OID record matching to the oid string from the MIB database.

Returns:
The OID record found in the MIB database.
Throws:
SnmpException - thrown if any error occurs during retriving the OID record.

getAttribute

public SnmpVariable getAttribute(SnmpVariable var)
                          throws SnmpException
Gets the MBean attribute value associating to the OID record. The OID record object is wrapped inside the SnmpVariable object. The obtained MBean attribute value is also wrapped into the SnmpVariable object.

Parameters:
var - The snmp variable.
Returns:
The SnmpVariable that contains the attribute value found in the MBean.
Throws:
SnmpException - thrown if MBean is not found, permission error occurs in reading the attribute, or any other error occurs.

setAttribute

public SnmpVariable setAttribute(SnmpVariable var)
                          throws SnmpException
Sets the MBean attribute value associating to the OID record. Both the OID record object and the attribute value are wrapped inside the SnmpVariable object.

Parameters:
var - The SnmpVariable object.
Returns:
The SnmpVariable object.
Throws:
SnmpException - thrown if MBean is not found, permission error occurs in writting the attribute, or any other error occurs.

getInstance

public static ServiceConnector getInstance()
Gets the singleton object of the ServiceConnector.

Returns:
Singleton object of the ServiceConnector.

MySnmpCrawler API