Class HvlNotificationRestExceptionHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
tr.com.havelsan.javarch.service.handler.HvlRestExceptionHandler
tr.com.havelsan.javarch.notification.mail.starter.exception.HvlNotificationRestExceptionHandler
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware

@ControllerAdvice public class HvlNotificationRestExceptionHandler extends tr.com.havelsan.javarch.service.handler.HvlRestExceptionHandler
An exception handler class for notification operations.
  • Field Summary

    Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
  • Constructor Summary

    Constructors
    Constructor
    Description
    HvlNotificationRestExceptionHandler(tr.com.havelsan.javarch.service.configuration.properties.HvlServiceProperties serviceProperties)
    Instantiates a new HvlNotificationRestExceptionHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.springframework.http.ResponseEntity<Object>
    handleDataIntegrityViolation(org.springframework.dao.DataIntegrityViolationException ex)
    Handle data integrity violation response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handleHibernateConstraintViolation(org.hibernate.exception.ConstraintViolationException ex)
    Handle hibernate constraint violation response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handleJavaConstraintViolation(jakarta.validation.ConstraintViolationException ex)
    Handle java constraint violation response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handleMailException(tr.com.havelsan.javarch.mail.support.exception.HvlMailException ex)
    Handle mail exception response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException methodArgumentNotValidException, org.springframework.http.HttpHeaders httpHeaders, org.springframework.http.HttpStatusCode httpStatusCode, org.springframework.web.context.request.WebRequest webRequest)
    protected org.springframework.http.ResponseEntity<Object>
    handleOptimisticLock(org.springframework.orm.ObjectOptimisticLockingFailureException ex)
    Handle optimistic lock response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handlePersistenceException(jakarta.persistence.PersistenceException ex)
    Handle persistence exception response entity.
    protected org.springframework.http.ResponseEntity<Object>
    handleTransactionalConstraintViolation(org.springframework.transaction.TransactionSystemException ex)
    Handle transactional constraint violation response entity.

    Methods inherited from class tr.com.havelsan.javarch.service.handler.HvlRestExceptionHandler

    handle, handleAsyncRequestTimeoutException, handleChecked, handleConversionNotSupported, handleErrorResponseException, handleExceptionInternal, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMissingPathVariable, handleMissingServletRequestParameter, handleMissingServletRequestPart, handleNoHandlerFoundException, handleServletRequestBindingException, handleTypeMismatch, handleUnchecked

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    createProblemDetail, createResponseEntity, getMessageSource, handleBindException, handleException, handleHandlerMethodValidationException, handleMaxUploadSizeExceededException, handleMethodValidationException, handleNoResourceFoundException, setMessageSource

    Methods inherited from class java.lang.Object

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

    • HvlNotificationRestExceptionHandler

      public HvlNotificationRestExceptionHandler(tr.com.havelsan.javarch.service.configuration.properties.HvlServiceProperties serviceProperties)
      Instantiates a new HvlNotificationRestExceptionHandler.
      Parameters:
      serviceProperties - the service properties
  • Method Details

    • handleOptimisticLock

      @ExceptionHandler(org.springframework.orm.ObjectOptimisticLockingFailureException.class) protected org.springframework.http.ResponseEntity<Object> handleOptimisticLock(org.springframework.orm.ObjectOptimisticLockingFailureException ex)
      Handle optimistic lock response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handleTransactionalConstraintViolation

      @ExceptionHandler(org.springframework.transaction.TransactionSystemException.class) protected org.springframework.http.ResponseEntity<Object> handleTransactionalConstraintViolation(org.springframework.transaction.TransactionSystemException ex)
      Handle transactional constraint violation response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handlePersistenceException

      @ExceptionHandler(jakarta.persistence.PersistenceException.class) protected org.springframework.http.ResponseEntity<Object> handlePersistenceException(jakarta.persistence.PersistenceException ex)
      Handle persistence exception response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handleJavaConstraintViolation

      @ExceptionHandler(jakarta.validation.ConstraintViolationException.class) protected org.springframework.http.ResponseEntity<Object> handleJavaConstraintViolation(jakarta.validation.ConstraintViolationException ex)
      Handle java constraint violation response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handleHibernateConstraintViolation

      @ExceptionHandler(org.hibernate.exception.ConstraintViolationException.class) protected org.springframework.http.ResponseEntity<Object> handleHibernateConstraintViolation(org.hibernate.exception.ConstraintViolationException ex)
      Handle hibernate constraint violation response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handleDataIntegrityViolation

      @ExceptionHandler(org.springframework.dao.DataIntegrityViolationException.class) protected org.springframework.http.ResponseEntity<Object> handleDataIntegrityViolation(org.springframework.dao.DataIntegrityViolationException ex)
      Handle data integrity violation response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity
    • handleMethodArgumentNotValid

      protected org.springframework.http.ResponseEntity<Object> handleMethodArgumentNotValid(org.springframework.web.bind.MethodArgumentNotValidException methodArgumentNotValidException, org.springframework.http.HttpHeaders httpHeaders, org.springframework.http.HttpStatusCode httpStatusCode, org.springframework.web.context.request.WebRequest webRequest)
      Overrides:
      handleMethodArgumentNotValid in class tr.com.havelsan.javarch.service.handler.HvlRestExceptionHandler
    • handleMailException

      @ExceptionHandler(tr.com.havelsan.javarch.mail.support.exception.HvlMailException.class) protected org.springframework.http.ResponseEntity<Object> handleMailException(tr.com.havelsan.javarch.mail.support.exception.HvlMailException ex)
      Handle mail exception response entity.
      Parameters:
      ex - the ex
      Returns:
      the response entity