com.ibm.datapower.wamt
Class DMgrException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.ibm.datapower.wamt.DMgrException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AMPException, ClientAPIException, DatastoreException, SOMAException

public class DMgrException
extends java.lang.Exception

This is the root class for exceptions that are thrown from the DataPower Management Interface. All other exception classes in the manager should be a subclass of this. It is recommended that you use the most specific class whenever possible, so instances of this specific class should be rare. Please instantiate subclasses instead.

To support getting an NLS message from the exception, this class has been modified to have NLS message attributes (msgId and msgParams). If these attributes are present, they will be used in returning localized messages (@see #getMessage(Locale) ). The normal constructors that pass messages have been preserved for compatibility uses, but they should be avoided if possible.

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT_2009_2010
           
 
Constructor Summary
DMgrException()
          Create an exception with no message and no cause.
DMgrException(java.lang.String message)
          Create an exception with a message but with no chained cause.
DMgrException(java.lang.String message, java.lang.String msgKey)
          Create an exception with a message and NLS attributes, but with no chained cause.
DMgrException(java.lang.String message, java.lang.String msgKey, java.lang.Object msgParm)
          Create an exception with a message and NLS attributes, but with no chained cause.
DMgrException(java.lang.String message, java.lang.String msgKey, java.lang.Object[] msgParms)
          Create an exception with a message and NLS attributes, but with no chained cause.
DMgrException(java.lang.String message, java.lang.Throwable cause)
          Create an exception with a message and a chained cause.
DMgrException(java.lang.String message, java.lang.Throwable cause, java.lang.String msgKey)
          Create an exception with a message, NLS attributes and a chained cause.
DMgrException(java.lang.String message, java.lang.Throwable cause, java.lang.String msgKey, java.lang.Object msgParm)
          Create an exception with a message, NLS attributes and a chained cause.
DMgrException(java.lang.String message, java.lang.Throwable cause, java.lang.String msgKey, java.lang.Object[] msgParms)
          Create an exception with a message, NLS attributes and a chained cause.
DMgrException(java.lang.Throwable cause)
          Create an exception with a chained cause and no message.
 
Method Summary
 java.lang.String getMessage(java.util.Locale locale)
          Return a message for this exception based on locale.
 java.lang.String getMessageExplanation()
          Return the explanation text for this exception message
 java.lang.String getMessageExplanation(java.util.Locale locale)
          Returns the explanation text for this exception message
 java.lang.String getMessageUseraction()
          Return the uesraction text for this exception message
 java.lang.String getMessageUseraction(java.util.Locale locale)
          Returns the useraction text for this exception message
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_2009_2010

public static final java.lang.String COPYRIGHT_2009_2010
See Also:
Constant Field Values
Constructor Detail

DMgrException

public DMgrException()
Create an exception with no message and no cause. Please use one of the other constructors to provide as much information about the exception as possible. You really shouldn't be using this zero-argument constructor.


DMgrException

public DMgrException(java.lang.String message)
Create an exception with a message but with no chained cause.

Parameters:
message - a string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.String msgKey,
                     java.lang.Object[] msgParms)
Create an exception with a message and NLS attributes, but with no chained cause.

Parameters:
message - a string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
msgParms - an Object[] that gives the attributes to be used with msgKey
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.String msgKey,
                     java.lang.Object msgParm)
Create an exception with a message and NLS attributes, but with no chained cause.

Parameters:
message - a string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
msgParm - an Object that gives the attributes to be used with msgKey
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.String msgKey)
Create an exception with a message and NLS attributes, but with no chained cause.

Parameters:
message - a string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.Throwable cause)
Create an exception with a message and a chained cause.

Parameters:
message - string that provides some explanation/description of the exception
cause - a reference to another exception that occurred at a lower level which is the cause for this higher-level exception.

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.Throwable cause,
                     java.lang.String msgKey,
                     java.lang.Object[] msgParms)
Create an exception with a message, NLS attributes and a chained cause.

Parameters:
message - string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
cause - a reference to another exception that occurred at a lower level which is the cause for this higher-level exception.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
msgParms - an Object[] that gives the attributes to be used with msgKey
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.Throwable cause,
                     java.lang.String msgKey,
                     java.lang.Object msgParm)
Create an exception with a message, NLS attributes and a chained cause.

Parameters:
message - string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
cause - a reference to another exception that occurred at a lower level which is the cause for this higher-level exception.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
msgParm - an Object that gives the attribute to be used with msgKey
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.String message,
                     java.lang.Throwable cause,
                     java.lang.String msgKey)
Create an exception with a message, NLS attributes and a chained cause.

Parameters:
message - string that provides some explanation/description of the exception. This message should have already been localized for the jvm's locale, if possible.
cause - a reference to another exception that occurred at a lower level which is the cause for this higher-level exception.
msgKey - a string giving the key of the NLS enabled message to be used with the exception.
See Also:
getMessage(Locale)

DMgrException

public DMgrException(java.lang.Throwable cause)
Create an exception with a chained cause and no message.

Parameters:
cause - a reference to another exception that occurred at a lower level which is the cause for this higher-level exception.
Method Detail

getMessage

public java.lang.String getMessage(java.util.Locale locale)
Return a message for this exception based on locale. If the NLS attributes (msgKey and msgParms) aren't set, this method will return getLocalizedMessage(), which will probably be the same as getMessage(). This method is provided for callers who need to get message that matches the local of their users. This is important, because the manager sends much of its user feedback messages via exceptions.

Parameters:
locale - The locale to be used for the localizedMessage
Returns:
message for this exception based on locale

getMessageExplanation

public java.lang.String getMessageExplanation()
Return the explanation text for this exception message

Returns:
explanation the text of the explanation specified for this exception

getMessageUseraction

public java.lang.String getMessageUseraction()
Return the uesraction text for this exception message

Returns:
useraction the text of the user action specified for this exception

getMessageExplanation

public java.lang.String getMessageExplanation(java.util.Locale locale)
Returns the explanation text for this exception message

Parameters:
locale - the locale for the string to be returned.
Returns:
explanation the text of the message explanation in the bundle

getMessageUseraction

public java.lang.String getMessageUseraction(java.util.Locale locale)
Returns the useraction text for this exception message

Parameters:
locale - the locale for the string to be returned.
Returns:
useraction the text of the message explanation in the bundle


© Copyright IBM Corp. 2006, 2010 All Rights Reserved.