Package main.controller.request
Class StudentManager
java.lang.Object
main.controller.request.StudentManager
StudentManager class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringchangeProjectTitle(String projectID, String newTitle, String studentID) student request to change the title of a projectstatic StringderegisterStudent(String projectID, String studentID) student request to deregister from a projectstatic Studentget the student by IDgetStudentRequestHistory(String studentID) get the student request historystatic StringregisterStudent(String projectID, String studentID) student request to register to a project
-
Constructor Details
-
StudentManager
public StudentManager()
-
-
Method Details
-
deregisterStudent
public static String deregisterStudent(String projectID, String studentID) throws IllegalStateException, StudentStatusException, ModelAlreadyExistsException, ModelNotFoundException student request to deregister from a project- Parameters:
projectID- the project ID of the project that the student is going to deregister fromstudentID- the student ID of the student that is going to deregister from the project- Returns:
- The ID of the new reuquest
- Throws:
IllegalStateException- if the project is not allocatedStudentStatusException- if the student is not registeredModelAlreadyExistsException- if the request already existsModelNotFoundException- if the project or student is not found
-
registerStudent
public static String registerStudent(String projectID, String studentID) throws ModelNotFoundException, StudentStatusException, IllegalStateException, ModelAlreadyExistsException student request to register to a project- Parameters:
projectID- the project ID of the project that the student is going to register tostudentID- the student ID of the student that is going to register to the project- Returns:
- the ID of the new Request
- Throws:
ModelNotFoundException- if the project or student is not foundStudentStatusException- if the student is not unregisteredIllegalStateException- if the project is not availableModelAlreadyExistsException- if the request already exists
-
changeProjectTitle
public static String changeProjectTitle(String projectID, String newTitle, String studentID) throws ModelAlreadyExistsException, ModelNotFoundException student request to change the title of a project- Parameters:
projectID- the project ID of the project that the student is going to change the title ofnewTitle- the new title of the projectstudentID- the student ID of the student that is going to change the title of the project- Returns:
- the ID of the new Request
- Throws:
ModelAlreadyExistsException- if the request already existsModelNotFoundException- if the project or student is not found
-
getStudentRequestHistory
get the student request history- Parameters:
studentID- the student ID- Returns:
- the list of requests
-
getByID
get the student by ID- Parameters:
studentID- the student ID- Returns:
- the student
- Throws:
ModelNotFoundException- if the student is not found
-