Class ProjectManager

java.lang.Object
main.controller.project.ProjectManager

public class ProjectManager extends Object
A class manages the project
  • 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 project
      newTitle - the new title of the project
      Throws:
      ModelNotFoundException - if the project is not found
    • viewAllProject

      public static List<Project> viewAllProject()
      Change the supervisor of a project
      Returns:
      the new supervisor
    • viewAvailableProjects

      public static List<Project> 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 project
      projectTitle - the title of the project
      supervisorID - 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 project
      supervisorID - the ID of the supervisor
      Returns:
      the new project
      Throws:
      ModelAlreadyExistsException - if the project already exists
    • getAllProject

      public static List<Project> getAllProject()
      get the list of all projects
      Returns:
      the list of all projects
    • getAllProjectByStatus

      public static List<Project> getAllProjectByStatus(ProjectStatus projectStatus)
      get the list of all projects by status
      Parameters:
      projectStatus - the status of the project
      Returns:
      the list of all projects
    • getNewProjectID

      public static String 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 project
      supervisorID - the ID of the supervisor
      Throws:
      ModelNotFoundException - if the project is not found
    • deallocateProject

      public static void deallocateProject(String projectID) throws ModelNotFoundException
      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 project
      studentID - 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

      public static boolean notContainsProjectByID(String projectID)
      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

      public static boolean containsProjectByID(String projectID)
      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

      public static Project getStudentProject(Student student)
      get the project of a student
      Parameters:
      student - the student
      Returns:
      the project of the student
    • getByID

      public static Project getByID(String projectID) throws ModelNotFoundException
      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

      public static List<Project> getAllAvailableProject()
      get all available projects
      Returns:
      all available projects
    • getProjectByID

      public static Project getProjectByID(String projectID) throws ModelNotFoundException
      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

      public static List<Project> getAllProjectsBySupervisor(String supervisorID)
      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