Class EcmsExceptionFactory


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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Exception createException​(com.lexmark.saperion.exceptions.ErrorType error, java.lang.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.
      • Methods inherited from class java.lang.Object

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

      • EcmsExceptionFactory

        public EcmsExceptionFactory()
    • Method Detail

      • createException

        public java.lang.Exception createException​(com.lexmark.saperion.exceptions.ErrorType error,
                                                   java.lang.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:
        java.lang.Exception - raised if multiple factories support the given error code
        InconsistentExceptionFactoryRegistryException