Class JDBCUnifiedArchiveRepository

  • All Implemented Interfaces:
    tigase.archive.db.MessageArchiveRepository<tigase.archive.db.JDBCMessageArchiveRepository.Criteria>, tigase.db.Repository
    Direct Known Subclasses:
    JDBCUnifiedArchiveRepositoryWithRecents

    public class JDBCUnifiedArchiveRepository
    extends tigase.archive.db.JDBCMessageArchiveRepository
    Extended JDBCMessageArchivingRepository class to add unique features required for Unified Archive to work
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JDBCUnifiedArchiveRepository.Criteria  
      protected static class  JDBCUnifiedArchiveRepository.Item  
      • Nested classes/interfaces inherited from interface tigase.archive.db.MessageArchiveRepository

        tigase.archive.db.MessageArchiveRepository.Direction
      • Nested classes/interfaces inherited from interface tigase.db.Repository

        tigase.db.Repository.Meta
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String MSGS_ITEM_TYPE  
      protected static java.lang.String MSGS_OFFLINE  
      protected static java.lang.String OFFLINE_STORE_KEY  
      • Fields inherited from class tigase.archive.db.JDBCMessageArchiveRepository

        ADD_MESSAGE, data_repo, JIDS_DOMAIN, JIDS_ID, JIDS_JID, JIDS_TABLE, MSGS_BUDDY_ID, MSGS_BUDDY_RESOURCE, MSGS_HASH, MSGS_ID, MSGS_MSG, MSGS_OWNER_ID, MSGS_TABLE
      • Fields inherited from class tigase.archive.db.AbstractMessageArchiveRepository

        MSG_BODY_PATH, MSG_SUBJECT_PATH
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected tigase.xml.Element addCollectionToResults​(java.util.List<tigase.xml.Element> results, tigase.archive.db.JDBCMessageArchiveRepository.Criteria criteria_, java.lang.String with, java.util.Date start, java.lang.String type)  
      protected int addMessageAdditionalInfo​(java.sql.PreparedStatement stmt, int i, java.util.Map<java.lang.String,​java.lang.Object> additionalData)  
      protected tigase.xml.Element addMessageToResults​(java.util.List<tigase.xml.Element> msgs, tigase.archive.db.JDBCMessageArchiveRepository.Criteria crit, java.util.Date startTimestamp, tigase.archive.db.JDBCMessageArchiveRepository.Item item_, tigase.xml.Element msg)  
      void archiveMessage​(tigase.xmpp.BareJID owner, tigase.xmpp.JID buddy, tigase.archive.db.MessageArchiveRepository.Direction direction, java.util.Date timestamp, tigase.xml.Element msg, java.util.Set<java.lang.String> tags)  
      protected byte[] generateHashOfMessage​(tigase.archive.db.MessageArchiveRepository.Direction direction, tigase.xml.Element msg, java.util.Date ts, java.util.Map<java.lang.String,​java.lang.Object> additionalData)  
      protected java.lang.String[] getCollectionsCombinations()  
      protected java.lang.String[][] getCollectionsWheres()  
      protected tigase.db.DataRepository getDataRepository()  
      protected java.util.List<java.lang.String> getMessageFields​(java.lang.String combination)  
      protected void initPreparedStatements​(java.util.Map<java.lang.String,​java.lang.String> params)  
      void initRepository​(java.lang.String conn_str, java.util.Map<java.lang.String,​java.lang.String> params)  
      protected void initRepositoryDbSchema()  
      tigase.archive.AbstractCriteria newCriteriaInstance()  
      protected JDBCUnifiedArchiveRepository.Item newItemInstance()  
      • Methods inherited from class tigase.archive.db.JDBCMessageArchiveRepository

        archiveMessage, deleteExpiredMessages, destroy, getCollections, getItems, getJidsIds, getTags, removeItems
      • Methods inherited from class tigase.archive.db.AbstractMessageArchiveRepository

        addMessageToResults
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JDBCUnifiedArchiveRepository

        public JDBCUnifiedArchiveRepository()
    • Method Detail

      • initRepository

        public void initRepository​(java.lang.String conn_str,
                                   java.util.Map<java.lang.String,​java.lang.String> params)
                            throws tigase.db.DBInitException
        Specified by:
        initRepository in interface tigase.db.Repository
        Overrides:
        initRepository in class tigase.archive.db.JDBCMessageArchiveRepository
        Throws:
        tigase.db.DBInitException
      • getCollectionsCombinations

        protected java.lang.String[] getCollectionsCombinations()
        Overrides:
        getCollectionsCombinations in class tigase.archive.db.JDBCMessageArchiveRepository
      • getCollectionsWheres

        protected java.lang.String[][] getCollectionsWheres()
        Overrides:
        getCollectionsWheres in class tigase.archive.db.JDBCMessageArchiveRepository
      • initRepositoryDbSchema

        protected void initRepositoryDbSchema()
                                       throws java.sql.SQLException
        Overrides:
        initRepositoryDbSchema in class tigase.archive.db.JDBCMessageArchiveRepository
        Throws:
        java.sql.SQLException
      • initPreparedStatements

        protected void initPreparedStatements​(java.util.Map<java.lang.String,​java.lang.String> params)
                                       throws java.sql.SQLException
        Overrides:
        initPreparedStatements in class tigase.archive.db.JDBCMessageArchiveRepository
        Throws:
        java.sql.SQLException
      • archiveMessage

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

        protected int addMessageAdditionalInfo​(java.sql.PreparedStatement stmt,
                                               int i,
                                               java.util.Map<java.lang.String,​java.lang.Object> additionalData)
                                        throws java.sql.SQLException
        Overrides:
        addMessageAdditionalInfo in class tigase.archive.db.JDBCMessageArchiveRepository
        Throws:
        java.sql.SQLException
      • newCriteriaInstance

        public tigase.archive.AbstractCriteria newCriteriaInstance()
        Specified by:
        newCriteriaInstance in interface tigase.archive.db.MessageArchiveRepository<tigase.archive.db.JDBCMessageArchiveRepository.Criteria>
        Overrides:
        newCriteriaInstance in class tigase.archive.db.JDBCMessageArchiveRepository
      • newItemInstance

        protected JDBCUnifiedArchiveRepository.Item newItemInstance()
        Overrides:
        newItemInstance in class tigase.archive.db.JDBCMessageArchiveRepository
      • getMessageFields

        protected java.util.List<java.lang.String> getMessageFields​(java.lang.String combination)
        Overrides:
        getMessageFields in class tigase.archive.db.JDBCMessageArchiveRepository
      • addCollectionToResults

        protected tigase.xml.Element addCollectionToResults​(java.util.List<tigase.xml.Element> results,
                                                            tigase.archive.db.JDBCMessageArchiveRepository.Criteria criteria_,
                                                            java.lang.String with,
                                                            java.util.Date start,
                                                            java.lang.String type)
        Overrides:
        addCollectionToResults in class tigase.archive.db.AbstractMessageArchiveRepository<tigase.archive.db.JDBCMessageArchiveRepository.Criteria>
      • addMessageToResults

        protected tigase.xml.Element addMessageToResults​(java.util.List<tigase.xml.Element> msgs,
                                                         tigase.archive.db.JDBCMessageArchiveRepository.Criteria crit,
                                                         java.util.Date startTimestamp,
                                                         tigase.archive.db.JDBCMessageArchiveRepository.Item item_,
                                                         tigase.xml.Element msg)
        Overrides:
        addMessageToResults in class tigase.archive.db.JDBCMessageArchiveRepository
      • getDataRepository

        protected tigase.db.DataRepository getDataRepository()
      • generateHashOfMessage

        protected byte[] generateHashOfMessage​(tigase.archive.db.MessageArchiveRepository.Direction direction,
                                               tigase.xml.Element msg,
                                               java.util.Date ts,
                                               java.util.Map<java.lang.String,​java.lang.Object> additionalData)
        Overrides:
        generateHashOfMessage in class tigase.archive.db.AbstractMessageArchiveRepository<tigase.archive.db.JDBCMessageArchiveRepository.Criteria>