soap tutorial

adriani.jws.template.service
Class ErrorMessage

java.lang.Object
  extended by adriani.jws.template.service.ErrorMessage

public class ErrorMessage
extends java.lang.Object

This class is responsible for mapping all the error codes into user-friendly text messages. In order to improve performance, all text messages are instantiated as STATIC class attributes, in this way each text message is created only once (the first time the class is loaded). The actual mapping between error codes and text messages is defined by some custom properties files having the base name message_list.properties.

Remark: the ResourceBundle.getBundle() method retrieves the base file only when the system Locale DOES NOT match any locale-specific file.

Example: consider a machine using an ENGLISH Locale and finding only two properties files: message_list.properties (base) and message_list_en.properties (English). In this case calling ResourceBundle.getBundle(Settings.MESSAGES, Locale.ITALY) will load the message_list_en.properties file because it matches the system Locale! Hence, in order to force loading of the Italian properties, it's necessary to provide also a file named: message_list_it.properties.


Field Summary
static int BAD_DATA
          Output message code, depending by specific project's requirement
static java.lang.String BADDATA_MESSAGE
          Default value for the static field
static int COMMAND
          General error code (business logic level)
static java.lang.String COMMAND_MESSAGE
          Default value for the static field
static int DAO
          General error code (business logic level)
static java.lang.String DATAOK_MESSAGE
          Default value for the static field
static java.lang.String DBA_MESSAGE
          Default value for the static field
static int GENERAL
          General error code (business logic level)
static java.lang.String GENERAL_MESSAGE
          Default value for the static field
protected static java.lang.String leadingName
          Beginning of each logging message produced by this class.
static int LOGIC
          General error code (business logic level)
static java.lang.String LOGIC_MESSAGE
          Default value for the static field
static int MACRO
          General error code (business logic level)
static java.lang.String MACRO_MESSAGE
          Default value for the static field
static int NO_CUSTOMER
          Output message code, depending by specific project's requirement
static int NO_DB
          Database error code (DAO layer)
static int NO_RECORD
          Database error code (DAO layer)
static int NO_RESULT
          Output message code, depending by specific project's requirement
static java.lang.String NOCUSTOMER_MESSAGE
          Default value for the static field
static java.lang.String NODB_MESSAGE
          Default value for the static field
static int NOK
          General error code (business logic level)
static java.lang.String NOK_MESSAGE
          Default value for the static field
static java.lang.String NORECORD_MESSAGE
          Default value for the static field
static java.lang.String NORESULT_MESSAGE
          Default value for the static field
static int OK
          Output message code, depending by specific project's requirement
static int SQL
          Database error code (DAO layer)
static java.lang.String SQL_MESSAGE
          Default value for the static field
static int VALIDATION
          Soap specific error code
static java.lang.String VALIDATION_MESSAGE
          Default value for the static field
 
Constructor Summary
ErrorMessage()
           
 
Method Summary
static java.lang.String getMessage(int code)
          Return the text message mapped into the integer code as defined in the loaded properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOK

public static final int NOK
General error code (business logic level)

See Also:
Constant Field Values

DAO

public static final int DAO
General error code (business logic level)

See Also:
Constant Field Values

MACRO

public static final int MACRO
General error code (business logic level)

See Also:
Constant Field Values

LOGIC

public static final int LOGIC
General error code (business logic level)

See Also:
Constant Field Values

GENERAL

public static final int GENERAL
General error code (business logic level)

See Also:
Constant Field Values

COMMAND

public static final int COMMAND
General error code (business logic level)

See Also:
Constant Field Values

SQL

public static final int SQL
Database error code (DAO layer)

See Also:
Constant Field Values

NO_DB

public static final int NO_DB
Database error code (DAO layer)

See Also:
Constant Field Values

NO_RECORD

public static final int NO_RECORD
Database error code (DAO layer)

See Also:
Constant Field Values

VALIDATION

public static final int VALIDATION
Soap specific error code

See Also:
Constant Field Values

OK

public static final int OK
Output message code, depending by specific project's requirement

See Also:
Constant Field Values

NO_RESULT

public static final int NO_RESULT
Output message code, depending by specific project's requirement

See Also:
Constant Field Values

NO_CUSTOMER

public static final int NO_CUSTOMER
Output message code, depending by specific project's requirement

See Also:
Constant Field Values

BAD_DATA

public static final int BAD_DATA
Output message code, depending by specific project's requirement

See Also:
Constant Field Values

NOK_MESSAGE

public static java.lang.String NOK_MESSAGE
Default value for the static field


DBA_MESSAGE

public static java.lang.String DBA_MESSAGE
Default value for the static field


MACRO_MESSAGE

public static java.lang.String MACRO_MESSAGE
Default value for the static field


LOGIC_MESSAGE

public static java.lang.String LOGIC_MESSAGE
Default value for the static field


GENERAL_MESSAGE

public static java.lang.String GENERAL_MESSAGE
Default value for the static field


COMMAND_MESSAGE

public static java.lang.String COMMAND_MESSAGE
Default value for the static field


SQL_MESSAGE

public static java.lang.String SQL_MESSAGE
Default value for the static field


NODB_MESSAGE

public static java.lang.String NODB_MESSAGE
Default value for the static field


NORECORD_MESSAGE

public static java.lang.String NORECORD_MESSAGE
Default value for the static field


VALIDATION_MESSAGE

public static java.lang.String VALIDATION_MESSAGE
Default value for the static field


DATAOK_MESSAGE

public static java.lang.String DATAOK_MESSAGE
Default value for the static field


NORESULT_MESSAGE

public static java.lang.String NORESULT_MESSAGE
Default value for the static field


NOCUSTOMER_MESSAGE

public static java.lang.String NOCUSTOMER_MESSAGE
Default value for the static field


BADDATA_MESSAGE

public static java.lang.String BADDATA_MESSAGE
Default value for the static field


leadingName

protected static java.lang.String leadingName
Beginning of each logging message produced by this class.

Constructor Detail

ErrorMessage

public ErrorMessage()
Method Detail

getMessage

public static java.lang.String getMessage(int code)
Return the text message mapped into the integer code as defined in the loaded properties file.

Parameters:
code - the integer code of the error
Returns:
the string text message describing the error

Build 19/03/2014

Morpheus Technologies - making the Zion software
Copyright © 2009-2014 Morpheus Technologies. All Rights Reserved