Class RequiredTrainingPlanDAOImpl

java.lang.Object
it.unisa.c03.myPersonalTrainer.requiredtrainingplan.dao.RequiredTrainingPlanDAOImpl
All Implemented Interfaces:
RequiredTrainingPlanDAO

public class RequiredTrainingPlanDAOImpl
extends java.lang.Object
implements RequiredTrainingPlanDAO
  • Constructor Summary

    Constructors
    Constructor Description
    RequiredTrainingPlanDAOImpl()  
  • Method Summary

    Modifier and Type Method Description
    RequiredTrainingPlan findAccountByEmail​(java.lang.String email)
    this function can check if the email is into the RequiredTrainingPlan document so this user has yet a TrainngPlan request.
    java.lang.String getAccountDocumentIdByEmail​(java.lang.String email)
    This DAO method looks for the document id of an account.
    java.util.ArrayList<RequiredTrainingPlan> getAllRequests()
    This method gets all requests.
    boolean storeRequest​(RequiredTrainingPlan requiredTrainingPlan)
    this function stores the email of the account into the RequiredTrainingPlan document.
    boolean updateRequest​(java.lang.String email, int status)
    This DAO method changes the status of an account into RequiredTrainingPlan.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RequiredTrainingPlanDAOImpl

      public RequiredTrainingPlanDAOImpl()
  • Method Details

    • storeRequest

      public boolean storeRequest​(RequiredTrainingPlan requiredTrainingPlan) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      this function stores the email of the account into the RequiredTrainingPlan document.
      Specified by:
      storeRequest in interface RequiredTrainingPlanDAO
      Parameters:
      requiredTrainingPlan - Object that describe the requiredTrainingPlan.
      Returns:
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • findAccountByEmail

      public RequiredTrainingPlan findAccountByEmail​(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      this function can check if the email is into the RequiredTrainingPlan document so this user has yet a TrainngPlan request.
      Specified by:
      findAccountByEmail in interface RequiredTrainingPlanDAO
      Parameters:
      email - to find the user into the RequiredTrainingPlan document.
      Returns:
      the RequiredTrainingPlan given its mail.
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • updateRequest

      public boolean updateRequest​(java.lang.String email, int status) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This DAO method changes the status of an account into RequiredTrainingPlan.
      Specified by:
      updateRequest in interface RequiredTrainingPlanDAO
      Parameters:
      email - of the account
      status - updated
      Returns:
      true after the change has taken place
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAccountDocumentIdByEmail

      public java.lang.String getAccountDocumentIdByEmail​(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This DAO method looks for the document id of an account.
      Specified by:
      getAccountDocumentIdByEmail in interface RequiredTrainingPlanDAO
      Parameters:
      email - of the account
      Returns:
      the document Id
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAllRequests

      public java.util.ArrayList<RequiredTrainingPlan> getAllRequests() throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This method gets all requests.
      Specified by:
      getAllRequests in interface RequiredTrainingPlanDAO
      Returns:
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException