Package tigase.db

Interface OfflineMsgRepositoryIfc

    • Method Detail

      • getMessageExpired

        @Deprecated
        Element getMessageExpired​(long time,
                                  boolean delete)
        Deprecated.
        Loads head of the payloads queue which holds items that would be expired after stated time with an option to delete them from repository after being retrieved. This is blocking method, which means if there is not data to return, implementation should block the call until data is available.
        Parameters:
        time - time in milliseconds representing time after which given message would be considered as expired
        delete - boolean parameter controlling whether messages should be removed from repository after they retrieved.
        Returns:
        head of the payloads queue which holds items that would be expired after stated time with an option to delete them from repository after being retrieved.
      • loadMessagesToJID

        java.util.Queue<Element> loadMessagesToJID​(XMPPResourceConnection session,
                                                   boolean delete)
                                            throws UserNotFoundException
        Loads all payloads for the given user's JID from repository.
        Parameters:
        session - user session which keeps all the user session data and also gives an access to the user's repository data.
        delete - boolean parameter controlling whether messages should be removed from repository after they retrieved.
        Returns:
        a Queue of Element objects representing stored payloads for the given user's JID
        Throws:
        UserNotFoundException
      • storeMessage

        boolean storeMessage​(JID from,
                             JID to,
                             java.util.Date expired,
                             Element msg,
                             NonAuthUserRepository userRepo)
                      throws UserNotFoundException
        Saves the massage to the repository
        Parameters:
        from - JID denotes address of the sender
        to - JID denotes address of the receiver
        expired - Date object denoting expiration date of the message
        msg - Element payload of the stanza to be saved
        userRepo - NonAuthUserRepository instance of non auth user repository to get user settings for offline messages
        Returns:
        true if the packet was correctly saved to repository, false otherwise.
        Throws:
        UserNotFoundException