Package com.evolveum.midpoint.rest.impl
Class AbstractRestController
java.lang.Object
com.evolveum.midpoint.rest.impl.AbstractRestController
- Direct Known Subclasses:
ClusterRestController
,ExtensionSchemaRestController
,ModelRestController
,RestApiIndex
Base REST controller class providing common (utility) methods and logger.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AuditService
protected final Trace
protected PrismContext
protected SecurityHelper
protected TaskManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns base path (without servlet context) reflecting currently used request.protected <T> org.springframework.http.ResponseEntity<?>
createBody
(org.springframework.http.ResponseEntity.BodyBuilder builder, boolean sendOriginObjectIfNotSuccess, T body, OperationResult result) protected org.springframework.http.ResponseEntity<?>
createErrorResponseBuilder
(OperationResult result, Throwable t) protected org.springframework.http.ResponseEntity<?>
createErrorResponseBuilder
(org.springframework.http.HttpStatus status, OperationResult result) protected org.springframework.http.ResponseEntity<?>
createResponse
(org.springframework.http.HttpStatus statusCode, OperationResult result) protected <T> org.springframework.http.ResponseEntity<?>
createResponse
(org.springframework.http.HttpStatus httpStatus, T body, OperationResult result) protected <T> org.springframework.http.ResponseEntity<?>
createResponse
(org.springframework.http.HttpStatus httpStatus, T body, OperationResult result, boolean sendOriginObjectIfNotSuccess) protected org.springframework.http.ResponseEntity<?>
createResponseWithLocation
(org.springframework.http.HttpStatus httpStatus, URI location, OperationResult result) protected OperationResult
createSubresult
(Task task, String operation) protected void
finishRequest
(Task task, OperationResult result) protected org.springframework.http.ResponseEntity<?>
handleException
(OperationResult result, Throwable t) Records the exception into the operation result (if it's empty!)protected org.springframework.http.ResponseEntity<?>
The version without operation result handling.protected org.springframework.http.ResponseEntity<?>
handleExceptionNoLog
(@Nullable OperationResult result, Throwable t) protected Task
-
Field Details
-
logger
-
auditService
-
securityHelper
-
taskManager
-
prismContext
-
-
Constructor Details
-
AbstractRestController
public AbstractRestController()
-
-
Method Details
-
initRequest
-
createSubresult
-
createResponse
protected org.springframework.http.ResponseEntity<?> createResponse(org.springframework.http.HttpStatus statusCode, OperationResult result) -
createResponse
protected <T> org.springframework.http.ResponseEntity<?> createResponse(org.springframework.http.HttpStatus httpStatus, T body, OperationResult result) -
createResponse
protected <T> org.springframework.http.ResponseEntity<?> createResponse(org.springframework.http.HttpStatus httpStatus, T body, OperationResult result, boolean sendOriginObjectIfNotSuccess) -
createResponseWithLocation
protected org.springframework.http.ResponseEntity<?> createResponseWithLocation(org.springframework.http.HttpStatus httpStatus, URI location, OperationResult result) -
createBody
protected <T> org.springframework.http.ResponseEntity<?> createBody(org.springframework.http.ResponseEntity.BodyBuilder builder, boolean sendOriginObjectIfNotSuccess, T body, OperationResult result) -
handleException
protected org.springframework.http.ResponseEntity<?> handleException(OperationResult result, Throwable t) Records the exception into the operation result (if it's empty!), logs it and creates the response. -
handleException
The version without operation result handling. -
handleExceptionNoLog
protected org.springframework.http.ResponseEntity<?> handleExceptionNoLog(@Nullable @Nullable OperationResult result, Throwable t) -
createErrorResponseBuilder
protected org.springframework.http.ResponseEntity<?> createErrorResponseBuilder(OperationResult result, Throwable t) -
createErrorResponseBuilder
protected org.springframework.http.ResponseEntity<?> createErrorResponseBuilder(org.springframework.http.HttpStatus status, OperationResult result) -
finishRequest
-
controllerBasePath
Returns base path (without servlet context) reflecting currently used request. This solves the problem of base path being one of multiple possible mappings.
-