|
Java SDK r12.5 SP 8 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException com.netegrity.ims.exception.IMSException
public class IMSException
Contains one or more exception messages to be displayed at runtime.
The messages in this object appear on a redisplayed task screen
after the user submits the task screen and validation errors are found.
The displayed exception messages give the user
the opportunity to correct the errors and resubmit the task.
Identity Manager displays the messages in this object after you throw
IMSException
. Be sure to add all error messages
to the IMSException
object (using one of the
addUserMessage()
methods) before throwing the exception.
If the user cannot affect the error state indicated by an exception,
a regular exception must be thrown for that error.
Message Format
Messages are stored in a text file called a resource bundle. You can
store custom messages in the pre-defined resource bundle
IMSException.properties
, or you can store your messages
in a custom resource bundle.
If you are using a custom resource bundle, specify the resource bundle name in
the constructor IMSException(String)
.
Exception messages have the format key=message -- for example:
5001=You can only enter numeric characters in this field.If you store custom messages in
IMSExceptions.properties
,
do so at the end of the file, and in the format indicated in the file.
For example, you should prefix the message ID with custom-
,
as shown below:
custom-5001=You can only enter numeric characters in this field.Using this format in the pre-defined
IMSExceptions.properties
file helps to avoid migration problems when you update the Identity Manager software.
IMSException
messages support variables. You can insert
specific values into the variables when you add the message to the
IMSException
object. You do so by passing the variable
values as an array of objects when you call addUserMessage()
.
3037=Password is too short. Minimum length is {0}.Here is the call that adds the above message to the
IMSException
object:
IMSException imsx = new IMSException("custom_messages"); . . . if (type == PasswordMessageType.SHORT) { int min = passwordCondition.getArgument(MINIMUM); Integer minValue = new Integer(min); Object[] params = {minValue}; imsx.addUserMessage("3037", params); return; }
Constructor Summary | |
---|---|
IMSException()
Creates an empty IMSException object that will be populated
with messages from a standard Identity Manager resource bundle. |
|
IMSException(java.util.Locale locale)
Creates an empty IMSException object that will be populated
with messages from a standard Identity Manager resource bundle using the specified Locale . |
|
IMSException(java.util.Locale locale,
java.lang.String bundleName)
Creates an empty IMSException object that will be populated
with messages from a custom resource bundle and the specified Locale . |
|
IMSException(java.util.Locale locale,
java.lang.String bundleName,
java.lang.String key,
java.lang.Object[] param)
Creates an IMSException object that will be populated
with a single user message from a standard Identity Manager resource bundle. |
|
IMSException(java.lang.String bundleName)
Creates an empty IMSException object that will be populated
with messages from a custom resource bundle. |
|
IMSException(java.lang.String key,
java.lang.Object[] param)
Creates an IMSException object that will be populated
with a single user message from a standard Identity Manager resource bundle. |
|
IMSException(java.lang.Throwable t)
Same as IMSException() except the root cause is set. |
Method Summary | |
---|---|
void |
addUserMessage(java.util.Locale locale,
java.lang.String key,
java.lang.Object[] param)
Deprecated. |
void |
addUserMessage(java.util.Locale locale,
java.lang.String attributeName,
java.lang.String key,
java.lang.Object[] param)
Deprecated. |
void |
addUserMessage(java.lang.String message)
Adds the specified general-purpose message to the list of exception messages to be displayed on the task screen. |
void |
addUserMessage(java.lang.String key,
java.lang.Object[] param)
Adds a general-purpose message to the list of exception messages to be displayed on the task screen. |
void |
addUserMessage(java.lang.String attributeName,
java.lang.String key,
java.lang.Object[] param)
Adds an attribute validation message to the list of exception messages to be displayed on the task screen. |
TaskErrorObject |
createTaskErrorObject(java.util.Locale locale,
java.lang.String key,
java.lang.Object[] param,
java.lang.String component,
ProcessStep processStep,
ErrorLevel errorLevel,
java.lang.String tagName)
Deprecated. |
TaskErrorObject |
createTaskErrorObject(java.lang.String key,
java.lang.Object[] param,
java.lang.String component,
ProcessStep processStep,
ErrorLevel errorLevel,
java.lang.String tagName)
Deprecated. |
java.util.Vector |
createTaskErrorObjects(java.util.Locale locale,
java.lang.String component,
ProcessStep processStep,
ErrorLevel errorLevel,
java.lang.String tagName)
Deprecated. |
java.util.Vector |
createTaskErrorObjects(java.lang.String component,
ProcessStep processStep,
ErrorLevel errorLevel,
java.lang.String tagName)
Deprecated. |
java.util.Hashtable |
getAttributeValidationMessages()
Internal use only. |
java.lang.String |
getMessage()
Internal use only. |
java.util.Vector |
getUserMessages()
Internal use only. |
java.lang.String |
toString()
Retrieves a textual representation of this object's state. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IMSException()
Creates an empty IMSException
object that will be populated
with messages from a standard Identity Manager resource bundle.
IMSException
object.
Locale
for the current user will be used to lookup
the locale specific resource bundle (if any).
IMSException(String)
constructor.
IMSExceptions.properties
are in English.
Optionally, you can translate the system messages in the base resource
bundle into another language, but you should not modify the base resource bundle
for any other reason. You should not modify any of the other standard Identity Manager
resource bundles.
custom\resourceBundles
public IMSException(java.lang.Throwable t)
Same as IMSException() except the root cause is set.
public IMSException(java.lang.String bundleName)
Creates an empty IMSException
object that will be populated
with messages from a custom resource bundle.
custom\resourceBundlesIf you choose not to store your custom resource bundles in
custom\resourceBundles
, you must store them in the
custom
directory or in any directory below it.
bundleName
- The fully qualified path and file name of the
base custom resource bundle. The path is relative to the
custom
directory. For example, suppose your base custom
resource bundle is LocalizedMessages.properties
:
custom
directory,
pass LocalizedMessages
to the constructor.
custom\resourceBundles
directory, pass
resourceBundles.LocalizedMessages
to the constructor.
public IMSException(java.util.Locale locale)
Creates an empty IMSException
object that will be populated
with messages from a standard Identity Manager resource bundle using the specified Locale
.
locale
- The Locale
to use when choosing the locale specific resource bundle.
There is no need to use the Locale
specific constructors to specify the Locale
of the current user. The correct Locale
for the current user is chosen automatically.public IMSException(java.util.Locale locale, java.lang.String bundleName)
Creates an empty IMSException
object that will be populated
with messages from a custom resource bundle and the specified Locale
.
custom\resourceBundlesIf you choose not to store your custom resource bundles in
custom\resourceBundles
, you must store them in the
custom
directory or in any directory below it.
bundleName
- The fully qualified path and file name of the
base custom resource bundle. The path is relative to the
custom
directory. For example, suppose your base custom
resource bundle is LocalizedMessages.properties
:
custom
directory,
pass LocalizedMessages
to the constructor.
custom\resourceBundles
directory, pass
resourceBundles.LocalizedMessages
to the constructor.
locale
- The Locale
to use when choosing the locale specific resource bundle.
There is no need to use the Locale
specific constructors to specify the Locale
of the current user. The correct Locale
for the current user is chosen automatically.public IMSException(java.lang.String key, java.lang.Object[] param)
Creates an IMSException
object that will be populated
with a single user message from a standard Identity Manager resource bundle. The correct Locale
for the current user will be used to locale the locale specific resource bundle.
key
- The key for retrieving the message from the resource bundle.param
- An array of values to insert into message variables.public IMSException(java.util.Locale locale, java.lang.String bundleName, java.lang.String key, java.lang.Object[] param)
Creates an IMSException
object that will be populated
with a single user message from a standard Identity Manager resource bundle. The correct Locale
for the current user will be used to locale the locale specific resource bundle.
locale
- The Locale
to use when locating a resource bundle.bundleName
- The base name of the message resource bundle.key
- The key for retrieving the message from the resource bundle.param
- An array of values to insert into message variables.Method Detail |
---|
public void addUserMessage(java.lang.String key, java.lang.Object[] param)
key
- The key for retrieving the message from the resource bundle.param
- An array of values to insert into message variables.public void addUserMessage(java.util.Locale locale, java.lang.String key, java.lang.Object[] param)
Locale
as the correct Locale
for the current user is used automatically.
To specify a specific Locale
, you must use one of the Locale
specific constructors.
The Locale
parameter in this method is currently being ignored.
public void addUserMessage(java.lang.String message)
Too many errors
message if the number of exceptions exceeds a defined number.
message
- The exception message to add to the list of messages to display.public java.util.Vector getUserMessages()
public void addUserMessage(java.lang.String attributeName, java.lang.String key, java.lang.Object[] param)
attributeName
- The name of the attribute associated with the
task screen field where the error occurred.key
- The key for retrieving the message from the resource bundle.param
- An array of values to insert into message variables.public void addUserMessage(java.util.Locale locale, java.lang.String attributeName, java.lang.String key, java.lang.Object[] param)
Locale
as the correct Locale
for the current user is used automatically.
To specify a specific Locale
, you must use one of the Locale
specific constructors.
The Locale
parameter in this method is currently being ignored.
public java.util.Hashtable getAttributeValidationMessages()
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Throwable
IMSException
)
getMessage()
public TaskErrorObject createTaskErrorObject(java.lang.String key, java.lang.Object[] param, java.lang.String component, ProcessStep processStep, ErrorLevel errorLevel, java.lang.String tagName)
public TaskErrorObject createTaskErrorObject(java.util.Locale locale, java.lang.String key, java.lang.Object[] param, java.lang.String component, ProcessStep processStep, ErrorLevel errorLevel, java.lang.String tagName)
public java.util.Vector createTaskErrorObjects(java.lang.String component, ProcessStep processStep, ErrorLevel errorLevel, java.lang.String tagName)
public java.util.Vector createTaskErrorObjects(java.util.Locale locale, java.lang.String component, ProcessStep processStep, ErrorLevel errorLevel, java.lang.String tagName)
|
Java SDK r12.5 SP 8 06/13/2011 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |