org.tfe.core
Class Sensor

java.lang.Object
  |
  +--org.tfe.core.Sensor
All Implemented Interfaces:
AlertListObserver, java.io.Serializable

public class Sensor
extends java.lang.Object
implements java.io.Serializable, AlertListObserver

See Also:
Serialized Form

Field Summary
static SensorList sensorList
           
 
Constructor Summary
Sensor(java.lang.String name)
          Creates new Sensor with null initialized values and ignore set to "true".
Sensor(java.lang.String name, java.lang.String locString, java.lang.String description, java.lang.String type, java.lang.String version, boolean ign, java.awt.Color color)
          Creates new Sensor
 
Method Summary
 void addObserver(SensorObserver observer)
           
 void alertAdded(Alert alert)
           
 void alertRemoved(int alertID)
           
 void alertUpdated(int alertID, Alert newVal)
           
 void allRemoved()
           
 void deleteObserver(SensorObserver observer)
           
protected  void finalize()
           
 Alert getAlert(int index)
          Gets an Alert at a specified index in the Sensor's Alert list.
 int getAlertCount()
          Gets the total number of Alerts that this Sensor has reported.
 java.awt.Color getColor()
          Gets the color of this Sensor.
 java.lang.String getDescription()
          Gets the Sensor's description.
 java.lang.String getHostName()
          Gets the Sensor's hostname.
 Alert getLastAlert()
          Gets the last alert that was added to the Sensor's Alert list.
 java.lang.String getLocation()
          Gets the Sensor's location.
 java.lang.String getNotes()
          Gets the notes associated with this Sensor.
 java.lang.String getPOCAddress()
          Gets the address of the POC for this Sensor.
 java.lang.String getPOCName()
          Gets the name of the POC for this Sensor.
 java.lang.String getPOCPhone()
          Gets the phone number of the POC for this Sensor.
 java.lang.String getType()
          Gets the Sensor's type.
 java.lang.String getVersion()
          Gets the Sensor's version.
 boolean hasAlert(Alert alert)
          Checks to see if the specified Alert belongs to this Sensor.
 boolean isIgnored()
          Gets whether or not the Sensor is ignored.
 void setColor(java.awt.Color color)
          Sets the color of this Sensor.
 void setDescription(java.lang.String desc)
          Sets the Sensor's description.
 void setHostName(java.lang.String name)
          Sets the Sensor's hostname.
 void setIgnored(boolean ign)
          Set whether or not to ignore Alerts from this Sensor.
 void setLocation(java.lang.String loc)
          Sets the Sensor's location.
 void setNotes(java.lang.String notes)
          Sets the notes associated with this Sensor.
 void setPOCAddress(java.lang.String pocaddress)
          Sets the address of the POC for this Sensor.
 void setPOCName(java.lang.String pocname)
          Sets the name of the POC for this Sensor.
 void setPOCPhone(java.lang.String pocphone)
          Sets the phone number of the POC for this Sensor.
 void setType(java.lang.String type)
          Sets the Sensor's type.
 void setVersion(java.lang.String version)
          Sets the Sensor's version.
 java.lang.String toString()
          Gets a String representation of this Sensor.
 java.lang.String[] toSummary()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sensorList

public static final SensorList sensorList
Constructor Detail

Sensor

public Sensor(java.lang.String name,
              java.lang.String locString,
              java.lang.String description,
              java.lang.String type,
              java.lang.String version,
              boolean ign,
              java.awt.Color color)
Creates new Sensor

Parameters:
name - the name of the Sensor.
locString - the location of the Sensor.
description - a description of the Sensor.
type - the Sensor's type.
version - the version or revision number of the Sensor.
ign - whether or not to ignore Alerts received from this Sensor.
color - the color to be used when graphically representing this Sensor.

Sensor

public Sensor(java.lang.String name)
Creates new Sensor with null initialized values and ignore set to "true". This is the constructor that is called when a sensor is inadvertently discovered that the user wishes to ignore.

Parameters:
name - the name of the Sensor.
Method Detail

getHostName

public java.lang.String getHostName()
Gets the Sensor's hostname.

Returns:
the String value of the Sensor's hostname.

setHostName

public void setHostName(java.lang.String name)
Sets the Sensor's hostname.

Parameters:
name - the String value of the Sensor's hostname.

getLocation

public java.lang.String getLocation()
Gets the Sensor's location.

