Package tigase.db

# Interface OfflineMsgRepositoryIfc

All Superinterfaces:
  `Repository`

All Known Subinterfaces:
  `MsgRepositoryIfc<T>`, `OfflineMessages.OfflineMsgRepositoryIfc`

All Known Implementing Classes:
  `JDBCMsgRepository`, `MsgRepository`, `MsgRepository.MsgRepositoryMDBean`, `XMLMsgRepository`

public interface OfflineMsgRepositoryIfc extends Repository
Interface for storing and restoring offline Elements.
Created: May 11, 2010 6:56:14 PM

Author:
  Artur Hefczyc

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface tigase.db.Repository

  `Repository.Meta, Repository.SchemaId`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Element`
  `getMessageExpired(long time, boolean delete)`
  Deprecated.
  `Queue<Element>`
  `loadMessagesToJID(XMPPResourceConnection session, boolean delete)`
  Loads all payloads for the given user's `JID` from repository.
  `boolean`
  `storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo)`
  Saves the massage to the repository

  ### Methods inherited from interface tigase.db.Repository

  `initRepository`

- ## Method Details

  - ### 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

    Queue<Element> loadMessagesToJID(XMPPResourceConnection session, boolean delete) throws UserNotFoundException, TigaseDBException
    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`
      `TigaseDBException`

  - ### storeMessage

    boolean storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo) throws UserNotFoundException, TigaseDBException
    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`
      `TigaseDBException`