Package com.evolveum.midpoint.rest.impl
Class AbstractRestController
- java.lang.Object
-
- com.evolveum.midpoint.rest.impl.AbstractRestController
-
- Direct Known Subclasses:
ClusterRestController
,ExtensionSchemaRestController
,ModelRestController
,RestApiIndex
public class AbstractRestController extends Object
Base REST controller class providing common (utility) methods and logger.
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditService
auditService
protected Trace
logger
protected PrismContext
prismContext
protected SecurityHelper
securityHelper
protected TaskManager
taskManager
-
Constructor Summary
Constructors Constructor Description AbstractRestController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
controllerBasePath()
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)
protected org.springframework.http.ResponseEntity<?>
handleExceptionNoLog(OperationResult result, Throwable t)
protected Task
initRequest()
-
-
-
Field Detail
-
logger
protected final Trace logger
-
auditService
@Autowired protected AuditService auditService
-
securityHelper
@Autowired protected SecurityHelper securityHelper
-
taskManager
@Autowired protected TaskManager taskManager
-
prismContext
@Autowired protected PrismContext prismContext
-
-
Method Detail
-
initRequest
protected Task initRequest()
-
createSubresult
protected OperationResult createSubresult(Task task, String operation)
-
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)
-
handleExceptionNoLog
protected org.springframework.http.ResponseEntity<?> handleExceptionNoLog(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
protected void finishRequest(Task task, OperationResult result)
-
controllerBasePath
protected String controllerBasePath()
Returns base path (without servlet context) reflecting currently used request. This solves the problem of base path being one of multiple possible mappings.
-
-