Returns:
the String value of the Sensor's location.

setLocation

public void setLocation(java.lang.String loc)
Sets the Sensor's location.

Parameters:
loc - the String value of the Sensor's location.

getDescription

public java.lang.String getDescription()
Gets the Sensor's description.

Returns:
the String value of the Sensor's description.

setDescription

public void setDescription(java.lang.String desc)
Sets the Sensor's description.

Parameters:
desc - the String value of the Sensor's description.

getType

public java.lang.String getType()
Gets the Sensor's type.

Returns:
the String value of the Sensor's type.

setType

public void setType(java.lang.String type)
Sets the Sensor's type.

Parameters:
type - the String value of the Sensor's type.

getVersion

public java.lang.String getVersion()
Gets the Sensor's version.

Returns:
the String value of the Sensor's version.

setVersion

public void setVersion(java.lang.String version)
Sets the Sensor's version.

Parameters:
version - the String value of the Sensor's version.

isIgnored

public boolean isIgnored()
Gets whether or not the Sensor is ignored.

Returns:
true if ignored, false if not ignored.

setIgnored

public void setIgnored(boolean ign)
Set whether or not to ignore Alerts from this Sensor.

Parameters:
ign - whether or not to ignore Alerts from this Sensor.

getLastAlert

public Alert getLastAlert()
Gets the last alert that was added to the Sensor's Alert list.

Returns:
the last Alert that the Sensor received, null if it has not received any.

getAlert

public Alert getAlert(int index)
Gets an Alert at a specified index in the Sensor's Alert list.

Parameters:
index - the index of the Alert to be retrieved.
Returns:
the Alert at the specified index.

hasAlert

public boolean hasAlert(Alert alert)
Checks to see if the specified Alert belongs to this Sensor.

Parameters:
alert - the Alert that we're looking for.
Returns:
true if it belongs to this Sensor, false if it does not.

getAlertCount

public int getAlertCount()
Gets the total number of Alerts that this Sensor has reported.

Returns:
an integer value of the number of Alerts that this Sensor has reported.

getColor

public java.awt.Color getColor()
Gets the color of this Sensor.

Returns:
the color value of this Sensor.

setColor

public void setColor(java.awt.Color color)
Sets the color of this Sensor.

Parameters:
color - the color of this Sensor.

getPOCName

public java.lang.String getPOCName()
Gets the name of the POC for this Sensor.

Returns:
String value of the name of this Sensor's POC.

setPOCName

public void setPOCName(java.lang.String pocname)
Sets the name of the POC for this Sensor.

Parameters:
pocname - the name of the POC for this Sensor.

getPOCAddress

public java.lang.String getPOCAddress()
Gets the address of the POC for this Sensor.

Returns:
the address of the POC for this Sensor.

setPOCAddress

public void setPOCAddress(java.lang.String pocaddress)
Sets the address of the POC for this Sensor.

Parameters:
pocaddress - the address of the POC for this Sensor.

getPOCPhone

public java.lang.String getPOCPhone()
Gets the phone number of the POC for this Sensor.

Returns:
the phone number of the POC for this Sensor.

setPOCPhone

public void setPOCPhone(java.lang.String pocphone)
Sets the phone number of the POC for this Sensor.

Parameters:
pocphone - the phone number of the POC for this Sensor.

getNotes

public java.lang.String getNotes()
Gets the notes associated with this Sensor.

Returns:
the notes associated with this Sensor.

setNotes

public void setNotes(java.lang.String notes)
Sets the notes associated with this Sensor.

Parameters:
notes - the notes associated with this Sensor.

toString

public java.lang.String toString()
Gets a String representation of this Sensor.

Overrides:
toString in class java.lang.Object

toSummary

public java.lang.String[] toSummary()

alertAdded

public void alertAdded(Alert alert)
Specified by:
alertAdded in interface AlertListObserver

alertRemoved

public void alertRemoved(int alertID)
Specified by:
alertRemoved in interface AlertListObserver

alertUpdated

public void alertUpdated(int alertID,
                         Alert newVal)
Specified by:
alertUpdated in interface AlertListObserver

allRemoved

public void allRemoved()
Specified by:
allRemoved in interface AlertListObserver

addObserver

public void addObserver(SensorObserver observer)

deleteObserver

public void deleteObserver(SensorObserver observer)

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object