Class JDBCUnifiedArchiveRepository

  • All Implemented Interfaces:
    tigase.archive.db.MessageArchiveRepository<QueryCriteria,​tigase.db.DataRepository>, UnifiedArchiveRepository<tigase.db.DataRepository>, tigase.db.DataSourceAware<tigase.db.DataRepository>, tigase.db.util.RepositoryVersionAware, tigase.xmpp.mam.MAMRepository<QueryCriteria,​tigase.xmpp.mam.MAMRepository.Item>

    public class JDBCUnifiedArchiveRepository
    extends tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
    implements UnifiedArchiveRepository<tigase.db.DataRepository>, tigase.db.util.RepositoryVersionAware
    Extended JDBCMessageArchivingRepository class to add unique features required for Unified Archive to work
    • Field Detail

      • OFFLINE_STORE_KEY

        protected static final java.lang.String OFFLINE_STORE_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • JDBCUnifiedArchiveRepository

        public JDBCUnifiedArchiveRepository()
    • Method Detail

      • archiveMessage

        public void archiveMessage​(tigase.xmpp.jid.BareJID owner,
                                   tigase.xmpp.jid.JID buddy,
                                   java.util.Date timestamp,
                                   tigase.xml.Element msg,
                                   java.lang.String stableId,
                                   java.util.Set<java.lang.String> tags)
        Specified by:
        archiveMessage in interface tigase.archive.db.MessageArchiveRepository<QueryCriteria,​tigase.db.DataRepository>
        Overrides:
        archiveMessage in class tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
      • addItemFile

        public void addItemFile​(tigase.xmpp.jid.BareJID owner,
                                java.lang.String stableId,
                                JDBCUnifiedArchiveRepository.FileMetadata fileMetadata)
                         throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • addItemJingle

        public void addItemJingle​(tigase.xmpp.jid.BareJID owner,
                                  java.lang.String stableId,
                                  java.lang.String sid,
                                  java.lang.String action,
                                  java.lang.String reason,
                                  boolean offline,
                                  tigase.archive.db.MessageArchiveRepository.Direction direction)
                           throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • addItemOffline

        public void addItemOffline​(tigase.xmpp.jid.BareJID owner,
                                   java.lang.String stableId,
                                   java.lang.String buddyResource)
                            throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • newQuery

        public QueryCriteria newQuery()
        Specified by:
        newQuery in interface tigase.xmpp.mam.MAMRepository<QueryCriteria,​tigase.xmpp.mam.MAMRepository.Item>
        Overrides:
        newQuery in class tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
      • queryCollections

        public void queryCollections​(QueryCriteria crit,
                                     tigase.archive.db.MessageArchiveRepository.CollectionHandler<QueryCriteria,​tigase.archive.db.MessageArchiveRepository.Collection> collectionHandler)
                              throws tigase.db.TigaseDBException
        Specified by:
        queryCollections in interface tigase.archive.db.MessageArchiveRepository<QueryCriteria,​tigase.db.DataRepository>
        Overrides:
        queryCollections in class tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
        Throws:
        tigase.db.TigaseDBException
      • queryFilesCount

        protected int queryFilesCount​(UnifiedArchiveRepository.FileQuery query)
                               throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • queryFilesPosition

        protected java.lang.Integer queryFilesPosition​(UnifiedArchiveRepository.FileQuery query,
                                                       java.lang.String id)
                                                throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • queryFilesOffset

        protected java.lang.Integer queryFilesOffset​(UnifiedArchiveRepository.FileQuery query,
                                                     java.lang.String id)
                                              throws tigase.component.exceptions.RepositoryException
        Throws:
        tigase.component.exceptions.RepositoryException
      • setFileQueryParams

        protected int setFileQueryParams​(java.sql.PreparedStatement ps,
                                         UnifiedArchiveRepository.FileQuery query)
                                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • initPreparedStatements

        protected void initPreparedStatements​(tigase.db.DataRepository data_repo)
                                       throws java.sql.SQLException
        Overrides:
        initPreparedStatements in class tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
        Throws:
        java.sql.SQLException
      • setQueryParams

        protected int setQueryParams​(java.sql.PreparedStatement stmt,
                                     QueryCriteria crit,
                                     tigase.archive.FasteningCollation fasteningCollation)
                              throws java.sql.SQLException
        Overrides:
        setQueryParams in class tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
        Throws:
        java.sql.SQLException
      • getDataRepository

        protected tigase.db.DataRepository getDataRepository()