Class UserQueryController
java.lang.Object
it.univr.passportease.controller.user.UserQueryController
Controller for user queries. It handles the following GraphQL queries:
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprivate BucketLimiter
Bucket limiter.private RequestAnalyzer
Request analyzer.private final UserQueryService
User query service. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetReportDetailsByAvailabilityID
(String availabilityId) This query returns the report details for the given availability id.This query returns the request types associated to the user.This query returns the user details associated to the user.This query returns the notifications associated to the user.This query returns the reservations associated to the user.
-
Field Details
-
userQueryService
User query service. -
bucketLimiter
Bucket limiter. -
requestAnalyzer
Request analyzer.
-
-
Constructor Details
-
UserQueryController
public UserQueryController()
-
-
Method Details
-
getRequestTypesByUser
@QueryMapping public List<RequestType> getRequestTypesByUser() throws RateLimitException, RequestTypeNotFoundException, AuthenticationCredentialsNotFoundExceptionThis query returns the request types associated to the user.- Returns:
- the list of request types associated to the user
- Throws:
RateLimitException
- if the user has exceeded the rate limitRequestTypeNotFoundException
- if the user has no request types associatedAuthenticationCredentialsNotFoundException
- if the user has not included the token in the request
-
getReportDetailsByAvailabilityID
@QueryMapping public ReportDetails getReportDetailsByAvailabilityID(@Argument("availabilityID") String availabilityId) throws SecurityException, InvalidAvailabilityIDException This query returns the report details for the given availability id.- Parameters:
availabilityId
- the availability id for which the report details are requested- Returns:
- see
ReportDetails
, containing all the information to generate the report for the given availability - Throws:
SecurityException
- if the user is not authorized to access the report details requested, or if the user has not included the token in the requestInvalidAvailabilityIDException
- if the availability id is not valid
-
getUserNotifications
@QueryMapping public List<Notification> getUserNotifications() throws AuthenticationCredentialsNotFoundException, RateLimitExceptionThis query returns the notifications associated to the user.- Returns:
- the list of notifications associated to the user
- Throws:
AuthenticationCredentialsNotFoundException
- if the user has not included the token in the requestRateLimitException
- if the user has exceeded the rate limit
-
getUserDetails
@QueryMapping public User getUserDetails() throws AuthenticationCredentialsNotFoundException, RateLimitException, UserNotFoundExceptionThis query returns the user details associated to the user.- Returns:
- the user details associated to the user, for generating the profile page
- Throws:
AuthenticationCredentialsNotFoundException
- if the user has not included the token in the requestRateLimitException
- if the user has exceeded the rate limitUserNotFoundException
- if the user is not found
-
getUserReservations
@QueryMapping public List<Availability> getUserReservations() throws AuthenticationCredentialsNotFoundException, RateLimitExceptionThis query returns the reservations associated to the user.- Returns:
- the list of reservations associated to the user
- Throws:
AuthenticationCredentialsNotFoundException
- if the user has not included the token in the requestRateLimitException
- if the user has exceeded the rate limit
-