public class RMException
extends com.filenet.wcm.api.BaseRuntimeException
Records Manager supports use of localized strings for exception messages.
You can retrieve localized messages by calling the following methods on an
RMException
object:
getLocalizedMessage(Locale)
: This method retrieves the messages for
the specified locale.
getLocalizedMessage()
: This method retrieves the messages for the
locale specified by the Content Engine user context. If a locale
has not been set in user context, the method retrieves messages
using the server default locale.
For more information about the UserContext class, see the Content Engine Java API Reference.
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG |
static int |
ERROR |
static int |
FATAL |
static int |
HOLDSWEEPERROR |
static int |
HOLDSWEEPFATAL |
static java.lang.String |
IBM_PREFIX
The IBM Message Standard three-character prefix assigned to
IBM Enterprise Records products.
|
static int |
INFORMATION |
static java.lang.String |
MESSAGE_ID_PREFIX
The prefix string for all logging message id values.
|
static char |
MESSAGE_ID_SUFFIX
The Severity suffix character used for all
RMException
Message IDs. |
static int |
NOLOG |
static int |
RMEXCEPTION |
static int |
RMUNSUPPORTEDOPERATION_EXCEPTION |
static int |
SWEEPERROR |
static int |
SWEEPFATAL |
static java.lang.String |
SWG_ID
The IBM SWG Component Id assigned to the IBM Enterprise Records API.
|
static int |
WARNING |
Constructor and Description |
---|
RMException()
Constructs an
RMException object with a null message String . |
Modifier and Type | Method and Description |
---|---|
static RMException |
createRMException(int aiErrorMessageId,
int aiMessageType,
java.lang.Exception aoException,
java.lang.Object[] aoReplaceParams)
Returns for an exception of type ERROR or FATAL an
RMException object that
contains a localized message derived from the specified Exception
object. |
java.lang.String |
getLocalizedMessage()
Uses the locale specified in the Content Engine user context to return
a
String containing the localized message for this exception. |
java.lang.String |
getLocalizedMessage(java.util.Locale locale)
Uses the specified locale to return a
String containing the
localized message for this exception. |
java.lang.String |
getMessage()
Uses the default locale to return a
String containing the
localized message for this exception. |
static RMException |
getRMException(int aiErrorMessageId,
int aiMessageType,
java.lang.Exception aoException,
java.lang.Object[] aoReplaceParams)
Returns for an exception of type ERROR, SWEEPERROR, HOLDSWEEPERROR, SWEEPFATAL,
HOLDSWEEPFATAL, or FATAL an
RMException object that
contains a localized message derived from the specified Exception
object. |
void |
setLoggingFile(java.io.File aoFile)
Deprecated.
This method no longer performs any action.
|
static void |
setRMObjectStore(RMObjectStore aoRMObjectStore)
Deprecated.
This method no longer performs any action.
|
getFaultCode, setFaultCode, toString
public static final int RMEXCEPTION
public static final int RMUNSUPPORTEDOPERATION_EXCEPTION
public static final int FATAL
public static final int ERROR
public static final int WARNING
public static final int INFORMATION
public static final int DEBUG
public static final int NOLOG
public static final int SWEEPERROR
public static final int SWEEPFATAL
public static final int HOLDSWEEPERROR
public static final int HOLDSWEEPFATAL
public static final java.lang.String IBM_PREFIX
public static final java.lang.String SWG_ID
public static final java.lang.String MESSAGE_ID_PREFIX
public static final char MESSAGE_ID_SUFFIX
RMException
Message IDs.public RMException()
RMException
object with a null message String
.public final java.lang.String getMessage()
String
containing the
localized message for this exception.getMessage
in class java.lang.Throwable
String
containing the localized message.public java.lang.String getLocalizedMessage()
String
containing the localized message for this exception.
If a locale has not been set in user context, this method
uses the server default locale to retrieve the message.
This method overrides java.lang.Throwable.getLocalizedMessage
method.
getLocalizedMessage
in class java.lang.Throwable
String
containing the localized message.public java.lang.String getLocalizedMessage(java.util.Locale locale)
String
containing the
localized message for this exception.
This method overrides java.lang.Throwable.getLocalizedMessage
method.
locale
- A Java Locale
object specifying the locale
for which the message is to be returned.String
containing the localized message.public void setLoggingFile(java.io.File aoFile) throws java.io.IOException, java.lang.Exception
aoFile
- java.io.IOException
java.lang.Exception
public static void setRMObjectStore(RMObjectStore aoRMObjectStore) throws java.lang.Exception
aoRMObjectStore
- RMObjectStore passedjava.lang.Exception
- Exception Objectpublic static RMException getRMException(int aiErrorMessageId, int aiMessageType, java.lang.Exception aoException, java.lang.Object[] aoReplaceParams)
RMException
object that
contains a localized message derived from the specified Exception
object. This method, which uses the default locale to retrieve the message, also
records the message in the log file. In addition, the method throws the exception
for an exception of type ERROR, SWEEPERROR, or HOLDSWEEPERROR.
For exceptions of all other types, the method records a message derived from the specified
Exception
object in the log file. However, the method returns a null
instead of an RMException
object.
aiErrorMessageId
- An int
value specifying the message ID. This value is also used
as the ID for the new RMException
object.aiMessageType
- An int
value specifying the severity level represented
by this exception.aoException
- The Java Exception
object from which the localized message
is to be derived.aoReplaceParams
- An Object
array containing the values that are to replace the
parameters in the localized message.RMException
object for an exception of type ERROR, SWEEPERROR,
HOLDSWEEPERROR, SWEEPFATAL, HOLDSWEEPFATAL, or FATAL.
For all other exception types, returns a null
object.public static RMException createRMException(int aiErrorMessageId, int aiMessageType, java.lang.Exception aoException, java.lang.Object[] aoReplaceParams)
RMException
object that
contains a localized message derived from the specified Exception
object. This method, which uses the default locale to retrieve the message, also
records the message in the log file. In addition, the method throws the exception
for an exception of type ERROR, SWEEPERROR, or HOLDSWEEPERROR.
For exceptions of all other types, the method records a message derived from the specified
Exception
object in the log file. However, the method returns a null
instead of an RMException
object.
aiErrorMessageId
- An int
value specifying the message ID. This value is also used
as the ID for the new RMException
object.aiMessageType
- An int
value specifying the severity level represented
by this exception.aoException
- The Java Exception
object from which the localized message string
is to be derived.aoReplaceParams
- An Object
array containing the values that are to replace the
parameters in the localized message.RMException
object for an exception of type ERROR or FATAL; otherwise,
returns a null
object.© Copyright IBM Corp. 2003, 2013. All Rights Reserved.