Package tigase.archive.unified.db
Class JDBCUnifiedArchiveRepository
- java.lang.Object
-
- tigase.archive.db.AbstractMessageArchiveRepository<Q,tigase.db.DataRepository,tigase.archive.db.JDBCMessageArchiveRepository.AddMessageAdditionalDataProvider>
-
- tigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
- tigase.archive.unified.db.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classJDBCUnifiedArchiveRepository.Collectionstatic classJDBCUnifiedArchiveRepository.FileItemstatic classJDBCUnifiedArchiveRepository.FileMetadataprotected static classJDBCUnifiedArchiveRepository.Itemstatic classJDBCUnifiedArchiveRepository.RecentItem-
Nested classes/interfaces inherited from class tigase.archive.db.JDBCMessageArchiveRepository
tigase.archive.db.JDBCMessageArchiveRepository.AddMessageAdditionalDataProvider
-
Nested classes/interfaces inherited from interface tigase.xmpp.mam.MAMRepository
tigase.xmpp.mam.MAMRepository.ItemHandler<Q extends tigase.xmpp.mam.Query,I extends tigase.xmpp.mam.MAMRepository.Item>
-
Nested classes/interfaces inherited from interface tigase.archive.db.MessageArchiveRepository
tigase.archive.db.MessageArchiveRepository.CollectionHandler<Q extends tigase.xmpp.mam.Query,C extends tigase.archive.db.MessageArchiveRepository.Collection>, tigase.archive.db.MessageArchiveRepository.Direction
-
Nested classes/interfaces inherited from interface tigase.db.util.RepositoryVersionAware
tigase.db.util.RepositoryVersionAware.SchemaVersion
-
Nested classes/interfaces inherited from interface tigase.archive.unified.db.UnifiedArchiveRepository
UnifiedArchiveRepository.CallCondition, UnifiedArchiveRepository.FileQuery, UnifiedArchiveRepository.ItemType, UnifiedArchiveRepository.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringOFFLINE_STORE_KEY-
Fields inherited from class tigase.archive.db.JDBCMessageArchiveRepository
ADD_MESSAGE_QUERY, ADD_TAG_TO_MESSAGE_QUERY, data_repo, DELETE_EXPIRED_MESSAGES_QUERY, GET_COLLECTIONS_COUNT_QUERY, GET_COLLECTIONS_QUERY, GET_MESSAGE_POSITION_QUERY, GET_MESSAGES_COUNT_QUERY, GET_MESSAGES_QUERY, GET_TAGS_FOR_USER_COUNT_QUERY, GET_TAGS_FOR_USER_QUERY, REMOVE_MESSAGES_QUERY
-
-
Constructor Summary
Constructors Constructor Description JDBCUnifiedArchiveRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemFile(tigase.xmpp.jid.BareJID owner, java.lang.String stableId, JDBCUnifiedArchiveRepository.FileMetadata fileMetadata)voidaddItemJingle(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)voidaddItemOffline(tigase.xmpp.jid.BareJID owner, java.lang.String stableId, java.lang.String buddyResource)voidarchiveMessage(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)protected tigase.db.DataRepositorygetDataRepository()protected voidinitPreparedStatements(tigase.db.DataRepository data_repo)protected JDBCUnifiedArchiveRepository.CollectionnewCollectionInstance()protected JDBCUnifiedArchiveRepository.ItemnewItemInstance()QueryCriterianewQuery()voidqueryCollections(QueryCriteria crit, tigase.archive.db.MessageArchiveRepository.CollectionHandler<QueryCriteria,tigase.archive.db.MessageArchiveRepository.Collection> collectionHandler)java.util.stream.Stream<? extends UnifiedArchiveRepository.FileItem>queryFiles(UnifiedArchiveRepository.FileQuery query, tigase.xmpp.rsm.RSM rsm)protected intqueryFilesCount(UnifiedArchiveRepository.FileQuery query)protected java.lang.IntegerqueryFilesOffset(UnifiedArchiveRepository.FileQuery query, java.lang.String id)protected java.lang.IntegerqueryFilesPosition(UnifiedArchiveRepository.FileQuery query, java.lang.String id)java.util.stream.Stream<? extends UnifiedArchiveRepository.Item>queryRecents(tigase.xmpp.jid.BareJID ownerJid, java.util.Date start, java.util.Date end, java.util.Set<UnifiedArchiveRepository.Type> types, java.util.Set<UnifiedArchiveRepository.CallCondition> callConditions, tigase.xmpp.rsm.RSM rsm)protected intqueryRecentsCount(tigase.xmpp.jid.BareJID ownerJid, java.util.Date start, java.util.Date end, java.util.Set<UnifiedArchiveRepository.Type> types, java.util.Set<UnifiedArchiveRepository.CallCondition> callConditions)protected intsetFileQueryParams(java.sql.PreparedStatement ps, UnifiedArchiveRepository.FileQuery query)protected intsetQueryParams(java.sql.PreparedStatement stmt, QueryCriteria crit, tigase.archive.FasteningCollation fasteningCollation)-
Methods inherited from class tigase.archive.db.JDBCMessageArchiveRepository
archiveMessage, convertToTimestamp, deleteExpiredMessages, getStableId, getTags, queryItems, removeItems, setCountQueryParams, setDataSource, setItemsQueryParams
-
Methods inherited from class tigase.archive.db.AbstractMessageArchiveRepository
archiveMessage, calculateOffsetAndPosition, calculateOffsetAndPosition, extractOriginId, findRefStableId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
OFFLINE_STORE_KEY
protected static final java.lang.String OFFLINE_STORE_KEY
- See Also:
- Constant Field Values
-
-
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:
archiveMessagein interfacetigase.archive.db.MessageArchiveRepository<QueryCriteria,tigase.db.DataRepository>- Overrides:
archiveMessagein classtigase.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:
newQueryin interfacetigase.xmpp.mam.MAMRepository<QueryCriteria,tigase.xmpp.mam.MAMRepository.Item>- Overrides:
newQueryin classtigase.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:
queryCollectionsin interfacetigase.archive.db.MessageArchiveRepository<QueryCriteria,tigase.db.DataRepository>- Overrides:
queryCollectionsin classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>- Throws:
tigase.db.TigaseDBException
-
queryRecents
public java.util.stream.Stream<? extends UnifiedArchiveRepository.Item> queryRecents(tigase.xmpp.jid.BareJID ownerJid, java.util.Date start, java.util.Date end, java.util.Set<UnifiedArchiveRepository.Type> types, java.util.Set<UnifiedArchiveRepository.CallCondition> callConditions, tigase.xmpp.rsm.RSM rsm) throws tigase.db.TigaseDBException
- Specified by:
queryRecentsin interfaceUnifiedArchiveRepository<tigase.db.DataRepository>- Throws:
tigase.db.TigaseDBException
-
queryRecentsCount
protected int queryRecentsCount(tigase.xmpp.jid.BareJID ownerJid, java.util.Date start, java.util.Date end, java.util.Set<UnifiedArchiveRepository.Type> types, java.util.Set<UnifiedArchiveRepository.CallCondition> callConditions) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
queryFiles
public java.util.stream.Stream<? extends UnifiedArchiveRepository.FileItem> queryFiles(UnifiedArchiveRepository.FileQuery query, tigase.xmpp.rsm.RSM rsm) throws tigase.component.exceptions.RepositoryException
- Specified by:
queryFilesin interfaceUnifiedArchiveRepository<tigase.db.DataRepository>- Throws:
tigase.component.exceptions.RepositoryException
-
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:
initPreparedStatementsin classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>- Throws:
java.sql.SQLException
-
newCollectionInstance
protected JDBCUnifiedArchiveRepository.Collection newCollectionInstance()
- Overrides:
newCollectionInstancein classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
newItemInstance
protected JDBCUnifiedArchiveRepository.Item newItemInstance()
- Overrides:
newItemInstancein classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
setQueryParams
protected int setQueryParams(java.sql.PreparedStatement stmt, QueryCriteria crit, tigase.archive.FasteningCollation fasteningCollation) throws java.sql.SQLException- Overrides:
setQueryParamsin classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>- Throws:
java.sql.SQLException
-
getDataRepository
protected tigase.db.DataRepository getDataRepository()
-
-