Class EcmsExceptionFactory
java.lang.Object
com.lexmark.saperion.exceptions.mappings.EcmsExceptionFactory
Global exception factory. This factory implementation serves as single point of entry to all exception factories in
the system.
- Author:
- owaeldrich
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateException
(com.lexmark.saperion.exceptions.ErrorType error, Throwable cause) Creates a new exception for the given service fault.boolean
validate
(com.lexmark.saperion.exceptions.ErrorCodeType errorCode) Checks that the error code is supported by exactly one registered exception factory.
-
Constructor Details
-
EcmsExceptionFactory
public EcmsExceptionFactory()
-
-
Method Details
-
createException
Creates a new exception for the given service fault. If no appropriate exception mapping can be found this method returnsnull
.- Parameters:
error
- the service errorcause
- the exception cause- Returns:
- the new exception for the given service fault
-
validate
public boolean validate(com.lexmark.saperion.exceptions.ErrorCodeType errorCode) throws InconsistentExceptionFactoryRegistryException Checks that the error code is supported by exactly one registered exception factory. If the code is supported by exactly one factory the method returnstrue
. If the code is not supported by any registered factory the method returnsfalse
. If the code is supported by more than one registered factory an exception is raised.- Parameters:
errorCode
- the error code to validate- Returns:
true
if exactly one registered factory supports this error code, otherwise false.- Throws:
Exception
- raised if multiple factories support the given error codeInconsistentExceptionFactoryRegistryException
-