Class WorkerMutationController
java.lang.Object
it.univr.passportease.controller.worker.WorkerMutationController
Controller for worker mutations. It handles the following GraphQL mutations:
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate BucketLimiter
Bucket limiter.private RequestAnalyzer
Request analyzer.private final WorkerMutationService
Worker mutation service. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateRequest
(RequestInput requestInput) This mutation creates a request.void
deleteRequest
(String requestID) This mutation deletes a request.modifyRequest
(String requestID, RequestInput requestInput) This mutation modifies a request.
-
Field Details
-
workerMutationService
Worker mutation service. -
bucketLimiter
Bucket limiter. -
requestAnalyzer
Request analyzer.
-
-
Constructor Details
-
WorkerMutationController
public WorkerMutationController()
-
-
Method Details
-
createRequest
@MutationMapping public Request createRequest(@Argument("request") RequestInput requestInput) throws AuthenticationCredentialsNotFoundException, WorkerNotFoundException, InvalidRequestTypeException, OfficeOverloadedException, RateLimitException This mutation creates a request. It returns the created request.- Parameters:
requestInput
-RequestInput
containing the request's data- Returns:
- the created
Request
- Throws:
AuthenticationCredentialsNotFoundException
- if the worker has not inserted the token in the requestWorkerNotFoundException
- if the worker is not foundInvalidRequestTypeException
- if the request type is invalidOfficeOverloadedException
- if the office is overloaded and cannot accept more requestsRateLimitException
- if the worker has exceeded the rate limit
-
modifyRequest
@MutationMapping public Request modifyRequest(@Argument("requestID") String requestID, @Argument("request") RequestInput requestInput) throws WorkerNotFoundException, RequestNotFoundException, OfficeOverloadedException, RateLimitException, AuthenticationCredentialsNotFoundException This mutation modifies a request. It returns the modified request.- Parameters:
requestID
- the request's IDrequestInput
-RequestInput
containing the request's data- Returns:
- the modified
Request
- Throws:
WorkerNotFoundException
- if the worker is not foundRequestNotFoundException
- if the request is not foundOfficeOverloadedException
- if the office is overloaded and cannot accept more requestsAuthenticationCredentialsNotFoundException
- if the worker has not inserted the token in the requestRateLimitException
- if the worker has exceeded the rate limit
-
deleteRequest
@MutationMapping public void deleteRequest(@Argument("requestID") String requestID) throws WorkerNotFoundException, RequestNotFoundException, RateLimitException, AuthenticationCredentialsNotFoundException This mutation deletes a request. It returns nothing.- Parameters:
requestID
- the request's ID- Throws:
WorkerNotFoundException
- if the worker is not foundRequestNotFoundException
- if the request is not foundAuthenticationCredentialsNotFoundException
- if the worker has not inserted the token in the requestRateLimitException
- if the worker has exceeded the rate limit
-