Class JsExecutionController


  • @RestController
    @RequestMapping("/executions")
    public class JsExecutionController
    extends java.lang.Object
    Main Spring MVC REST-controller.
    Since:
    1.0
    Author:
    Martynenko Anton
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<org.springframework.hateoas.EntityModel<JsExecutionDTO>> cancelJsExecution​(java.lang.Integer executionId)
      Cancel execution by id.
      org.springframework.http.ResponseEntity<org.springframework.hateoas.EntityModel<JsExecutionDTO>> createNew​(JsExecutionDTO newJsExecutionDTO)
      Runs new JS code execution.
      org.springframework.http.ResponseEntity<java.lang.String> deleteJsExecution​(java.lang.Integer executionId)
      Delete JsExecution by id.
      org.springframework.http.ResponseEntity<java.lang.String> getDetails​(java.lang.Integer executionId, java.lang.String property)
      Returns script body plain text of JsExecution by id.
      org.springframework.hateoas.EntityModel<JsExecutionDTO> getOne​(java.lang.Integer executionId)
      Returns JsExecution by id.
      org.springframework.hateoas.CollectionModel<org.springframework.hateoas.EntityModel<JsExecutionDTO>> listAll​(java.util.Optional<Status> status, java.util.Optional<SortBy> sortBy)
      Returns JsExecution collection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsExecutionController

        public JsExecutionController()
    • Method Detail

      • createNew

        @PostMapping(produces="application/json")
        public org.springframework.http.ResponseEntity<org.springframework.hateoas.EntityModel<JsExecutionDTO>> createNew​(@RequestBody
                                                                                                                          JsExecutionDTO newJsExecutionDTO)
        Runs new JS code execution.
        Parameters:
        newJsExecutionDTO - new JsExecution to save and run
        Returns:
        ResponseEntity with containing json view of JsExecution with HATEOAS links
        Since:
        1.0
      • getOne

        @GetMapping(value="/{executionId}",
                    produces={"application/json","application/problem+json"})
        public org.springframework.hateoas.EntityModel<JsExecutionDTO> getOne​(@PathVariable
                                                                              java.lang.Integer executionId)
        Returns JsExecution by id.
        Parameters:
        executionId - JsExecution id.
        Returns:
        EntityModel containing json view of JsExecution with HATEOAS links
        Since:
        1.0
      • listAll

        @GetMapping(produces="application/json")
        public org.springframework.hateoas.CollectionModel<org.springframework.hateoas.EntityModel<JsExecutionDTO>> listAll​(@RequestParam(required=false)
                                                                                                                            java.util.Optional<Status> status,
                                                                                                                            @RequestParam(required=false)
                                                                                                                            java.util.Optional<SortBy> sortBy)
        Returns JsExecution collection.
        Parameters:
        status - optional Status filtration criteria
        sortBy - optional SortBy sorting criteria
        Returns:
        CollectionModel of EntityModel (JsExecution json view with HATEOAS links)
        Since:
        1.0
      • cancelJsExecution

        @DeleteMapping(value="/{executionId}/cancel",
                       produces={"application/json","application/problem+json"})
        public org.springframework.http.ResponseEntity<org.springframework.hateoas.EntityModel<JsExecutionDTO>> cancelJsExecution​(@PathVariable
                                                                                                                                  java.lang.Integer executionId)
        Cancel execution by id.
        Parameters:
        executionId - JsExecution id
        Returns:
        ResponseEntity containing json view of JsExecution with HATEOAS links
        Since:
        1.0
      • deleteJsExecution

        @DeleteMapping(value="/{executionId}",
                       produces="application/problem+json")
        public org.springframework.http.ResponseEntity<java.lang.String> deleteJsExecution​(@PathVariable
                                                                                           java.lang.Integer executionId)
        Delete JsExecution by id.
        Parameters:
        executionId - JsExecution id
        Returns:
        empty response body
        Since:
        1.0
      • getDetails

        @GetMapping(value="/{executionId}/{property}",
                    produces={"text/plain","application/problem+json"})
        public org.springframework.http.ResponseEntity<java.lang.String> getDetails​(@PathVariable
                                                                                    java.lang.Integer executionId,
                                                                                    @PathVariable
                                                                                    java.lang.String property)
        Returns script body plain text of JsExecution by id.
        Parameters:
        executionId - JsExecution id
        property - JsExecution's property string view
        Returns:
        plain text or empty body
        Since:
        1.1