Class EcmsExceptionFactory

java.lang.Object
com.lexmark.saperion.exceptions.mappings.EcmsExceptionFactory

public class EcmsExceptionFactory extends Object
Global exception factory. This factory implementation serves as single point of entry to all exception factories in the system.
Author:
owaeldrich
  • Constructor Details

    • EcmsExceptionFactory

      public EcmsExceptionFactory()
  • Method Details

    • createException

      public Exception createException(com.lexmark.saperion.exceptions.ErrorType error, Throwable cause)
      Creates a new exception for the given service fault. If no appropriate exception mapping can be found this method returns null.
      Parameters:
      error - the service error
      cause - 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 returns true. If the code is not supported by any registered factory the method returns false. 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 code
      InconsistentExceptionFactoryRegistryException