Class RequestManager

java.lang.Object
main.controller.request.RequestManager

public class RequestManager extends Object
RequestManager class
  • Constructor Details

    • RequestManager

      public RequestManager()
  • Method Details

    • getNewRequestID

      public static String getNewRequestID()
      get the request ID of the next request
      Returns:
      the request ID of the next request
    • approveRequestForStatus

      public static void approveRequestForStatus(String requestID) throws ModelNotFoundException
      approve a request
      Parameters:
      requestID - the request ID
      Throws:
      ModelNotFoundException - if the request is not found
    • rejectRequestForStatus

      public static void rejectRequestForStatus(String requestID) throws ModelNotFoundException
      reject a request
      Parameters:
      requestID - the request ID
      Throws:
      ModelNotFoundException - if the request is not found
    • approveStudentChangeTitleRequest

      private static void approveStudentChangeTitleRequest(Request request)
      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 students
      IllegalArgumentException - if the request is not a TransferStudentRequest
    • approveStudentDeregistrationRequest

      private static void approveStudentDeregistrationRequest(Request request)
      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 found
      IllegalArgumentException - 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 found
      SupervisorStudentsLimitExceedException - if the supervisor has reached the maximum number of students
    • approveRequest

      public static void approveRequest(String requestID) throws SupervisorStudentsLimitExceedException
      approve a request
      Parameters:
      requestID - the request ID
      Throws:
      SupervisorStudentsLimitExceedException - if the supervisor has reached the maximum number of students
    • rejectStudentRegistrationRequest

      private static void rejectStudentRegistrationRequest(Request request)
      reject the request of student registration
      Parameters:
      request - the request of student registration
    • rejectRequest

      public static void rejectRequest(String requestID) throws PageBackException
      reject a request
      Parameters:
      requestID - the request ID
      Throws:
      PageBackException - if the request is not pending
    • getRequest

      public static Request getRequest(String requestID) throws ModelNotFoundException
      get a request by ID
      Parameters:
      requestID - the request ID
      Returns:
      the request
      Throws:
      ModelNotFoundException - if the request is not found