Class AgendaDAOImpl

java.lang.Object
it.unisa.c03.myPersonalTrainer.agenda.dao.AgendaDAOImpl
All Implemented Interfaces:
AgendaDAO

public class AgendaDAOImpl
extends java.lang.Object
implements AgendaDAO
  • Constructor Details

    • AgendaDAOImpl

      public AgendaDAOImpl()
  • Method Details

    • saveAppointment

      public boolean saveAppointment​(Appointment appuntamento) throws java.io.IOException
      Specified by:
      saveAppointment in interface AgendaDAO
      Parameters:
      appuntamento - new appointment to insert in the database
      Returns:
      return true if the appointment is saved,false otherwise
      Throws:
      java.io.IOException
    • findAppointmetsByEmail

      public java.util.List<Appointment> findAppointmetsByEmail​(java.lang.String mail) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      Specified by:
      findAppointmetsByEmail in interface AgendaDAO
      Parameters:
      mail - customer's email
      Returns:
      return all the customer's appointment
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • findAppointmentByDate

      public java.util.List<Appointment> findAppointmentByDate​(java.lang.String date) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      Specified by:
      findAppointmentByDate in interface AgendaDAO
      Parameters:
      date - date to check appointment
      Returns:
      returns all appointments for a given date
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • deleteappointment

      public boolean deleteappointment​(Appointment appuntamento) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      Specified by:
      deleteappointment in interface AgendaDAO
      Parameters:
      appuntamento - appointment to delete
      Returns:
      true if the appointment is deleted
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • insertAvailability

      public boolean insertAvailability​(Availability availability) throws java.io.IOException
      Description copied from interface: AgendaDAO
      interact with database to insert the availability.
      Specified by:
      insertAvailability in interface AgendaDAO
      Parameters:
      availability - the availability to insert into database
      Returns:
      true if the insertion occurred, false otherwise
      Throws:
      java.io.IOException
    • findAvailabilityByDate

      public java.util.List<Availability> findAvailabilityByDate​(java.lang.String date) throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.ExecutionException
      find an availability by date.
      Specified by:
      findAvailabilityByDate in interface AgendaDAO
      Parameters:
      date - to find availability.
      Returns:
      Throws:
      java.io.IOException
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
    • deleteAvailability

      public boolean deleteAvailability​(Availability availability) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      remove an availability.
      Specified by:
      deleteAvailability in interface AgendaDAO
      Parameters:
      availability - the availability to remove.
      Returns:
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • findAvailabilityByDateAndTime

      public Availability findAvailabilityByDateAndTime​(java.lang.String date, int time) throws java.io.IOException, java.lang.InterruptedException, java.util.concurrent.ExecutionException
      search an availability with this time and date.
      Specified by:
      findAvailabilityByDateAndTime in interface AgendaDAO
      Parameters:
      date -
      time -
      Returns:
      the availability, null if there isn't
      Throws:
      java.io.IOException
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException