snmpmonitor
Class Options

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

public class Options
extends java.lang.Object


Constructor Summary
Options(java.lang.String args)
          Create an Options object based on a single string that represents an arguments vector.
Options(java.lang.String[] argv)
          Create an Options object based on the arguments vector.
 
Method Summary
 int getInterval()
          Get the interval.
 Peer[] getPeers()
          Get an array of the SNMP peers.
 long getThreshold(java.lang.String name)
          Get threshold (-t name=value) of type long for the attribute "name".
 void parse(java.lang.String[] argv)
          TODO
 void setThreshold(java.lang.String name, long value)
          Set threshold long value for a given threshold name.
 void setThresholdDefault(java.lang.String name, long value)
          Set threshold long value for a given threshold name if it is not yet set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Options

public Options(java.lang.String[] argv)
        throws java.text.ParseException,
               java.lang.StringIndexOutOfBoundsException,
               java.net.UnknownHostException,
               java.net.SocketException
Create an Options object based on the arguments vector. Implicitly SNMP peers are setup for all SNMP peers given in the args array. All the work is done in parse().
Parameters:
args - The arguments passed.

Options

public Options(java.lang.String args)
        throws java.text.ParseException,
               java.lang.StringIndexOutOfBoundsException,
               java.net.UnknownHostException,
               java.net.SocketException
Create an Options object based on a single string that represents an arguments vector. Implicitly SNMP connections are setup for all SNMP peers given in the args array. All the work is done in parse().
Parameters:
args - The arguments passed.
Method Detail

parse

public void parse(java.lang.String[] argv)
           throws java.text.ParseException,
                  java.lang.StringIndexOutOfBoundsException,
                  java.net.UnknownHostException,
                  java.net.SocketException
TODO
Parameters:
argv - The arguments passed.

getThreshold

public long getThreshold(java.lang.String name)
Get threshold (-t name=value) of type long for the attribute "name".
Parameters:
name - The name of the threshold attribute.
Returns:
The long threshold value.

setThreshold

public void setThreshold(java.lang.String name,
                         long value)
Set threshold long value for a given threshold name.
Parameters:
name - The name of the threshold attribute.
value - The long threshold value.

setThresholdDefault

public void setThresholdDefault(java.lang.String name,
                                long value)
Set threshold long value for a given threshold name if it is not yet set. This is useful to set default values after an options object has been initialized and parsed.
Parameters:
name - The name of the threshold attribute.
value - The long threshold value.

getInterval

public int getInterval()
Get the interval.
Returns:
The interval in seconds.

getPeers

public Peer[] getPeers()
Get an array of the SNMP peers. They have already been set up within the constructor.
Returns:
The array of Peer objects.