Class KeymanagerExceptionHandler


  • @RestControllerAdvice
    public class KeymanagerExceptionHandler
    extends Object
    Rest Controller Advice for Keymanager Service
    Since:
    1.0.0
    Author:
    Dharmesh Khandelwal
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> certificateNotValidException​(javax.servlet.http.HttpServletRequest httpServletRequest, CertificateNotValidException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> controlRequestException​(javax.servlet.http.HttpServletRequest httpServletRequest, RequestException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoException​(javax.servlet.http.HttpServletRequest httpServletRequest, CryptoException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoManagerServieException​(javax.servlet.http.HttpServletRequest httpServletRequest, CryptoManagerSerivceException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> dateTimeParseException​(javax.servlet.http.HttpServletRequest httpServletRequest, DateTimeParseException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> defaultErrorHandler​(javax.servlet.http.HttpServletRequest httpServletRequest, Exception e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> emptyLengthException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> handleServiceException​(javax.servlet.http.HttpServletRequest httpServletRequest, LicenseKeyServiceException exception)
      Method to handle LicenseKeyServiceException.
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> illegalArgumentException​(javax.servlet.http.HttpServletRequest httpServletRequest, IllegalArgumentException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidApplicationIdException​(javax.servlet.http.HttpServletRequest httpServletRequest, InvalidApplicationIdException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidDataException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidDataException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidFormatException​(javax.servlet.http.HttpServletRequest httpServletRequest, com.fasterxml.jackson.databind.exc.InvalidFormatException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidKeyException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.InvalidKeyException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keymanagerServiceException​(javax.servlet.http.HttpServletRequest httpServletRequest, KeymanagerServiceException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keystoreProcessingException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> methodArgumentNotValidException​(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MethodArgumentNotValidException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noSuchAlgorithmException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.exception.NoSuchAlgorithmException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noUniqueAliasException​(javax.servlet.http.HttpServletRequest httpServletRequest, NoUniqueAliasException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> nullDataException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.crypto.exception.NullDataException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onHttpMessageNotReadable​(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.http.converter.HttpMessageNotReadableException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onMissingServletRequestParameterException​(javax.servlet.http.HttpServletRequest httpServletRequest, org.springframework.web.bind.MissingServletRequestParameterException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> parseResponseException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.ParseResponseException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> partnerCertManagerException​(javax.servlet.http.HttpServletRequest httpServletRequest, PartnerCertManagerException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureFailureException​(javax.servlet.http.HttpServletRequest httpServletRequest, SignatureFailureException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilClientException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilException​(javax.servlet.http.HttpServletRequest httpServletRequest, io.mosip.kernel.core.signatureutil.exception.SignatureUtilException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> validateInputArguments​(javax.servlet.http.HttpServletRequest httpServletRequest, InvalidArgumentsException exception)
      Method to handle InvalidArgumentsException.
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkCryptoException​(javax.servlet.http.HttpServletRequest httpServletRequest, ZKCryptoException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkKeyDerivationException​(javax.servlet.http.HttpServletRequest httpServletRequest, ZKKeyDerivationException e)  
      org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkRandomKeyDecryptionException​(javax.servlet.http.HttpServletRequest httpServletRequest, ZKRandomKeyDecryptionException e)  
    • Constructor Detail

      • KeymanagerExceptionHandler

        public KeymanagerExceptionHandler()
    • Method Detail

      • nullDataException

        @ExceptionHandler(io.mosip.kernel.core.crypto.exception.NullDataException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> nullDataException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                 io.mosip.kernel.core.crypto.exception.NullDataException e)
                                                                                                                                                          throws IOException
        Throws:
        IOException
      • invalidKeyException

        @ExceptionHandler(io.mosip.kernel.core.crypto.exception.InvalidKeyException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidKeyException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                   io.mosip.kernel.core.crypto.exception.InvalidKeyException e)
                                                                                                                                                            throws IOException
        Throws:
        IOException
      • noSuchAlgorithmException

        @ExceptionHandler(io.mosip.kernel.core.exception.NoSuchAlgorithmException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noSuchAlgorithmException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                        io.mosip.kernel.core.exception.NoSuchAlgorithmException e)
                                                                                                                                                                 throws IOException
        Throws:
        IOException
      • invalidFormatException

        @ExceptionHandler(com.fasterxml.jackson.databind.exc.InvalidFormatException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidFormatException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      com.fasterxml.jackson.databind.exc.InvalidFormatException e)
                                                                                                                                                               throws IOException
        Throws:
        IOException
      • invalidDataException

        @ExceptionHandler(io.mosip.kernel.core.crypto.exception.InvalidDataException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> invalidDataException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                    io.mosip.kernel.core.crypto.exception.InvalidDataException e)
                                                                                                                                                             throws IOException
        Throws:
        IOException
      • noUniqueAliasException

        @ExceptionHandler(NoUniqueAliasException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> noUniqueAliasException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      NoUniqueAliasException e)
                                                                                                                                                               throws IOException
        Throws:
        IOException
      • cryptoException

        @ExceptionHandler(CryptoException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> cryptoException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                               CryptoException e)
                                                                                                                                                        throws IOException
        Throws:
        IOException
      • methodArgumentNotValidException

        @ExceptionHandler(org.springframework.web.bind.MethodArgumentNotValidException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> methodArgumentNotValidException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                               org.springframework.web.bind.MethodArgumentNotValidException e)
                                                                                                                                                                        throws IOException
        Throws:
        IOException
      • onHttpMessageNotReadable

        @ExceptionHandler(org.springframework.http.converter.HttpMessageNotReadableException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onHttpMessageNotReadable​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                        org.springframework.http.converter.HttpMessageNotReadableException e)
                                                                                                                                                                 throws IOException
        Throws:
        IOException
      • onMissingServletRequestParameterException

        @ExceptionHandler(org.springframework.web.bind.MissingServletRequestParameterException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> onMissingServletRequestParameterException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                                         org.springframework.web.bind.MissingServletRequestParameterException e)
                                                                                                                                                                                  throws IOException
        Throws:
        IOException
      • emptyLengthException

        @ExceptionHandler(io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> emptyLengthException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                    io.mosip.kernel.core.idgenerator.exception.TokenIdGeneratorException e)
                                                                                                                                                             throws IOException
        Throws:
        IOException
      • zkCryptoException

        @ExceptionHandler(ZKCryptoException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> zkCryptoException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                 ZKCryptoException e)
                                                                                                                                                          throws IOException
        Throws:
        IOException
      • keystoreProcessingException

        @ExceptionHandler(io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> keystoreProcessingException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                           io.mosip.kernel.core.keymanager.exception.KeystoreProcessingException e)
                                                                                                                                                                    throws IOException
        Throws:
        IOException
      • validateInputArguments

        @ExceptionHandler(InvalidArgumentsException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> validateInputArguments​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      InvalidArgumentsException exception)
                                                                                                                                                               throws IOException
        Method to handle InvalidArgumentsException.
        Parameters:
        httpServletRequest - the request
        exception - the exception.
        Returns:
        ErrorResponse.
        Throws:
        IOException - the IO exception
      • handleServiceException

        @ExceptionHandler(LicenseKeyServiceException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> handleServiceException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      LicenseKeyServiceException exception)
                                                                                                                                                               throws IOException
        Method to handle LicenseKeyServiceException.
        Parameters:
        httpServletRequest - the request
        exception - the exception.
        Returns:
        ErrorResponse.
        Throws:
        IOException - the IO exception
      • controlRequestException

        @ExceptionHandler(RequestException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> controlRequestException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                       RequestException e)
                                                                                                                                                                throws IOException
        Throws:
        IOException
      • signatureUtilClientException

        @ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilClientException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                            io.mosip.kernel.core.signatureutil.exception.SignatureUtilClientException e)
                                                                                                                                                                     throws IOException
        Throws:
        IOException
      • signatureUtilException

        @ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.SignatureUtilException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> signatureUtilException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      io.mosip.kernel.core.signatureutil.exception.SignatureUtilException e)
                                                                                                                                                               throws IOException
        Throws:
        IOException
      • parseResponseException

        @ExceptionHandler(io.mosip.kernel.core.signatureutil.exception.ParseResponseException.class)
        public org.springframework.http.ResponseEntity<io.mosip.kernel.core.http.ResponseWrapper<io.mosip.kernel.core.exception.ServiceError>> parseResponseException​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                                                                                                                                                      io.mosip.kernel.core.signatureutil.exception.ParseResponseException e)
                                                                                                                                                               throws IOException
        Throws:
        IOException