org.joone.net
Class NetCheck

java.lang.Object
  extended by org.joone.net.NetCheck
All Implemented Interfaces:
java.lang.Comparable

public class NetCheck
extends java.lang.Object
implements java.lang.Comparable

Class to represent a network validation check error. NetChecks of FATAL severity prevent the network from running, NetChecks of WARNING severity do not.


Field Summary
static int FATAL
          Fatal check severity.
static int WARNING
          Non-fatal check severity.
 
Constructor Summary
NetCheck(int severityArg, java.lang.String messageArg, java.lang.Object objectArg)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          Method to order by message when in TreeSet.
 java.lang.String getMessage()
          Getter for the error message
 int getSeverity()
          Getter for the error severity
 java.lang.Object getSource()
          Getter for the object that caused the error
 boolean isFatal()
          Method to see if this check is a FATAL.
 boolean isWarning()
          Method to see if this check is a WARNING.
 void setMessage(java.lang.String message)
          Setter for the error message
 void setSeverity(int severity)
          Setter for the error severity
 void setSource(java.lang.Object source)
          Setter for the object that caused the error
 java.lang.String toString()
          Produce a String representation of the check.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FATAL

public static final int FATAL
Fatal check severity.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Non-fatal check severity.

See Also:
Constant Field Values
Constructor Detail

NetCheck

public NetCheck(int severityArg,
                java.lang.String messageArg,
                java.lang.Object objectArg)
Constructor.

Parameters:
severityArg - the severity of the check. Should be FATAL or WARNING.
messageArg - the message assosiated with the check.
objectArg - the network component producing the check.
Method Detail

toString

public java.lang.String toString()
Produce a String representation of the check.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the check.

isWarning

public boolean isWarning()
Method to see if this check is a WARNING.

Returns:
true if warning.

isFatal

public boolean isFatal()
Method to see if this check is a FATAL.

Returns:
true if error.

compareTo

public int compareTo(java.lang.Object o)
Method to order by message when in TreeSet.

Specified by:
compareTo in interface java.lang.Comparable
Returns:
true if error.

getSource

public java.lang.Object getSource()
Getter for the object that caused the error

Returns:
the source object

setSource

public void setSource(java.lang.Object source)
Setter for the object that caused the error

Parameters:
source - the source object

getMessage

public java.lang.String getMessage()
Getter for the error message

Returns:
the error message

setMessage

public void setMessage(java.lang.String message)
Setter for the error message

Parameters:
message - the error message

getSeverity

public int getSeverity()
Getter for the error severity

Returns:
the error severity (either NetCheck.FATAL or NetCheck.WARNING)

setSeverity

public void setSeverity(int severity)
Setter for the error severity

Parameters:
severity - the error severity (either NetCheck.FATAL or NetCheck.WARNING)


Submit Feedback to pmarrone@users.sourceforge.net