Package pro.taskana.classification.rest
Class ClassificationController
java.lang.Object
pro.taskana.classification.rest.ClassificationController
@RestController
@EnableHypermediaSupport(type=HAL)
public class ClassificationController
extends Object
Controller for all
Classification related endpoints.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<ClassificationRepresentationModel>This endpoint creates a new Classification.org.springframework.http.ResponseEntity<ClassificationRepresentationModel>deleteClassification(String classificationId) This endpoint deletes a requested Classification if possible.org.springframework.http.ResponseEntity<ClassificationRepresentationModel>getClassification(String classificationId) This endpoint retrieves a single Classification.org.springframework.http.ResponseEntity<ClassificationSummaryPagedRepresentationModel>getClassifications(jakarta.servlet.http.HttpServletRequest request, ClassificationQueryFilterParameter filterParameter, ClassificationController.ClassificationQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.classification.api.models.ClassificationSummary, pro.taskana.classification.api.ClassificationQuery> pagingParameter) This endpoint retrieves a list of existing Classifications.org.springframework.http.ResponseEntity<ClassificationRepresentationModel>updateClassification(String classificationId, ClassificationRepresentationModel resource) This endpoint updates a Classification.
-
Method Details
-
getClassifications
@GetMapping(path="/api/v1/classifications") @Transactional(readOnly=true, rollbackFor=java.lang.Exception.class) public org.springframework.http.ResponseEntity<ClassificationSummaryPagedRepresentationModel> getClassifications(jakarta.servlet.http.HttpServletRequest request, ClassificationQueryFilterParameter filterParameter, ClassificationController.ClassificationQuerySortParameter sortParameter, QueryPagingParameter<pro.taskana.classification.api.models.ClassificationSummary, pro.taskana.classification.api.ClassificationQuery> pagingParameter) This endpoint retrieves a list of existing Classifications. Filters can be applied.- Parameters:
request- the HTTP requestfilterParameter- the filter parameterssortParameter- the sort parameterspagingParameter- the paging parameters- Returns:
- the classifications with the given filter, sort and paging options.
-
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 theserviceLevelproperty 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 Classificationpro.taskana.classification.api.exceptions.ClassificationNotFoundException- if the requested Classification is not foundpro.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 matchpro.taskana.classification.api.exceptions.MalformedServiceLevelException- if theserviceLevelproperty 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 foundpro.taskana.classification.api.exceptions.ClassificationInUseException- if there are tasks existing referring to the requested Classificationpro.taskana.common.api.exceptions.NotAuthorizedException- if the user is not authorized to delete a Classification
-