Package com.sas.services.user

# Class UserInitializationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.sas.util.ChainedException
com.sas.services.ServiceException
com.sas.services.user.UserInitializationException

All Implemented Interfaces:
  `com.sas.util.ChainedExceptionInterface`, `Serializable`

public class UserInitializationException extends ServiceException implements Serializable
This class encapsulates an exception that occurs during UserContext initialization, but may still leave the UserContext in a usable state. There may actually be more than one exception that can occur during the initialization, and this aggregates them and provides access to them so the application can decide whether to continue or not.

Since:
  1.0
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `UserInitializationException()`
  Constructs a default exception to indicate that the User Service failed to configure.
  `UserInitializationException(UserContextInterface user)`
  Create a new UserInitializationException with the UserContext that was being created.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addException(Exception exception)`
  Add an exception to the collection.
  `Exception[]`
  `getExceptions()`
  Get the exceptions that occurred during initialization of the UserContext.
  `String`
  `getMessage()`
  Gets a message detailing why the User Service failed to configure.
  `Throwable`
  `getRootException()`
  Gets the root cause of the exception preventing the initialization of the User Service.
  `UserContextInterface`
  `getUser()`
  Get the UserContext that was being initialized when the problems happened.

  ### Methods inherited from class com.sas.util.ChainedException

  `chainContains, getRootException, getTargetException, getTargetException, printStackTrace, printStackTrace, printStackTrace, toString, toStringBuffer`

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### UserInitializationException

    public UserInitializationException()
    Constructs a default exception to indicate that the User Service failed to configure.

  - ### UserInitializationException

    public UserInitializationException(UserContextInterface user)
    Create a new UserInitializationException with the UserContext that was being created. This is not changable through this interface.
    Parameters:
      `user` - User context.

- ## Method Details

  - ### getRootException

    public Throwable getRootException()
    Gets the root cause of the exception preventing the initialization of the User Service.
    Overrides:
      `getRootException` in class `com.sas.util.ChainedException`
    Returns:
      Root exception

  - ### getMessage

    public String getMessage()
    Gets a message detailing why the User Service failed to configure.
    Overrides:
      `getMessage` in class `Throwable`
    Returns:
      Message detailing why the User Service failed to configure.

  - ### addException

    public void addException(Exception exception)
    Add an exception to the collection. More than one thing could have gone wrong during the initialization, and we want all of them listed here.

    Parameters:
      `exception` - A new exception to add to the list of things that went wrong during initialization.

  - ### getExceptions

    public Exception[] getExceptions()
    Get the exceptions that occurred during initialization of the UserContext.

    Returns:
      An array of Exception objects.

  - ### getUser

    public UserContextInterface getUser()
    Get the UserContext that was being initialized when the problems happened. This allows the client code to continue processing.

    Returns:
      The UserContext.