@RestController
public abstract class BaseController
extends java.lang.Object
Serves as central ExceptionHandler for all Web bindings inheriting from this class.
WebExceptions indicate an expected workflows while unexpected exceptions are automatically wrapped
to InternalServerExceptions as fallback.
Developers should consider to add hints via WebException.addHint(String) so that as much
information is communicated to the caller as possible.
| Constructor and Description |
|---|
BaseController() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
createCollectionUrl(java.lang.String collectionName) |
protected com.fasterxml.jackson.databind.ObjectMapper |
createObjectMapper() |
protected IoParameters |
createParameters(java.util.Map<java.lang.String,java.lang.String> query,
java.lang.String locale) |
protected IoParameters |
createParameters(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> query,
java.lang.String locale) |
protected IoParameters |
createParameters(RequestSimpleParameterSet query,
java.lang.String locale) |
protected IoParameters |
createParameters(RequestStyledParameterSet query,
java.lang.String locale) |
protected IoParameters |
createParameters(java.lang.String datasetId,
java.util.Map<java.lang.String,java.lang.String> query,
java.lang.String locale) |
protected IoParameters |
createParameters(java.lang.String datasetId,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> query,
java.lang.String locale) |
protected java.util.function.BiConsumer<java.lang.String,IoParseException> |
getExceptionHandle() |
java.lang.String |
getExternalUrl() |
void |
handle400(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
handle404(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
handle500(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
handleException(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected boolean |
isRequestingJsonData(javax.servlet.http.HttpServletRequest request) |
protected boolean |
isRequestingPdfData(javax.servlet.http.HttpServletRequest request) |
protected boolean |
isRequestingPngData(javax.servlet.http.HttpServletRequest request) |
void |
setExternalUrl(java.lang.String externalUrl) |
public java.lang.String getExternalUrl()
public void setExternalUrl(java.lang.String externalUrl)
public java.lang.String createCollectionUrl(java.lang.String collectionName)
protected java.util.function.BiConsumer<java.lang.String,IoParseException> getExceptionHandle()
protected IoParameters createParameters(RequestSimpleParameterSet query, java.lang.String locale)
protected IoParameters createParameters(RequestStyledParameterSet query, java.lang.String locale)
protected IoParameters createParameters(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> query, java.lang.String locale)
protected IoParameters createParameters(java.lang.String datasetId, org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> query, java.lang.String locale)
protected IoParameters createParameters(java.util.Map<java.lang.String,java.lang.String> query, java.lang.String locale)
protected IoParameters createParameters(java.lang.String datasetId, java.util.Map<java.lang.String,java.lang.String> query, java.lang.String locale)
protected boolean isRequestingJsonData(javax.servlet.http.HttpServletRequest request)
protected boolean isRequestingPdfData(javax.servlet.http.HttpServletRequest request)
protected boolean isRequestingPngData(javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value={BadRequestException.class,BadQueryParameterException.class})
public void handle400(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
@ExceptionHandler(value=ResourceNotFoundException.class) public void handle404(java.lang.Exception e, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@ExceptionHandler(value=InternalServerException.class) public void handle500(java.lang.Exception e, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@ExceptionHandler(value={java.lang.RuntimeException.class,java.lang.Exception.class,java.lang.Throwable.class})
public void handleException(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
protected com.fasterxml.jackson.databind.ObjectMapper createObjectMapper()
Copyright © 2013–2018 52North Initiative for Geospatial Open Source Software GmbH. All rights reserved.