Java Code Examples for org.springframework.http.HttpStatus#IM_USED

The following examples show how to use org.springframework.http.HttpStatus#IM_USED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 2
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 3
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 4
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateUserException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateUserException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 5
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateRestaurantException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateRestaurantException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 6
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 7
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 8
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateUserException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateUserException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 9
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateRestaurantException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateRestaurantException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 10
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateRestaurantException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateRestaurantException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 11
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 12
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateUserException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateUserException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 13
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateRestaurantException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateRestaurantException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 14
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 15
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateUserException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateUserException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 16
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateRestaurantException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateRestaurantException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 17
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateBookingException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateBookingException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}
 
Example 18
Source File: EndpointErrorHandler.java    From Mastering-Microservices-with-Java-Third-Edition with MIT License 5 votes vote down vote up
@ExceptionHandler(DuplicateUserException.class)
public ResponseEntity<ErrorInfo> handleDuplicateRestaurantException(HttpServletRequest request,
    DuplicateUserException ex, Locale locale) {
  ErrorInfo response = new ErrorInfo();
  response.setUrl(request.getRequestURL().toString());
  response.setMessage(messageSource.getMessage(ex.getMessage(), ex.getArgs(), locale));
  return new ResponseEntity<>(response, HttpStatus.IM_USED);
}