org.itracker.services.exceptions
Class AuthenticatorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.itracker.services.exceptions.AuthenticatorException
All Implemented Interfaces:
Serializable

public class AuthenticatorException
extends RuntimeException

This class encapsulates the errors that may occur during a login or other types of actions typically performed by a pluggable authentication module.

A pluggable authentication module should set the type of error generated using the setType method, or the appropriate constructor. If the type of error does not match one of the existing types and the error should be returned to the user, the module should use the CUSTOM_ERROR type, and then also populate the the messageKey attribute with a key that would be suitable for display to the user.

This class can also be used to send the user to a custom error page in the event of a failure. If this is required, the page type should be set using the setErrorPageType method, and the appropriate value for the type is set using setErrorPageValue. The currently supported types are either a URL or a Struts forward action mapping..

See Also:
Serialized Form

Field Summary
static int CUSTOM_ERROR
           
static int ERRORPAGE_TYPE_FORWARD
           
static int ERRORPAGE_TYPE_UNDEFINED
           
static int ERRORPAGE_TYPE_URL
           
static int INACTIVE_ACCOUNT
           
static int INVALID_AUTHENTICATION_TYPE
           
static int INVALID_DATA
           
static int INVALID_PASSWORD
           
static int SYSTEM_ERROR
           
static int UNKNOWN_USER
           
 
Constructor Summary
AuthenticatorException()
           
AuthenticatorException(int type)
           
AuthenticatorException(int type, String messageKey)
           
AuthenticatorException(String message, int type)
           
AuthenticatorException(String message, int type, String messageKey)
           
AuthenticatorException(String message, int type, Throwable cause)
           
 
Method Summary
 int getErrorPageType()
          Returns the type of error page that is has been set.
 String getErrorPageValue()
          Returns the error page that should be used to display this exception Supported values are urls and Struts forward action mappings.
 String getMessage()
           
 String getMessageKey()
          Returns a key that contains a custom error message to display to the user.
 int getType()
           
 void setErrorPageType(int value)
          Sets the type of error page that should be used to display this exception.
 void setErrorPageValue(String value)
          Returns the error page that should be used to display this exception Supported values are urls and Struts forward action mappings.
 void setMessageKey(String messageKey)
          Sets a key that contains a custom error message to display to the user.
 void setType(int type)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID_DATA

public static final int INVALID_DATA
See Also:
Constant Field Values

UNKNOWN_USER

public static final int UNKNOWN_USER
See Also:
Constant Field Values

INVALID_PASSWORD

public static final int INVALID_PASSWORD
See Also:
Constant Field Values

INACTIVE_ACCOUNT

public static final int INACTIVE_ACCOUNT
See Also:
Constant Field Values

SYSTEM_ERROR

public static final int SYSTEM_ERROR
See Also:
Constant Field Values

INVALID_AUTHENTICATION_TYPE

public static final int INVALID_AUTHENTICATION_TYPE
See Also:
Constant Field Values

CUSTOM_ERROR

public static final int CUSTOM_ERROR
See Also:
Constant Field Values

ERRORPAGE_TYPE_UNDEFINED

public static final int ERRORPAGE_TYPE_UNDEFINED
See Also:
Constant Field Values

ERRORPAGE_TYPE_FORWARD

public static final int ERRORPAGE_TYPE_FORWARD
See Also:
Constant Field Values

ERRORPAGE_TYPE_URL

public static final int ERRORPAGE_TYPE_URL
See Also:
Constant Field Values
Constructor Detail

AuthenticatorException

public AuthenticatorException()

AuthenticatorException

public AuthenticatorException(int type)

AuthenticatorException

public AuthenticatorException(int type,
                              String messageKey)

AuthenticatorException

public AuthenticatorException(String message,
                              int type)

AuthenticatorException

public AuthenticatorException(String message,
                              int type,
                              Throwable cause)

AuthenticatorException

public AuthenticatorException(String message,
                              int type,
                              String messageKey)
Method Detail

getType

public int getType()

setType

public void setType(int type)

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

getMessageKey

public String getMessageKey()
Returns a key that contains a custom error message to display to the user.

Returns:
a resource key that can be used to look up the custom error message for this exception.

setMessageKey

public void setMessageKey(String messageKey)
Sets a key that contains a custom error message to display to the user.

Parameters:
messageKey - a resource key that can be used to look up the custom error message for this exception.

getErrorPageType

public int getErrorPageType()
Returns the type of error page that is has been set. Supported values are urls and Struts forward action mappings.

See Also:
ERRORPAGE_TYPE_FORWARD, ERRORPAGE_TYPE_URL

setErrorPageType

public void setErrorPageType(int value)
Sets the type of error page that should be used to display this exception. Supported values are urls and Struts forward action mappings.

Parameters:
value - the type of error page that has been set
See Also:
ERRORPAGE_TYPE_FORWARD, ERRORPAGE_TYPE_URL

getErrorPageValue

public String getErrorPageValue()
Returns the error page that should be used to display this exception Supported values are urls and Struts forward action mappings. The type that has been set must be identified using the setErrorPageType method.

See Also:
setErrorPageType(int)

setErrorPageValue

public void setErrorPageValue(String value)
Returns the error page that should be used to display this exception Supported values are urls and Struts forward action mappings. The type that has been set must be identified using the setErrorPageType method.

Parameters:
value - the error page that should be used to display this message
See Also:
setErrorPageType(int)


Copyright © 2002-2012 itracker. All Rights Reserved.