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
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:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a default exception to indicate that the User Service failed to configure.Create a new UserInitializationException with the UserContext that was being created. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddException(Exception exception) Add an exception to the collection.Exception[]Get the exceptions that occurred during initialization of the UserContext.StringGets a message detailing why the User Service failed to configure.ThrowableGets the root cause of the exception preventing the initialization of the User Service.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, toStringBufferMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTraceMethods 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
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:
getRootExceptionin classcom.sas.util.ChainedException- Returns:
- Root exception
-
getMessage
public String getMessage()Gets a message detailing why the User Service failed to configure.- Overrides:
getMessagein classThrowable- 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
Get the UserContext that was being initialized when the problems happened. This allows the client code to continue processing.- Returns:
- The UserContext.
-