Class SubscriberDAO

    • Field Detail

      • ROLE

        public static final String ROLE
        The Avalon role
    • Method Detail

      • getPhoneNumbersFromList

        public Map<String,​DategetPhoneNumbersFromList​(String list)
        Get all the phone numbers in the database form the list
        Parameters:
        list - the id of the phone number list
        Returns:
        A map, where keys are phone number and value are date object.
      • insertNumber

        public void insertNumber​(String phoneNumber,
                                 String list)
        Insert the phoneNumber in the database
        Parameters:
        phoneNumber - the phone number
        list - the id of the phone number list
      • numberAlreadyExists

        public boolean numberAlreadyExists​(String phoneNumber,
                                           String list)
        Check if the phoneNumber exists in the database
        Parameters:
        phoneNumber - the phone number
        list - the id of the list
        Returns:
        true if exist
      • createSubscriber

        public Map<String,​StringcreateSubscriber​(String listId,
                                                         String phoneNumber)
        Creates a SMS subscriber.
        Parameters:
        listId - The id of the SMS list to subscribe to.
        phoneNumber - The phone number to add
        Returns:
        The list id and the phone number of the added subscriber, or an error
      • deleteNumber

        public void deleteNumber​(String phoneNumber,
                                 String list)
        Delete the phoneNumber in the database
        Parameters:
        phoneNumber - the phone number
        list - the id of the phone number list
      • deleteAllNumbers

        public void deleteAllNumbers​(String list)
        Delete every phone number of a list
        Parameters:
        list - the id of the phone number list
      • deleteSubscribers

        public Map<String,​ObjectdeleteSubscribers​(String listId,
                                                          ArrayList<String> phoneNumbers)
        Deletes the given subscribers.
        Parameters:
        listId - The The id of the SMS list.
        phoneNumbers - The phone numbers to delete
        Returns:
        The list id, the numbers deleted, the numbers not deleted and/or an error.