Class ScheduleDBDAO

  • All Implemented Interfaces:
    DAO, Iterable<Schedule>

    public class ScheduleDBDAO
    extends ScheduleDAO
    A database-based implementation of the ScheduleDAO.

    The statements to create the tables are now in scripts/sql/createfullhddb.sql and scripts/sql/createfullhddb.mysql.

    • Constructor Detail

      • ScheduleDBDAO

        protected ScheduleDBDAO()
        Constructor for this class, that only checks that the schedules table has the expected version.
    • Method Detail

      • exists

        public boolean exists​(String scheduleName)
        Returns whether a named schedule exists.
        Specified by:
        exists in class ScheduleDAO
        Parameters:
        scheduleName - The name of a schedule
        Returns:
        True if the schedule exists.
        Throws:
        ArgumentNotValid - if the schedulename is null or empty
      • read

        public Schedule read​(String scheduleName)
        Read an existing schedule.
        Specified by:
        read in class ScheduleDAO
        Parameters:
        scheduleName - the name of the schedule
        Returns:
        The schedule read
        Throws:
        ArgumentNotValid - if schedulename is null or empty
        UnknownID - if the schedule doesn't exist
      • update

        public void update​(Schedule schedule)
        Update a schedule in the DAO.
        Specified by:
        update in class ScheduleDAO
        Parameters:
        schedule - The schedule to update
        Throws:
        ArgumentNotValid - If the schedule is null
        UnknownID - If the schedule doesn't exist in the DAO
        PermissionDenied - If the edition of the schedule to update is older than the DAO's
      • getCountSchedules

        public int getCountSchedules()
        Description copied from class: ScheduleDAO
        Get the number of defined schedules.
        Specified by:
        getCountSchedules in class ScheduleDAO
        Returns:
        The number of defined schedules