Package main.controller.request
Class RequestManager
java.lang.Object
main.controller.request.RequestManager
RequestManager class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapproveRequest(String requestID) approve a requeststatic voidapproveRequest(Request request) approve a requeststatic voidapproveRequestForStatus(String requestID) approve a requestprivate static voidapproveStudentChangeTitleRequest(Request request) approve the request of student change titleprivate static voidapprove the request of student deregistrationprivate static voidapproveStudentRegistrationRequest(Request request) approve the request of student registrationprivate static voidapproveTransferStudentRequest(Request request) approve the request of supervisor to transfer studentstatic Stringget the request ID of the next requeststatic RequestgetRequest(String requestID) get a request by IDstatic voidrejectRequest(String requestID) reject a requeststatic voidrejectRequestForStatus(String requestID) reject a requestprivate static voidrejectStudentRegistrationRequest(Request request) reject the request of student registration
-
Constructor Details
-
RequestManager
public RequestManager()
-
-
Method Details
-
getNewRequestID
get the request ID of the next request- Returns:
- the request ID of the next request
-
approveRequestForStatus
approve a request- Parameters:
requestID- the request ID- Throws:
ModelNotFoundException- if the request is not found
-
rejectRequestForStatus
reject a request- Parameters:
requestID- the request ID- Throws:
ModelNotFoundException- if the request is not found
-
approveStudentChangeTitleRequest
approve the request of student change title- Parameters:
request- the request of student change title- Throws:
IllegalArgumentException- if the request is not a StudentChangeTitleRequest
-
approveTransferStudentRequest
private static void approveTransferStudentRequest(Request request) throws SupervisorStudentsLimitExceedException approve the request of supervisor to transfer student- Parameters:
request- the request of supervisor to transfer student- Throws:
SupervisorStudentsLimitExceedException- if the supervisor has reached the maximum number of studentsIllegalArgumentException- if the request is not a TransferStudentRequest
-
approveStudentDeregistrationRequest
approve the request of student deregistration- Parameters:
request- the request of student deregistration- Throws:
IllegalArgumentException- if the request is not a StudentDeregistrationRequest
-
approveStudentRegistrationRequest
private static void approveStudentRegistrationRequest(Request request) throws ModelNotFoundException approve the request of student registration- Parameters:
request- the request of student registration- Throws:
ModelNotFoundException- if the project or supervisor is not foundIllegalArgumentException- if the request is not a StudentRegistrationRequest
-
approveRequest
public static void approveRequest(Request request) throws ModelNotFoundException, SupervisorStudentsLimitExceedException approve a request- Parameters:
request- the request to be approved- Throws:
ModelNotFoundException- if the request is not foundSupervisorStudentsLimitExceedException- if the supervisor has reached the maximum number of students
-
approveRequest
approve a request- Parameters:
requestID- the request ID- Throws:
SupervisorStudentsLimitExceedException- if the supervisor has reached the maximum number of students
-
rejectStudentRegistrationRequest
reject the request of student registration- Parameters:
request- the request of student registration
-
rejectRequest
reject a request- Parameters:
requestID- the request ID- Throws:
PageBackException- if the request is not pending
-
getRequest
get a request by ID- Parameters:
requestID- the request ID- Returns:
- the request
- Throws:
ModelNotFoundException- if the request is not found
-