Package main.controller.project
Class ProjectManager
java.lang.Object
main.controller.project.ProjectManager
A class manages the project
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
allocateProject
(String projectID, String studentID) allocate a projectstatic void
changeProjectTitle
(String projectID, String newTitle) Change the title of a projectstatic boolean
containsProjectByID
(String projectID) Check if the project is in the repositorystatic Project
createProject
(String projectTitle, String supervisorID) create a new projectstatic void
createProject
(String projectID, String projectTitle, String supervisorID) create a new projectstatic void
deallocateProject
(String projectID) deallocate a projectget all available projectsget the list of all projectsgetAllProjectByStatus
(ProjectStatus projectStatus) get the list of all projects by statusgetAllProjectsBySupervisor
(String supervisorID) get all projects by supervisorstatic Project
get the project of a supervisorstatic String
get the list of all projects by supervisorstatic Project
getProjectByID
(String projectID) get project by the project IDstatic Project
getStudentProject
(Student student) get the project of a studentstatic void
load projects from csv resource filestatic boolean
notContainsProjectByID
(String projectID) Check if the project is not in the repositorystatic boolean
check if the repository is emptystatic void
transferToNewSupervisor
(String projectID, String supervisorID) transfer a student to a new supervisorstatic void
update the status of all projectsChange the supervisor of a projectView all the projects that are available
-
Constructor Details
-
ProjectManager
public ProjectManager()
-
-
Method Details
-
changeProjectTitle
public static void changeProjectTitle(String projectID, String newTitle) throws ModelNotFoundException Change the title of a project- Parameters:
projectID
- the ID of the projectnewTitle
- the new title of the project- Throws:
ModelNotFoundException
- if the project is not found
-
viewAllProject
Change the supervisor of a project- Returns:
- the new supervisor
-
viewAvailableProjects
View all the projects that are available- Returns:
- the list of available projects
-
createProject
public static void createProject(String projectID, String projectTitle, String supervisorID) throws ModelAlreadyExistsException create a new project- Parameters:
projectID
- the ID of the projectprojectTitle
- the title of the projectsupervisorID
- the ID of the supervisor- Throws:
ModelAlreadyExistsException
- if the project already exists
-
createProject
public static Project createProject(String projectTitle, String supervisorID) throws ModelAlreadyExistsException create a new project- Parameters:
projectTitle
- the title of the projectsupervisorID
- the ID of the supervisor- Returns:
- the new project
- Throws:
ModelAlreadyExistsException
- if the project already exists
-
getAllProject
get the list of all projects- Returns:
- the list of all projects
-
getAllProjectByStatus
get the list of all projects by status- Parameters:
projectStatus
- the status of the project- Returns:
- the list of all projects
-
getNewProjectID
get the list of all projects by supervisor- Returns:
- the list of all projects
-
transferToNewSupervisor
public static void transferToNewSupervisor(String projectID, String supervisorID) throws ModelNotFoundException transfer a student to a new supervisor- Parameters:
projectID
- the ID of the projectsupervisorID
- the ID of the supervisor- Throws:
ModelNotFoundException
- if the project is not found
-
deallocateProject
deallocate a project- Parameters:
projectID
- the ID of the project- Throws:
ModelNotFoundException
- if the project is not found
-
allocateProject
public static void allocateProject(String projectID, String studentID) throws ModelNotFoundException allocate a project- Parameters:
projectID
- the ID of the projectstudentID
- the ID of the student- Throws:
ModelNotFoundException
- if the project is not found
-
loadProjects
public static void loadProjects()load projects from csv resource file -
repositoryIsEmpty
public static boolean repositoryIsEmpty()check if the repository is empty- Returns:
- true if the repository is empty
-
notContainsProjectByID
Check if the project is not in the repository- Parameters:
projectID
- the ID of the project- Returns:
- true if the project is not in the repository
-
containsProjectByID
Check if the project is in the repository- Parameters:
projectID
- the ID of the project- Returns:
- true if the project is in the repository
-
getStudentProject
get the project of a student- Parameters:
student
- the student- Returns:
- the project of the student
-
getByID
get the project of a supervisor- Parameters:
projectID
- the ID of the project- Returns:
- the project of the supervisor
- Throws:
ModelNotFoundException
- if the project is not found
-
getAllAvailableProject
get all available projects- Returns:
- all available projects
-
getProjectByID
get project by the project ID- Parameters:
projectID
- the ID of the project- Returns:
- the project
- Throws:
ModelNotFoundException
- if the project is not found
-
getAllProjectsBySupervisor
get all projects by supervisor- Parameters:
supervisorID
- the ID of the supervisor- Returns:
- all projects by supervisor
-
updateProjectsStatus
public static void updateProjectsStatus()update the status of all projects
-