tigase.db.xml

## Class XMLMsgRepository

- java.lang.Object
- - tigase.server.amp.db.MsgRepository<String,XMLDataSource>
  - - tigase.db.xml.XMLMsgRepository

- All Implemented Interfaces:
    DataSourceAware<XMLDataSource>, MsgRepositoryIfc<XMLDataSource>, OfflineMsgRepositoryIfc, Repository

      public class XMLMsgRepository
      extends MsgRepository<String,XMLDataSource>

  Created by andrzej on 04.04.2017.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class tigase.server.amp.db.MsgRepository

      `MsgRepository.MSG_TYPES, MsgRepository.MsgDBItem<T>, MsgRepository.MsgRepositoryMDBean, MsgRepository.OfflineMessagesProcessor`

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

      `Repository.Meta, Repository.SchemaId`

  - ### Field Summary

    - ### Fields inherited from class tigase.server.amp.db.MsgRepository

      `earliestOffline, expiredQueue, MAX_QUEUE_SIZE, MSGS_STORE_LIMIT_KEY, OFFLINE_MSGS_KEY, parser`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLMsgRepository()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `deleteMessage(String db_id)`
    `int` | `deleteMessagesToJID(List<String> db_ids, XMPPResourceConnection session)`
    `Map<Enum,Long>` | `getMessagesCount(JID to)`
    `List<Element>` | `getMessagesList(JID to)`
    `protected void` | `loadExpiredQueue(Date expired)`
    `protected void` | `loadExpiredQueue(int max)`
    `Queue<Element>` | `loadMessagesToJID(List<String> db_ids, XMPPResourceConnection session, boolean delete, MsgRepository.OfflineMessagesProcessor proc)`
    `Queue<Element>` | `loadMessagesToJID(XMPPResourceConnection session, boolean delete)` Loads all payloads for the given user's `JID` from repository.
    `void` | `setDataSource(XMLDataSource dataSource)` Method called to provide class with instance of a data source.
    `boolean` | `storeMessage(JID from, JID to, Date expired, Element msg, NonAuthUserRepository userRepo)` Saves the massage to the repository

    - ### Methods inherited from class tigase.server.amp.db.MsgRepository

      `getInstance, getMessageExpired, getMsgsStoreLimit, initRepository, setCondition`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XMLMsgRepository

          public XMLMsgRepository()

  - ### Method Detail

    - #### setDataSource

          public void setDataSource(XMLDataSource dataSource)

      Description copied from interface: `DataSourceAware`
      Method called to provide class with instance of a data source.

    - #### getMessagesCount

          public Map<Enum,Long> getMessagesCount(JID to)
                                          throws UserNotFoundException

      Throws:
        `UserNotFoundException`

    - #### getMessagesList

          public List<Element> getMessagesList(JID to)
                                        throws UserNotFoundException

      Throws:
        `UserNotFoundException`

    - #### loadMessagesToJID

          public Queue<Element> loadMessagesToJID(XMPPResourceConnection session,
                                                  boolean delete)
                                           throws UserNotFoundException

      Description copied from interface: `OfflineMsgRepositoryIfc`
      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

          public boolean storeMessage(JID from,
                                      JID to,
                                      Date expired,
                                      Element msg,
                                      NonAuthUserRepository userRepo)
                               throws UserNotFoundException

      Description copied from interface: `OfflineMsgRepositoryIfc`
      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`

    - #### loadMessagesToJID

          public Queue<Element> loadMessagesToJID(List<String> db_ids,
                                                  XMPPResourceConnection session,
                                                  boolean delete,
                                                  MsgRepository.OfflineMessagesProcessor proc)
                                           throws UserNotFoundException

      Specified by:
        `loadMessagesToJID` in interface `MsgRepositoryIfc<XMLDataSource>`
      Specified by:
        `loadMessagesToJID` in class `MsgRepository<String,XMLDataSource>`
      Throws:
        `UserNotFoundException`

    - #### deleteMessagesToJID

          public int deleteMessagesToJID(List<String> db_ids,
                                         XMPPResourceConnection session)
                                  throws UserNotFoundException

      Specified by:
        `deleteMessagesToJID` in interface `MsgRepositoryIfc<XMLDataSource>`
      Specified by:
        `deleteMessagesToJID` in class `MsgRepository<String,XMLDataSource>`
      Throws:
        `UserNotFoundException`

    - #### loadExpiredQueue

          protected void loadExpiredQueue(int max)

      Specified by:
        `loadExpiredQueue` in class `MsgRepository<String,XMLDataSource>`

    - #### loadExpiredQueue

          protected void loadExpiredQueue(Date expired)

      Specified by:
        `loadExpiredQueue` in class `MsgRepository<String,XMLDataSource>`

    - #### deleteMessage

          protected void deleteMessage(String db_id)

      Specified by:
        `deleteMessage` in class `MsgRepository<String,XMLDataSource>`

Copyright © 2004–2019 "Tigase, Inc.". All rights reserved.