Interface SubscriptionDAO

All Known Implementing Classes:
SubscriptionDAOImpl

public interface SubscriptionDAO
  • Method Details

    • insertSubscription

      void insertSubscription​(Subscription sub) throws java.io.IOException
      This method interact with database to insert the subscription.
      Parameters:
      sub - the subscription to insert into database
      Throws:
      java.io.IOException
    • getSubscriptionbyEmail

      Subscription getSubscriptionbyEmail​(java.lang.String clientMail) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This method searches in the database for a customer's subscription, given his email.
      Parameters:
      clientMail - customer mail
      Returns:
      the Subscription.
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getAllSubscriptions

      java.util.ArrayList<Subscription> getAllSubscriptions() throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This method retrieves all subscriptions saved in db.
      Returns:
      subscription list
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • getSubscriptionDocumentIdByEmail

      java.lang.String getSubscriptionDocumentIdByEmail​(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This DAO method looks for the document id of subscription.
      Parameters:
      email - of the account
      Returns:
      the document Id
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException
    • updateSentNotification

      boolean updateSentNotification​(java.lang.String email) throws java.io.IOException, java.util.concurrent.ExecutionException, java.lang.InterruptedException
      This DAO method marks that the client received the notification.
      Parameters:
      email - client's subscription mail.
      Returns:
      true after the change has taken place
      Throws:
      java.io.IOException
      java.util.concurrent.ExecutionException
      java.lang.InterruptedException