Class ClassificationController


  • @RestController
    @EnableHypermediaSupport(type=HAL)
    public class ClassificationController
    extends Object
    Controller for all Classification related endpoints.
    • Method Detail

      • getClassification

        @GetMapping(path="/api/v1/classifications/{classificationId}",
                    produces="application/hal+json")
        @Transactional(readOnly=true,
                       rollbackFor=java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<ClassificationRepresentationModel> getClassification​(@PathVariable
                                                                                                            String classificationId)
                                                                                                     throws pro.taskana.classification.api.exceptions.ClassificationNotFoundException
        This endpoint retrieves a single Classification.
        Parameters:
        classificationId - the Id of the requested Classification.
        Returns:
        the requested classification
        Throws:
        pro.taskana.classification.api.exceptions.ClassificationNotFoundException - if the requested classification is not found.
      • createClassification

        @PostMapping(path="/api/v1/classifications")
        @Transactional(rollbackFor=java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<ClassificationRepresentationModel> createClassification​(@RequestBody
                                                                                                               ClassificationRepresentationModel repModel)
                                                                                                        throws pro.taskana.classification.api.exceptions.ClassificationAlreadyExistException,
                                                                                                               pro.taskana.common.api.exceptions.DomainNotFoundException,
                                                                                                               pro.taskana.common.api.exceptions.InvalidArgumentException,
                                                                                                               pro.taskana.classification.api.exceptions.MalformedServiceLevelException,
                                                                                                               pro.taskana.common.api.exceptions.NotAuthorizedException
        This endpoint creates a new Classification.
        Parameters:
        repModel - the Classification which should be created.
        Returns:
        The inserted Classification
        Throws:
        pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not allowed to create a Classification.
        pro.taskana.classification.api.exceptions.ClassificationAlreadyExistException - if the new Classification already exists. This means that a Classification with the requested key and domain already exist.
        pro.taskana.common.api.exceptions.DomainNotFoundException - if the domain within the new Classification does not exist.
        pro.taskana.common.api.exceptions.InvalidArgumentException - if the new Classification does not contain all relevant information.
        pro.taskana.classification.api.exceptions.MalformedServiceLevelException - if the serviceLevel property does not comply * with the ISO 8601 specification
      • updateClassification

        @PutMapping(path="/api/v1/classifications/{classificationId}")
        @Transactional(rollbackFor=java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<ClassificationRepresentationModel> updateClassification​(@PathVariable("classificationId")
                                                                                                               String classificationId,
                                                                                                               @RequestBody
                                                                                                               ClassificationRepresentationModel resource)
                                                                                                        throws pro.taskana.classification.api.exceptions.ClassificationNotFoundException,
                                                                                                               pro.taskana.common.api.exceptions.ConcurrencyException,
                                                                                                               pro.taskana.common.api.exceptions.InvalidArgumentException,
                                                                                                               pro.taskana.classification.api.exceptions.MalformedServiceLevelException,
                                                                                                               pro.taskana.common.api.exceptions.NotAuthorizedException
        This endpoint updates a Classification.
        Parameters:
        classificationId - the Id of the Classification which should be updated.
        resource - the new Classification for the requested id.
        Returns:
        the updated Classification
        Throws:
        pro.taskana.common.api.exceptions.NotAuthorizedException - if the current user is not authorized to update a Classification
        pro.taskana.classification.api.exceptions.ClassificationNotFoundException - if the requested Classification is not found
        pro.taskana.common.api.exceptions.ConcurrencyException - if the requested Classification Id has been modified in the meantime by a different process.
        pro.taskana.common.api.exceptions.InvalidArgumentException - if the Id in the path and in the request body does not match
        pro.taskana.classification.api.exceptions.MalformedServiceLevelException - if the serviceLevel property does not comply * with the ISO 8601 specification
      • deleteClassification

        @DeleteMapping(path="/api/v1/classifications/{classificationId}")
        @Transactional(readOnly=true,
                       rollbackFor=java.lang.Exception.class)
        public org.springframework.http.ResponseEntity<ClassificationRepresentationModel> deleteClassification​(@PathVariable
                                                                                                               String classificationId)
                                                                                                        throws pro.taskana.classification.api.exceptions.ClassificationNotFoundException,
                                                                                                               pro.taskana.classification.api.exceptions.ClassificationInUseException,
                                                                                                               pro.taskana.common.api.exceptions.NotAuthorizedException
        This endpoint deletes a requested Classification if possible.
        Parameters:
        classificationId - the requested Classification Id which should be deleted
        Returns:
        no content
        Throws:
        pro.taskana.classification.api.exceptions.ClassificationNotFoundException - if the requested Classification could not be found
        pro.taskana.classification.api.exceptions.ClassificationInUseException - if there are tasks existing referring to the requested Classification
        pro.taskana.common.api.exceptions.NotAuthorizedException - if the user is not authorized to delete a Classification