Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.services.clientserver.messages
Class SystemMessage


java.lang.Object
  extended by 
org.eclipse.rse.services.clientserver.messages.SystemMessage
Direct Known Subclasses:
SimpleSystemMessage, SystemUIMessage

public class SystemMessage
extends Object

SystemMessage is used to supply detailed status when an error or other significant event occurs that should be presented to the user or logged. It is structured to capture information from a variety of remote systems.


Field Summary
static char COMPLETION
          Completion message indicator
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 getFullMessageID ()
          Use this method to retrieve the full message ID: Component + SubComponent + Number + indicator
 char getIndicator ()
          Use this method to get the message type indicator.
  String getLevelOneText ()
          Use this method to retrieve level one text
  String getLevelTwoText ()
          Use this method to retrieve level two text
  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 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
  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 indicator of the message
 void setPrefixChar (char prefixChar)
           
static  String sub ( String target, String subOld, String subNew)
          Replace a string with another string throughout a target string.
  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

COMPLETION

public static final char COMPLETION
Completion message indicator

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)
SystemMesssage constructor

Throws:

  • IndicatorException: the indicator specified is not a valid indicator

    Parameters:
    comp - Component code. Usually a 3 letter component code like "RSE".
    sub - Subcomponent code. Usually a 1 letter subcomponent such as "F" for files
    ind - Message type indicator. See constants for values.
    number - a string that gives the 4 digit message number
    l1 - Level 1 text that describes the error
    l2 - Level 2 text that describes any recovery actions or further details
  • Method Detail

    setIndicator

    public void setIndicator(char ind)
                      throws 
    IndicatorException
    
    Use this method to override the default indicator of the message

    Parameters:
    ind - the new indicator. See constants for values.
    Throws:
    IndicatorException - if the indicator is not valid

    getIndicator

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

    Returns:
    the indicator for this message.

    getMessageNumber

    public 
    String getMessageNumber()
    Returns:
    the message number 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

    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.

    Parameters:
    sub1 - the substitution object for the first value.
    Returns:
    the SystemMessage being operated on.

    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.

    Parameters:
    sub1 - the substitution object for the first value.
    sub2 - the substitution object for the second value.
    Returns:
    the SystemMessage being operated on.

    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.

    Parameters:
    sub1 - the substitution object for the first value.
    sub2 - the substitution object for the second value.
    sub3 - the substitution object for the third value.
    Returns:
    the SystemMessage being operated on.

    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.

    Parameters:
    sub1 - the substitution object for the first value.
    sub2 - the substitution object for the second value.
    sub3 - the substitution object for the third value.
    sub4 - the substitution object for the fourth value.
    Returns:
    the SystemMessage being operated on.

    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.

    Parameters:
    subsList - the array of substitution objects
    Returns:
    the SystemMessage being operated on.

    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 target,
                             
    String subOld,
                             
    String subNew)
    Replace a string with another string throughout a target string.

    Parameters:
    target - - string containing substring to be substituted.
    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

    Overrides:
    toString in class Object

    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

    RSE
    Release 3.0

    Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

     
     
      Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire