| |
|
| com.metaboss.enterprise.messages.Message
All known Subclasses: com.metaboss.enterprise.messages.DefaultMessageImplementation,
Message | public interface Message extends Serializable(Code) | | Generic Message base interface. This interface
is a base interface which must be implemented by all messages in enterprise.
All Messages are serializable. Each message must have its own globally unique Id.
This id can for example be used by renderer to uniquely identify resources corresponding to a message.
Each message also belongs to particular category. Three different categories are supported:
- InformationMessage represents some information returned by the service to
the client. Since this is an information message - the expectation is that operation has
completed successfully and is returning some related information. For example successfull
"add new client" operation might return an information message: "Your PIN number will be
mailed to you within five working days". Message is an information message by default
this menas that any of the is.....() (e.g. isError(), isWarning() etc) methods returning false
- WarningMessage represents some warning returned by the operation to
the client. Since this is a warning message - the expectation is that operation has
largely completed successfully, but has encountered some problems on the way, which, while
not impacting successfull completion, may cause some unusual results.
For example successfull "add new client" operation might return a warning message:
"Due to system maintenance your application has been accepted in "off line" mode and will
be processed as soon as system will become available".
If message is a Warning Message - the isWarning() method will return true.
- ErrorMessage represents some error returned by the operation to
the client. Since this is an error message - the expectation is that operation has
been unsuccessfull. For example unsuccessfull "add new client" operation might return
an error message: "Account can only be opened for persons 21 years or older."
If message is an Error Message - the isError() method will return true.
- FailureMessage represents message about some serious failure, which has made it
impossible to run operation. Since this is a failure message - the expectation is that operation has
not even been able to run along its main or alternative flows. Normally this message contains
reasonably technical descrition of the problem. For example unsuccessfull "add new client"
operation might return failure message: "Unable to locate client services middleware."
If message is a Failure Message - the isFailure() method will return true.
|
Method Summary | |
public String | getId() Returns unique string Id of the message. | public Object[] | getMessageArguments() Returns an array of message arguments used to render the message. | public boolean | isError() Returns true if this message is an error message. | public boolean | isFailure() Returns true if this message is a failure message. | public boolean | isWarning() Returns true if this message is a warning message. | public String | toLocalizedString(Locale pDesiredLocale) Returns human readable message text in specified locale. | public String | toString() Returns human readable message text in default locale. |
getId | public String getId()(Code) | | Returns unique string Id of the message.
|
getMessageArguments | public Object[] getMessageArguments()(Code) | | Returns an array of message arguments used to render the message.
|
isError | public boolean isError()(Code) | | Returns true if this message is an error message.
|
isFailure | public boolean isFailure()(Code) | | Returns true if this message is a failure message.
|
isWarning | public boolean isWarning()(Code) | | Returns true if this message is a warning message.
|
toLocalizedString | public String toLocalizedString(Locale pDesiredLocale)(Code) | | Returns human readable message text in specified locale.
|
toString | public String toString()(Code) | | Returns human readable message text in default locale.
|
|
|
|