com.mccrory.scott.spumoni
Class StatsValue

java.lang.Object
  |
  +--com.mccrory.scott.spumoni.StatsValue

public class StatsValue
extends java.lang.Object

StatsValue is a data object for a statistics program's single value. It also contains related attributes such as name, value, SNMP OID, trap min and trap max.

Version:
CVS $Id: StatsValue.java,v 1.8 2002/08/04 22:04:53 smccrory Exp $
Author:
Scott McCrory.

Constructor Summary
StatsValue()
          Basic StatsValue constructor.
StatsValue(java.lang.String newValueName, java.lang.String newSnmpOid, int newSnmpTrapMin, int newSnmpTrapMax)
          A convenience StatsValue contructor to set all of the data elements at time of creation.
 
Method Summary
 java.lang.Object clone()
          We override the clone method here to prevent cloning of our class.
 java.lang.String getSnmpOid()
          Returns the SNMP OID.
 int getSnmpTrapMax()
          Returns the max acceptable value before an SMTP trap is sent.
 int getSnmpTrapMin()
          Returns the min acceptable value before an SMTP trap is sent.
 java.lang.String getValue()
          Gets the program value's actual collected value.
 java.lang.String getValueName()
          Returns the value name.
 boolean isUnset()
          Returns whether value is unset.
 void setSnmpOid(java.lang.String newSnmpOid)
          Sets the SNMP OID.
 void setSnmpTrapMax(int newSnmpTrapMax)
          Sets the max acceptable value before an SMTP trap is sent.
 void setSnmpTrapMin(int newSnmpTrapMin)
          Sets the min acceptable value before an SMTP trap is sent.
 void setValue(java.lang.String newValue)
          Sets the program value's actual collected value.
 void setValueName(java.lang.String newValueName)
          Sets the value name.
 java.lang.String toString()
          Returns a formatted String of this object's values
 void unset()
          Unsets the value
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatsValue

public StatsValue()
Basic StatsValue constructor.


StatsValue

public StatsValue(java.lang.String newValueName,
                  java.lang.String newSnmpOid,
                  int newSnmpTrapMin,
                  int newSnmpTrapMax)
A convenience StatsValue contructor to set all of the data elements at time of creation.

Parameters:
newValueName - The name of this stats value
newSnmpOid - The SNMP OID
newSnmpTrapMin - The minimum value before sending an SNMP Trap
newSnmpTrapMax - The maximum value before sending an SNMP Trap
Method Detail

clone

public final java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException
We override the clone method here to prevent cloning of our class.

Overrides:
clone in class java.lang.Object
Returns:
Nothing ever really returned since we throw a CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException - To indicate cloning is not allowed

getSnmpOid

public java.lang.String getSnmpOid()
Returns the SNMP OID.

Returns:
java.lang.String

getSnmpTrapMax

public int getSnmpTrapMax()
Returns the max acceptable value before an SMTP trap is sent.

Returns:
int

getSnmpTrapMin

public int getSnmpTrapMin()
Returns the min acceptable value before an SMTP trap is sent.

Returns:
int

getValue

public java.lang.String getValue()
Gets the program value's actual collected value.

Returns:
java.lang.String

getValueName

public java.lang.String getValueName()
Returns the value name.

Returns:
java.lang.String

isUnset

public boolean isUnset()
Returns whether value is unset.

Returns:
boolean

setSnmpOid

public void setSnmpOid(java.lang.String newSnmpOid)
Sets the SNMP OID.

Parameters:
newSnmpOid - java.lang.String

setSnmpTrapMax

public void setSnmpTrapMax(int newSnmpTrapMax)
Sets the max acceptable value before an SMTP trap is sent.

Parameters:
newSnmpTrapMax - int

setSnmpTrapMin

public void setSnmpTrapMin(int newSnmpTrapMin)
Sets the min acceptable value before an SMTP trap is sent.

Parameters:
newSnmpTrapMin - int

setValue

public void setValue(java.lang.String newValue)
Sets the program value's actual collected value.

Parameters:
newValue - java.lang.String

setValueName

public void setValueName(java.lang.String newValueName)
Sets the value name.

Parameters:
newValueName - java.lang.String

toString

public java.lang.String toString()
Returns a formatted String of this object's values

Overrides:
toString in class java.lang.Object
Returns:
java.lang.String

unset

public void unset()
Unsets the value



Copyright © 2002 Scott McCrory as part of the Spumoni project. All Rights Reserved.