com.ibm.websphere.brb.mgmt
Class ErrorMessage

java.lang.Object
  |
  +--com.ibm.websphere.brb.mgmt.ErrorMessage
All Implemented Interfaces:
java.io.Serializable

public class ErrorMessage
extends java.lang.Object
implements java.io.Serializable

This class represents an error message intended to be displayed to the user. A particular ErrorMessage object can represent either a warning or a serious error. The type for a particular ErrorMessage can be obtained using the getMessageType() method. The text for the message can be obtained using either the getMessageText() method or the toString() method. For ErrorMessages returned by BRBeans, this text will be translated and formatted for the default system locale. There is also an error code associated with each ErrorMessage that can be used to programmatically determine what the error was. This can be obtained using the getErrorCode() method.

See Also:
Serialized Form

Field Summary
static int CODE_BOTH_CLASSIFIER_AND_CLASSIFIED
          Error code constant indicating that the rule is marked as both a classifier rule and a classified rule.
static int CODE_NO_RULE_IMPLEMENTOR
          Error code constant indicating that the rule has no Java rule implementor name.
static int CODE_RULE_HAS_NO_START_DATE
          Error code constant indicating that the rule has no start date.
static int CODE_START_IS_AFTER_END
          Error code constant indicating that the rule's start date is after its end date.
static int CODE_UNKNOWN
          Error code constant indicating that the error code is not set.
static int ERROR_MESSAGE
          Message type constant indicating that this object represents a serious error.
static int WARNING_MESSAGE
          Message type constant indicating that this object represents a warning.
 
Constructor Summary
ErrorMessage(java.lang.String inMessageText, int inMessageType)
          ErrorMessage constructor allowing the message text and message type to be set.
ErrorMessage(java.lang.String inMessageText, int inMessageType, int inErrorCode)
          ErrorMessage constructor allowing the message text, message type, and error code to be set.
 
Method Summary
 int getErrorCode()
          Get the error code for this error.
 java.lang.String getMessageText()
          Get the message text to be displayed to the user.
 int getMessageType()
          Get the message type.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_MESSAGE

public static final int ERROR_MESSAGE
Message type constant indicating that this object represents a serious error.

WARNING_MESSAGE

public static final int WARNING_MESSAGE
Message type constant indicating that this object represents a warning.

CODE_UNKNOWN

public static final int CODE_UNKNOWN
Error code constant indicating that the error code is not set.

CODE_RULE_HAS_NO_START_DATE

public static final int CODE_RULE_HAS_NO_START_DATE
Error code constant indicating that the rule has no start date.

CODE_START_IS_AFTER_END

public static final int CODE_START_IS_AFTER_END
Error code constant indicating that the rule's start date is after its end date.

CODE_BOTH_CLASSIFIER_AND_CLASSIFIED

public static final int CODE_BOTH_CLASSIFIER_AND_CLASSIFIED
Error code constant indicating that the rule is marked as both a classifier rule and a classified rule.

CODE_NO_RULE_IMPLEMENTOR

public static final int CODE_NO_RULE_IMPLEMENTOR
Error code constant indicating that the rule has no Java rule implementor name.
Constructor Detail

ErrorMessage

public ErrorMessage(java.lang.String inMessageText,
                    int inMessageType)
ErrorMessage constructor allowing the message text and message type to be set.
Parameters:
inMessageText - Text to be returned by getMessageText(). The ErrorMessage object does not do any formatting of this text. getMessageText() returns it as it is passed in.
inMessageType - Type of message. Valid values are ERROR_MESSAGE and WARNING_MESSAGE.

ErrorMessage

public ErrorMessage(java.lang.String inMessageText,
                    int inMessageType,
                    int inErrorCode)
ErrorMessage constructor allowing the message text, message type, and error code to be set.
Parameters:
inMessageText - Text to be returned by getMessageText(). The ErrorMessage object does not do any formatting of this text. getMessageText() returns it as it is passed in.
inMessageType - Type of message. Valid values are ERROR_MESSAGE and WARNING_MESSAGE.
inErrorCode - Code indicating what error this object represents.
Method Detail

getErrorCode

public int getErrorCode()
Get the error code for this error. This is an int that indicates what the error was. Valid values are defined above.
Returns:
The error code.

getMessageText

public java.lang.String getMessageText()
Get the message text to be displayed to the user. For all ErrorMessages created by BRBeans, this text will be formatted for the default system locale.
Returns:
The message text.

getMessageType

public int getMessageType()
Get the message type. Possible values are ERROR_MESSAGE and WARNING_MESSAGE.
Returns:
The message type.

toString

public java.lang.String toString()
Returns a String that represents the value of this object. For ErrorMessage this is the message text.
Overrides:
toString in class java.lang.Object
Returns:
The message text.