Package main.controller.request
Class RequestManager
java.lang.Object
main.controller.request.RequestManager
RequestManager class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
approveRequest
(String requestID) approve a requeststatic void
approveRequest
(Request request) approve a requeststatic void
approveRequestForStatus
(String requestID) approve a requestprivate static void
approveStudentChangeTitleRequest
(Request request) approve the request of student change titleprivate static void
approve the request of student deregistrationprivate static void
approveStudentRegistrationRequest
(Request request) approve the request of student registrationprivate static void
approveTransferStudentRequest
(Request request) approve the request of supervisor to transfer studentstatic String
get the request ID of the next requeststatic Request
getRequest
(String requestID) get a request by IDstatic void
rejectRequest
(String requestID) reject a requeststatic void
rejectRequestForStatus
(String requestID) reject a requestprivate static void
rejectStudentRegistrationRequest
(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
-