Class RequiredTrainingPlanServiceImpl

java.lang.Object
it.unisa.c03.myPersonalTrainer.requiredtrainingplan.service.RequiredTrainingPlanServiceImpl
All Implemented Interfaces:
RequiredTrainingPlanService

public class RequiredTrainingPlanServiceImpl
extends java.lang.Object
implements RequiredTrainingPlanService
  • Constructor Details

    • RequiredTrainingPlanServiceImpl

      public RequiredTrainingPlanServiceImpl​(RequiredTrainingPlanDAO requiredTrainingPlanDao)
      Service constructor.
      Parameters:
      requiredTrainingPlanDao - is required, because is the DAO that all the service methods will call.
    • RequiredTrainingPlanServiceImpl

      public RequiredTrainingPlanServiceImpl()
  • Method Details

    • searchAccountByEmail

      public boolean searchAccountByEmail​(java.lang.String email) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException
      This service method checks if an account exists in the RequiredTrainingPlan.
      Specified by:
      searchAccountByEmail in interface RequiredTrainingPlanService
      Parameters:
      email - referring to the account to search for
      Returns:
      true if the account exists, false if not
      Throws:
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
      java.io.IOException
    • getAccountByEmail

      public RequiredTrainingPlan getAccountByEmail​(java.lang.String email) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOException
      This method returns the account given its mail.
      Specified by:
      getAccountByEmail in interface RequiredTrainingPlanService
      Parameters:
      email - referring to the account to search for
      Returns:
      the RequiredTrainingPlan if it exists, null if not
      Throws:
      java.lang.InterruptedException
      java.util.concurrent.ExecutionException
      java.io.IOException
    • changeRequest

      public boolean changeRequest​(java.lang.String email, int status) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This service method changes the status of an account.
      Specified by:
      changeRequest in interface RequiredTrainingPlanService
      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
    • registerRequest

      public boolean registerRequest​(RequiredTrainingPlan requiredTrainingPlan) throws java.io.IOException, java.lang.IllegalArgumentException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      this function registers the account into RequiredTrainingPlan.
      Specified by:
      registerRequest in interface RequiredTrainingPlanService
      Parameters:
      requiredTrainingPlan - user into the RequiredTrainingPlan.
      Returns:
      utente user mem into the RequiredTrainingPlan.
      Throws:
      java.io.IOException
      java.lang.IllegalArgumentException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAllRequestes

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