Class ServerAuthorExceptionHandler


  • public class ServerAuthorExceptionHandler
    extends java.lang.Object
    The Server Author Exception handler maps OMAG exceptions that have been produced by the admin client into Server author Exceptions.
    • Constructor Detail

      • ServerAuthorExceptionHandler

        public ServerAuthorExceptionHandler()
    • Method Detail

      • captureCheckedException

        public static void captureCheckedException​(FFDCResponse response,
                                                   OCFCheckedExceptionBase error,
                                                   java.lang.String exceptionClassName)
        Method for capturing an exception into a REST response. Set the exception information into the response. This exception capture handler strips off the messageId from the front of the message as the message is intended for user-consumption.
        Parameters:
        response - REST Response
        error - returned response.
        exceptionClassName - class name of the exception to recreate
      • mapToUserNotAuthorizedException

        public static ServerAuthorViewServiceException mapToUserNotAuthorizedException​(java.lang.String className,
                                                                                       java.lang.String methodName)
        Map an OMAGNotAuthorizedException to a ServerAuthorViewServiceException which is more consumable / meaningful to the UI
        Parameters:
        className - the name of the calling class
        methodName - the name of the operation being requested
        Returns:
        mapped Server author View Exception
      • mapOMAGInvalidParameterException

        public static ServerAuthorViewServiceException mapOMAGInvalidParameterException​(java.lang.String className,
                                                                                        java.lang.String methodName,
                                                                                        org.odpi.openmetadata.adminservices.ffdc.exception.OMAGInvalidParameterException omagException)
        Map an OMAGInvalidParameterException to a ServerAuthorViewServiceException which is more consumable / meaningful to the UI
        Parameters:
        className - the name of the calling class
        methodName - the name of the operation being requested
        omagException - supplied OMAGInvalidParameterException
        Returns:
        mapped Server author View Exception
      • mapOMAGConfigurationErrorException

        public static ServerAuthorViewServiceException mapOMAGConfigurationErrorException​(java.lang.String className,
                                                                                          java.lang.String methodName,
                                                                                          org.odpi.openmetadata.adminservices.ffdc.exception.OMAGConfigurationErrorException error)
        Map an OMAG configuration exception to a ServerAuthorViewServiceException
        Parameters:
        className - the name of the calling class
        methodName - the name of the operation being requested
        error - the OMAGConfigurationErrorException error to be mapped
        Returns:
        ServerAuthorViewServiceException Server Author View Service Exception
      • mapOCFInvalidParameterException

        public static ServerAuthorViewServiceException mapOCFInvalidParameterException​(java.lang.String className,
                                                                                       java.lang.String methodName,
                                                                                       InvalidParameterException error)
        Map an OCF InvalidParameterException to a ServerAuthorViewServiceException which is more consumable / meaningful to the UI
        Parameters:
        className - the name of the calling class
        methodName - the name of the operation being requested
        error - supplied OCF InvalidParameterException
        Returns:
        mapped Server author View Exception