Interface RequiredTrainingPlanDAO

All Known Implementing Classes:
RequiredTrainingPlanDAOImpl

public interface RequiredTrainingPlanDAO
  • Method Summary

    Modifier and Type Method Description
    RequiredTrainingPlan findAccountByEmail​(java.lang.String email)
    this function can search if the email of the user that try to make a request of TrainingPlan is just registered into the RequiredTrainingPlan Document.
    java.lang.String getAccountDocumentIdByEmail​(java.lang.String email)
    This DAO method looks for the document id of an account stored also in RequiredTrainingPlan.
    java.util.ArrayList<RequiredTrainingPlan> getAllRequests()
    This method gets all requests.
    boolean storeRequest​(RequiredTrainingPlan requiredTrainingPlan)
    this function alerts if the Training Plan's request is successfully stored into the db.
    boolean updateRequest​(java.lang.String email, int status)
    This DAO method changes the status of a TrainingPlanRequest of an account.
  • Method Details

    • storeRequest

      boolean storeRequest​(RequiredTrainingPlan requiredTrainingPlan) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      this function alerts if the Training Plan's request is successfully stored into the db.
      Parameters:
      requiredTrainingPlan - Object RequiredTrainingPlan.
      Returns:
      true if request will correctly store, false instead.
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • findAccountByEmail

      RequiredTrainingPlan findAccountByEmail​(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      this function can search if the email of the user that try to make a request of TrainingPlan is just registered into the RequiredTrainingPlan Document.
      Parameters:
      email - to find the user into the db
      Returns:
      the object if the email exists, and "null" if the email isn't registered
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • updateRequest

      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 a TrainingPlanRequest of an account.
      Parameters:
      email - of the account
      status - updated
      Returns:
      true after the change has taken place false instead.
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAccountDocumentIdByEmail

      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 stored also in RequiredTrainingPlan.
      Parameters:
      email - of the account stored in RequiredTrainingPlan.
      Returns:
      the document Id.
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAllRequests

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