com.sap.netweaver.bc.uwl

Class ErrorMessages

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.ErrorMessages

public final class ErrorMessages
extends Object

The ErrorMessages class contains error codes and error categories. Most of these are used for logging purposes by the UWL service. The texts are in English and are not internationalized.


Nested Class Summary
static class ErrorMessages.Codes
          The Codes class defines a bunch of error codes.
 
Field Summary
static int CAT_ADMIN
          Every exception must have an error category and error code.
static int CAT_CACHE
          Every exception must have an error category and error code.
static int CAT_CONFIGURATION
          Every exception must have an error category and error code.
static int CAT_CONNECTOR
          Every exception must have an error category and error code.
static int CAT_DATABASE
          Every exception must have an error category and error code.
static int CAT_DEFAULT
          Every exception must have an error category and error code.
static int CAT_ITEM
          Every exception must have an error category and error code.
static int CAT_KM
          Every exception must have an error category and error code.
static int CAT_PORTAL
          Every exception must have an error category and error code.
static int CAT_SUBSTITUTION
          Every exception must have an error category and error code.
static int CAT_UM
          Every exception must have an error category and error code.
 
Method Summary
static ErrorMessages getInstance()
          This is a factory method provided in order to preserve the property of being a singleton.
 String getMessage(int category, int code)
          This returns the message which is a blend of category and code.
 String getMessage(int code, Object[] args)
          Retrieve message from message code.
 String getMessage(int code, String arg1)
          Retrieve message from message code.
 int getNumCodes()
           
static String staticGetMessage(int code, String arg1)
          Retrieve message from message code.
static String staticGetMessageArgs(int code, Object[] args)
          Retrieve message from message code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAT_DEFAULT

public static final int CAT_DEFAULT
Every exception must have an error category and error code. This is the default category. If the request for a category falls out of the specified range, this default category is assumed. Currently, as of November 13, 2003, the range is between 0 and 9.

See Also:
Constant Field Values

CAT_DATABASE

public static final int CAT_DATABASE
Every exception must have an error category and error code. This is related to database.

See Also:
Constant Field Values

CAT_CACHE

public static final int CAT_CACHE
Every exception must have an error category and error code. This is related to cache.

See Also:
Constant Field Values

CAT_CONFIGURATION

public static final int CAT_CONFIGURATION
Every exception must have an error category and error code. This is related to configuration.

See Also:
Constant Field Values

CAT_CONNECTOR

public static final int CAT_CONNECTOR
Every exception must have an error category and error code. This is related to connector.

See Also:
Constant Field Values

CAT_ITEM

public static final int CAT_ITEM
Every exception must have an error category and error code. This is related to Item.

See Also:
Constant Field Values

CAT_UM

public static final int CAT_UM
Every exception must have an error category and error code. This is related to user management.

See Also:
Constant Field Values

CAT_KM

public static final int CAT_KM
Every exception must have an error category and error code. This is related to knowledge management.

See Also:
Constant Field Values

CAT_ADMIN

public static final int CAT_ADMIN
Every exception must have an error category and error code. This is related to administration.

See Also:
Constant Field Values

CAT_PORTAL

public static final int CAT_PORTAL
Every exception must have an error category and error code. This is related to portals.

See Also:
Constant Field Values

CAT_SUBSTITUTION

public static final int CAT_SUBSTITUTION
Every exception must have an error category and error code. This is related to portals.

See Also:
Constant Field Values
Method Detail

getInstance

public static ErrorMessages getInstance()
This is a factory method provided in order to preserve the property of being a singleton.

Returns:
ErrorMessages the one and only instance of this class.

getMessage

public String getMessage(int category,
                         int code)
This returns the message which is a blend of category and code.

Parameters:
category - one of the categories like database, configuration, connector, etc.
code - one of the codes like " Item not found in the cache ", " Invalid content type for attachment", ETC.
Returns:
String a concatenated message of category and code. If the category is out of range, default category is assumed. If code is out of range, an empty string is added.

getMessage

public String getMessage(int code,
                         Object[] args)
Retrieve message from message code. Format message with multiple placeholders with the arguments provided. Caller should use this carefully, according to Java specs for message formatting. Message pattern should have the corresponding placeholders, and the maximum number of placeholders are 10. Otherwise, runtime exception 'IllegalArgumentException' will be thrown.

Parameters:
code - Error message code
args - argument values for placeholder
Returns:
Formatted message

getMessage

public String getMessage(int code,
                         String arg1)
Retrieve message from message code. Format message with a single placeholder with the single argument provided or return message with argument appended at the end if no placeholder available. If the argument is null, return the message from the message code as is.

Parameters:
code - Error message code
arg1 - argument for placeholder
Returns:
Resolved message

staticGetMessage

public static String staticGetMessage(int code,
                                      String arg1)
Retrieve message from message code. Format message with a single placeholder with the single argument provided or return message with argument appended at the end if no placeholder available. If the argument is null, return the message from the message code as is.

Parameters:
code - Error message code
arg1 - argument for placeholder
Returns:
Resolved message

staticGetMessageArgs

public static String staticGetMessageArgs(int code,
                                          Object[] args)
Retrieve message from message code. Format message with multiple placeholders with the arguments provided. Caller should use this carefully, according to Java specs for message formatting. Message pattern should have the corresponding placeholders, and the maximum number of placeholders are 10. Otherwise, runtime exception 'IllegalArgumentException' will be thrown.

Parameters:
code - Error message code
args - argument values for placeholder
Returns:
Formatted message

getNumCodes

public int getNumCodes()


Copyright 2006 SAP AG Complete Copyright Notice