Hyperic HQ Plugin API v. 2.5.dev

net.hyperic.snmp
Interface SNMPSession


public interface SNMPSession

Generic interface for any version of the SNMP protocol. Use the SNMPClient.getSession to get an instance of a class that implements this interface.


Method Summary
 void close()
          Closes the session.
 java.util.List getBulk(java.lang.String mibName)
           
 java.util.List getColumn(java.lang.String mibName)
          Retrieves all values from a column of an SNMP table.
 SNMPValue getNextValue(java.lang.String mibName)
          Retrieve the value that is equal to or logically next after the specified name.
 int getRetries()
          Get the retries value for this session.
 SNMPValue getSingleValue(java.lang.String mibName)
          Retrieve a single data variable from an SNMP agent.
 java.util.Map getTable(java.lang.String mibName, int index)
           
 long getTimeout()
          Get the timeout value for this session.
 void setRetries(int retries)
          Set the retries value for this session.
 void setTimeout(long timeout)
          Set the timeout value for this session.
 

Method Detail

getSingleValue

public SNMPValue getSingleValue(java.lang.String mibName)
                         throws SNMPException
Retrieve a single data variable from an SNMP agent.

Parameters:
mibName - The name of the variable to retrieve.
Returns:
a SNMPValue object representing the value of the variable.
Throws:
SNMPException - if an error occurs communicating with the SNMP agent.

getNextValue

public SNMPValue getNextValue(java.lang.String mibName)
                       throws SNMPException
Retrieve the value that is equal to or logically next after the specified name.

Parameters:
mibName - The name of the MIB variable to start looking.
Returns:
An SNMPValue object representing the value of the specified MIB name, or if not found, the next logical MIB name.
Throws:
SNMPException - if an error occurs communicating with the SNMP agent.

getColumn

public java.util.List getColumn(java.lang.String mibName)
                         throws SNMPException
Retrieves all values from a column of an SNMP table.

Parameters:
mibName - The name of the column of the SNMP table.
Returns:
a List of SNMPValue objects representing the values found in the column.
Throws:
SNMPException - if an error occurs communicating with the SNMP agent.

getTable

public java.util.Map getTable(java.lang.String mibName,
                              int index)
                       throws SNMPException
Throws:
SNMPException

getBulk

public java.util.List getBulk(java.lang.String mibName)
                       throws SNMPException
Throws:
SNMPException

getTimeout

public long getTimeout()
Get the timeout value for this session.

Returns:
The timeout value for this session.

setTimeout

public void setTimeout(long timeout)
Set the timeout value for this session.

Parameters:
timeout - The timeout value for this session.

getRetries

public int getRetries()
Get the retries value for this session.

Returns:
The retries value for this session.

setRetries

public void setRetries(int retries)
Set the retries value for this session.

Parameters:
retries - The retries value for this session.

close

public void close()
Closes the session. This should be called to clean up any resources used by the session when it is no longer needed.


Hyperic HQ Plugin API v. 2.5.dev

Copyright © 2004-2005 Hyperic LLC support@hyperic.net, All Rights Reserved.