org.rhq.plugins.www.snmp
Interface SNMPSession


public interface SNMPSession

Generic interface for any version of the SNMP protocol. Use SNMPClient.getSession(java.lang.String, java.lang.Integer, java.lang.String, org.rhq.plugins.www.snmp.SNMPClient.SNMPVersion) to get an instance of a class that implements this interface.


Method Summary
 void close()
          Closes the session and all underlying resources.
 java.util.List<SNMPValue> getBulk(java.lang.String mibName)
          TODO
 java.util.List<SNMPValue> getColumn(java.lang.String mibName)
          Retrieves all values from a column of an SNMP table (i.e.
 SNMPValue getNextValue(java.lang.String mibName)
          Retrieve the variable that logically next after the specified MIB name or OID.
 int getRetries()
          Get the retries value for this session.
 SNMPValue getSingleValue(java.lang.String mibName)
          Retrieves the variable with the the specified MIB name or OID.
 java.util.Map<java.lang.String,SNMPValue> getTable(java.lang.String mibName, int index)
          TODO
 long getTimeout()
          Get the timeout value for this session.
 boolean ping()
          Pings the agent associated with this session to see if it is responsive.
 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

@NotNull
SNMPValue getSingleValue(java.lang.String mibName)
                         throws SNMPException
Retrieves the variable with the the specified MIB name or OID.

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

@NotNull
SNMPValue getNextValue(java.lang.String mibName)
                       throws SNMPException
Retrieve the variable that logically next after the specified MIB name or OID.

Parameters:
mibName - the name of the MIB variable at which 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

@NotNull
java.util.List<SNMPValue> getColumn(java.lang.String mibName)
                                    throws SNMPException
Retrieves all values from a column of an SNMP table (i.e. returns the subtree of values rooted at the specified MIB name or OID).

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

@NotNull
java.util.Map<java.lang.String,SNMPValue> getTable(java.lang.String mibName,
                                                           int index)
                                                   throws SNMPException
TODO

Parameters:
mibName - the MIB name of the table
index -
Returns:
Throws:
SNMPException - if an error occurs communicating with the SNMP agent.

getBulk

@NotNull
java.util.List<SNMPValue> getBulk(java.lang.String mibName)
                                  throws SNMPException
TODO

Parameters:
mibName - the MIB name of the starting OID
Returns:
Throws:
SNMPException - if an error occurs communicating with the SNMP agent.

ping

boolean ping()
Pings the agent associated with this session to see if it is responsive.

Returns:
true if the agent responds, or false otherwise

getTimeout

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

Returns:
the timeout value for this session

setTimeout

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

Parameters:
timeout - the timeout value for this session

getRetries

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

Returns:
the retries value for this session

setRetries

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

Parameters:
retries - the retries value for this session

close

void close()
Closes the session and all underlying resources.



Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.