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 RequiredTrainingPlanfindAccountByEmail(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.StringgetAccountDocumentIdByEmail(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.booleanstoreRequest(RequiredTrainingPlan requiredTrainingPlan)this function stores the email of the account into the RequiredTrainingPlan document.booleanupdateRequest(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.InterruptedExceptionthis function stores the email of the account into the RequiredTrainingPlan document.- Specified by:
storeRequestin interfaceRequiredTrainingPlanDAO- Parameters:
requiredTrainingPlan- Object that describe the requiredTrainingPlan.- Returns:
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
findAccountByEmail
public RequiredTrainingPlan findAccountByEmail(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionthis function can check if the email is into the RequiredTrainingPlan document so this user has yet a TrainngPlan request.- Specified by:
findAccountByEmailin interfaceRequiredTrainingPlanDAO- Parameters:
email- to find the user into the RequiredTrainingPlan document.- Returns:
- the RequiredTrainingPlan given its mail.
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
updateRequest
public boolean updateRequest(java.lang.String email, int status) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionThis DAO method changes the status of an account into RequiredTrainingPlan.- Specified by:
updateRequestin interfaceRequiredTrainingPlanDAO- Parameters:
email- of the accountstatus- updated- Returns:
- true after the change has taken place
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
getAccountDocumentIdByEmail
public java.lang.String getAccountDocumentIdByEmail(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionThis DAO method looks for the document id of an account.- Specified by:
getAccountDocumentIdByEmailin interfaceRequiredTrainingPlanDAO- Parameters:
email- of the account- Returns:
- the document Id
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
getAllRequests
public java.util.ArrayList<RequiredTrainingPlan> getAllRequests() throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionThis method gets all requests.- Specified by:
getAllRequestsin interfaceRequiredTrainingPlanDAO- Returns:
- Throws:
java.io.IOExceptionjava.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-