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 Summary
Constructors Constructor Description RequiredTrainingPlanServiceImpl()RequiredTrainingPlanServiceImpl(RequiredTrainingPlanDAO requiredTrainingPlanDao)Service constructor. -
Method Summary
Modifier and Type Method Description booleanchangeRequest(java.lang.String email, int status)This service method changes the status of an account.RequiredTrainingPlangetAccountByEmail(java.lang.String email)This method returns the account given its mail.java.util.ArrayList<RequiredTrainingPlan>getAllRequestes()this method gets all requests.booleanregisterRequest(RequiredTrainingPlan requiredTrainingPlan)this function registers the account into RequiredTrainingPlan.booleansearchAccountByEmail(java.lang.String email)This service method checks if an account exists in the RequiredTrainingPlan.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RequiredTrainingPlanServiceImpl
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.IOExceptionThis service method checks if an account exists in the RequiredTrainingPlan.- Specified by:
searchAccountByEmailin interfaceRequiredTrainingPlanService- Parameters:
email- referring to the account to search for- Returns:
- true if the account exists, false if not
- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.io.IOException
-
getAccountByEmail
public RequiredTrainingPlan getAccountByEmail(java.lang.String email) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOExceptionThis method returns the account given its mail.- Specified by:
getAccountByEmailin interfaceRequiredTrainingPlanService- Parameters:
email- referring to the account to search for- Returns:
- the RequiredTrainingPlan if it exists, null if not
- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.io.IOException
-
changeRequest
public boolean changeRequest(java.lang.String email, int status) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionThis service method changes the status of an account.- Specified by:
changeRequestin interfaceRequiredTrainingPlanService- Parameters:
email- of the accountstatus- updated- Returns:
- true after the change has taken place
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
registerRequest
public boolean registerRequest(RequiredTrainingPlan requiredTrainingPlan) throws java.io.IOException, java.lang.IllegalArgumentException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionthis function registers the account into RequiredTrainingPlan.- Specified by:
registerRequestin interfaceRequiredTrainingPlanService- Parameters:
requiredTrainingPlan- user into the RequiredTrainingPlan.- Returns:
- utente user mem into the RequiredTrainingPlan.
- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
getAllRequestes
public java.util.ArrayList<RequiredTrainingPlan> getAllRequestes() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.io.IOExceptionthis method gets all requests.- Specified by:
getAllRequestesin interfaceRequiredTrainingPlanService- Returns:
- AllRequests
- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.io.IOException
-