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 Details

    • 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
  • Constructor Details

    • AbstractRestController

      public AbstractRestController()
  • Method Details

    • 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)
      Records the exception into the operation result (if it's empty!), logs it and creates the response.
    • handleException

      protected org.springframework.http.ResponseEntity<?> handleException(Throwable t)
      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

      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.