Remote Systems
v6.4.1

com.ibm.etools.systems.core.messages
Class SystemMessage

java.lang.Object
  extended bycom.ibm.etools.systems.core.messages.SystemMessage
Direct Known Subclasses:
SystemUIMessage

public class SystemMessage
extends Object

Error message window class.


Field Summary
static char COMPLETION
          Completion message indicator (added by DWD)
static String copyright
           
static char ERROR
          Error message indicator
static char INFORMATION
          Information message indicator
static char INQUIRY
          Inquiry message indicator
protected static String NESTING_INDENT
           
static char UNEXPECTED
          Unexpected message indicator (same as warning but will log exception & stack in message log)
static char WARNING
          Warning message indicator
 
Constructor Summary
SystemMessage(String comp, String sub, String number, char ind, String l1, String l2)
          SystemMesssage constructor Throws: IndicatorException: the indicator specified is not a valid indicator
 
Method Summary
 String getComponent()
           
 String getFullMessageID()
          Use this method to retrieve the full message ID: Component + SubComponent + Number + indicator
 char getIndicator()
          Use this method to get the severity.
 String getLevelOneText()
          Use this method to retrieve level one text
 String getLevelTwoText()
          Use this method to retrieve level two text
 String getLongMessageID()
          Use this method to retrieve 'long' message ID format: Component + SubComponent + Number.
 String getMessageID()
          Use this method to retrieve 'standard' message ID format: Component + Number
 String getMessageNumber()
           
 int getNumSubstitutionVariables()
          Use this method to retrieve the unique number of substitution variables in this message (this would include level 1 and 2 text
 String getSubComponent()
           
 String getSubValue(Object sub)
          used to determine the string value of the object it calls toString for all object types except for Exceptions where the stack is also rendered
 Object[] getSubVariables()
          retrieves an array of substitution variables
 boolean hasLongID(String messageId)
          Tests if this message has a long id equal to the one supplied in the argument.
 SystemMessage makeSubstitution(Object sub1)
          Use this method to set substitution value %1.
 SystemMessage makeSubstitution(Object[] subsList)
          Use this method to set substitution values
Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.
 SystemMessage makeSubstitution(Object sub1, Object sub2)
          Use this method to set substitution value %1 %2
Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.
 SystemMessage makeSubstitution(Object sub1, Object sub2, Object sub3)
          Use this method to set substitution value %1 %2 %3
Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.
 SystemMessage makeSubstitution(Object sub1, Object sub2, Object sub3, Object sub4)
          Use this method to set substitution value %1 %2 %3 %4
Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.
 void setIndicator(char ind)
          Use this method to override the default severity of a message Throws SeverityException if the severity is not valid
 void setPrefixChar(char prefixChar)
           
static String sub(String msg, String subOld, String subNew)
          Do message variable substitution.
 String toString()
          Convert this message to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

COMPLETION

public static final char COMPLETION
Completion message indicator (added by DWD)

See Also:
Constant Field Values

INQUIRY

public static final char INQUIRY
Inquiry message indicator

See Also:
Constant Field Values

INFORMATION

public static final char INFORMATION
Information message indicator

See Also:
Constant Field Values

ERROR

public static final char ERROR
Error message indicator

See Also:
Constant Field Values

WARNING

public static final char WARNING
Warning message indicator

See Also:
Constant Field Values

UNEXPECTED

public static final char UNEXPECTED
Unexpected message indicator (same as warning but will log exception & stack in message log)

See Also:
Constant Field Values

NESTING_INDENT

protected static final String NESTING_INDENT
See Also:
Constant Field Values
Constructor Detail

SystemMessage

public SystemMessage(String comp,
                     String sub,
                     String number,
                     char ind,
                     String l1,
                     String l2)
              throws IndicatorException
SystemMesssage constructor

Throws:

  • IndicatorException: the indicator specified is not a valid indicator

  • Method Detail

    setIndicator

    public void setIndicator(char ind)
                      throws IndicatorException
    Use this method to override the default severity of a message Throws SeverityException if the severity is not valid

    Throws:
    IndicatorException

    getIndicator

    public char getIndicator()
    Use this method to get the severity. Will be one of:


    getMessageNumber

    public String getMessageNumber()
    Returns:
    the message number of this message.

    getComponent

    public String getComponent()
    Returns:
    the component of this message.

    getSubComponent

    public String getSubComponent()
    Returns:
    the subcomponent of this message.

    getNumSubstitutionVariables

    public int getNumSubstitutionVariables()
    Use this method to retrieve the unique number of substitution variables in this message (this would include level 1 and 2 text

    Returns:
    (int) number of unique substitution variables variables

    getLevelOneText

    public String getLevelOneText()
    Use this method to retrieve level one text

    Returns:
    String - level one text with subsitutions made.

    getLevelTwoText

    public String getLevelTwoText()
    Use this method to retrieve level two text

    Returns:
    String - level two text with subsitutions made.

    getFullMessageID

    public String getFullMessageID()
    Use this method to retrieve the full message ID: Component + SubComponent + Number + indicator

    Returns:
    String - the full message ID

    getLongMessageID

    public String getLongMessageID()
    Use this method to retrieve 'long' message ID format: Component + SubComponent + Number. The long message ID is used for retrieving messages from a message file.

    Returns:
    String - the long message ID

    getMessageID

    public String getMessageID()
    Use this method to retrieve 'standard' message ID format: Component + Number

    Returns:
    String - the full message ID

    hasLongID

    public boolean hasLongID(String messageId)
    Tests if this message has a long id equal to the one supplied in the argument.

    Parameters:
    messageId - the long message id to compare against.
    Returns:
    a boolean indicating if the message ids are equal.

    makeSubstitution

    public SystemMessage makeSubstitution(Object sub1)
    Use this method to set substitution value %1.
    Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.


    makeSubstitution

    public SystemMessage makeSubstitution(Object sub1,
                                          Object sub2)
    Use this method to set substitution value %1 %2
    Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.


    makeSubstitution

    public SystemMessage makeSubstitution(Object sub1,
                                          Object sub2,
                                          Object sub3)
    Use this method to set substitution value %1 %2 %3
    Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.


    makeSubstitution

    public SystemMessage makeSubstitution(Object sub1,
                                          Object sub2,
                                          Object sub3,
                                          Object sub4)
    Use this method to set substitution value %1 %2 %3 %4
    Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.


    makeSubstitution

    public SystemMessage makeSubstitution(Object[] subsList)
    Use this method to set substitution values
    Generally toString() is used on the substitution objects, but there is special case handling for exception objects and IStatus objects.


    getSubVariables

    public Object[] getSubVariables()
    retrieves an array of substitution variables

    Returns:
    Object[] array of substitution variables used

    setPrefixChar

    public void setPrefixChar(char prefixChar)

    sub

    public static String sub(String msg,
                             String subOld,
                             String subNew)
    Do message variable substitution. Using you are replacing &1 (say) with a string. Still need this for non-message substitution capability. Phil.

    Parameters:
    subOld - - substitution variable. Eg "%1"
    subNew - - substitution data. Eg "001"
    Returns:
    message with all occurrences of subOld substituted with subNew.

    toString

    public String toString()
    Convert this message to a string. Returns string of the form: msgId + severity + ":" + first-level-text


    getSubValue

    public String getSubValue(Object sub)
    used to determine the string value of the object it calls toString for all object types except for Exceptions where the stack is also rendered

    Parameters:
    sub - the substitution object
    Returns:
    the string value for the object

    Remote Systems
    v6.4.1

    Copyright © 2005 IBM Corp. All Rights Reserved.

    Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.