Class UserException

  • All Implemented Interfaces:
    java.io.Serializable

    public class UserException
    extends java.lang.Exception
    User exception class used when a user is not permitted an action.
    Author:
    Christopher Mindus
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      ConstructorDescription
      UserException​(UserIdentifier userIdentifier, LoginResult authenticationResult)
      Creates a user exception with an empty detail message.
      UserException​(UserIdentifier userIdentifier, java.lang.String message)
      Creates a user exception with a message.
      UserException​(UserIdentifier userIdentifier, java.lang.String message, java.lang.Throwable exception)
      Creates a user exception with a message and an exception cause.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      LoginResultgetAuthenticationResult()
      Gets the authentication result causing the exception.
      UserIdentifiergetUserIdentifier()
      Gets the User Identifier.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • UserException

        public UserException​(UserIdentifier userIdentifier,
                             LoginResult authenticationResult)
        Creates a user exception with an empty detail message.
        Parameters:
        userIdentifier - The user identifier.
        authenticationResult - The authentication result causing the error.
        Throws:
        java.lang.NullPointerException - if userIdentifier parameter is null.
      • UserException

        public UserException​(UserIdentifier userIdentifier,
                             java.lang.String message)
        Creates a user exception with a message.
        Parameters:
        userIdentifier - The user identifier.
        message - the detail message.
        Throws:
        java.lang.NullPointerException - if userIdentifier parameter is null.
      • UserException

        public UserException​(UserIdentifier userIdentifier,
                             java.lang.String message,
                             java.lang.Throwable exception)
        Creates a user exception with a message and an exception cause.
        Parameters:
        userIdentifier - The user identifier.
        message - the detail message.
        exception - the exception, i.e. the real cause.
        Throws:
        java.lang.NullPointerException - if userIdentifier parameter is null.
    • Method Detail

      • getUserIdentifier

        public UserIdentifier getUserIdentifier()
        Gets the User Identifier.
      • getAuthenticationResult

        public LoginResult getAuthenticationResult()
        Gets the authentication result causing the exception.
        Returns:
        The authentication result that caused the error, null if a nested exception caused it (use @{link Throwable.getCause() to retrieve it).