tigase.server.amp

## Class MsgRepository

- java.lang.Object
- - tigase.server.amp.MsgRepository

- All Implemented Interfaces:
    MsgRepositoryIfc

      public class MsgRepository
      extends Object
      implements MsgRepositoryIfc

  Created: May 3, 2010 5:28:02 PM
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MsgRepository()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MsgRepository` | `getInstance(String id_string)` Method description
    `tigase.xml.Element` | `getMessageExpired(long time, boolean delete)` Method description
    `void` | `initRepository(String conn_str, Map<String,String> map)` Method description
    `Queue<tigase.xml.Element>` | `loadMessagesToJID(tigase.xmpp.JID to, boolean delete)` Method description
    `void` | `storeMessage(tigase.xmpp.JID from, tigase.xmpp.JID to, Date expired, tigase.xml.Element msg)` Method description

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

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

- - ### Constructor Detail

    - #### MsgRepository

          public MsgRepository()

  - ### Method Detail

    - #### getInstance

          public static MsgRepository getInstance(String id_string)

      Method description
      Parameters:
        `id_string` -

    - #### getMessageExpired

          public tigase.xml.Element getMessageExpired(long time,
                                             boolean delete)

      Method description
      Specified by:
        `getMessageExpired` in interface `MsgRepositoryIfc`
      Parameters:
        `time` -
        `delete` -
      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.

    - #### initRepository

          public void initRepository(String conn_str,
                            Map<String,String> map)
                              throws SQLException

      Method description
      Parameters:
        `conn_str` -
        `map` -
      Throws:
        `SQLException`

    - #### loadMessagesToJID

          public Queue<tigase.xml.Element> loadMessagesToJID(tigase.xmpp.JID to,
                                                    boolean delete)
                                                      throws UserNotFoundException

      Method description
      Specified by:
        `loadMessagesToJID` in interface `MsgRepositoryIfc`
      Parameters:
        `to` -
        `delete` -
      Returns:
        a `Queue` of `Element` objects representing stored payloads for the given user's `JID`
      Throws:
        `UserNotFoundException`

    - #### storeMessage

          public void storeMessage(tigase.xmpp.JID from,
                          tigase.xmpp.JID to,
                          Date expired,
                          tigase.xml.Element msg)
                            throws UserNotFoundException

      Method description
      Specified by:
        `storeMessage` in interface `MsgRepositoryIfc`
      Parameters:
        `from` -
        `to` -
        `expired` -
        `msg` -
      Throws:
        `UserNotFoundException`

Copyright © 2014 "Tigase, Inc.". All rights reserved.