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 ClassesModifier and TypeClassDescriptionprotected static classstatic classstatic classprotected static classstatic classNested classes/interfaces inherited from class tigase.archive.db.JDBCMessageArchiveRepository
tigase.archive.db.JDBCMessageArchiveRepository.AddMessageAdditionalDataProviderNested 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.SchemaVersionNested classes/interfaces inherited from interface tigase.archive.unified.db.UnifiedArchiveRepository
UnifiedArchiveRepository.CallCondition, UnifiedArchiveRepository.FileQuery, UnifiedArchiveRepository.ItemType, UnifiedArchiveRepository.Type -
Field Summary
FieldsFields 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_MESSAGE_QUERY, GET_MESSAGES_COUNT_QUERY, GET_MESSAGES_QUERY, GET_TAGS_FOR_USER_COUNT_QUERY, GET_TAGS_FOR_USER_QUERY, REMOVE_MESSAGES_QUERYFields inherited from class tigase.archive.db.AbstractMessageArchiveRepository
MSG_BODY_PATH, MSG_SUBJECT_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItemFile(tigase.xmpp.jid.BareJID owner, String stableId, JDBCUnifiedArchiveRepository.FileMetadata fileMetadata) voidaddItemJingle(tigase.xmpp.jid.BareJID owner, String stableId, String sid, String action, String reason, boolean offline, tigase.archive.db.MessageArchiveRepository.Direction direction) voidaddItemOffline(tigase.xmpp.jid.BareJID owner, String stableId, String buddyResource) voidarchiveMessage(tigase.xmpp.jid.BareJID owner, tigase.xmpp.jid.JID buddy, Date timestamp, tigase.xml.Element msg, String stableId, Set<String> tags) protected tigase.db.DataRepositoryprotected voidinitPreparedStatements(tigase.db.DataRepository data_repo) protected JDBCUnifiedArchiveRepository.Collectionprotected JDBCUnifiedArchiveRepository.ItemnewQuery()voidqueryCollections(QueryCriteria crit, tigase.archive.db.MessageArchiveRepository.CollectionHandler<QueryCriteria, tigase.archive.db.MessageArchiveRepository.Collection> collectionHandler) Stream<? extends UnifiedArchiveRepository.FileItem>queryFiles(UnifiedArchiveRepository.FileQuery query, tigase.xmpp.rsm.RSM rsm) protected intprotected Integerprotected IntegerStream<? extends UnifiedArchiveRepository.Item>queryRecents(tigase.xmpp.jid.BareJID ownerJid, Date start, Date end, Set<UnifiedArchiveRepository.Type> types, Set<UnifiedArchiveRepository.CallCondition> callConditions, tigase.xmpp.rsm.RSM rsm) protected intqueryRecentsCount(tigase.xmpp.jid.BareJID ownerJid, Date start, Date end, Set<UnifiedArchiveRepository.Type> types, Set<UnifiedArchiveRepository.CallCondition> callConditions) protected intprotected intsetQueryParams(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, setItemsQueryParamsMethods inherited from class tigase.archive.db.AbstractMessageArchiveRepository
archiveMessage, calculateOffsetAndPosition, calculateOffsetAndPosition, calculateOffsetAndPosition, extractOriginId, findRefStableIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tigase.db.DataSourceAware
setDataSourceMethods inherited from interface tigase.xmpp.mam.MAMRepository
newQuery, queryItemsMethods inherited from interface tigase.archive.db.MessageArchiveRepository
deleteExpiredMessages, destroy, getStableId, getTags, removeItemsMethods inherited from interface tigase.db.util.RepositoryVersionAware
getVersion, updateSchema
-
Field Details
-
OFFLINE_STORE_KEY
- See Also:
-
-
Constructor Details
-
JDBCUnifiedArchiveRepository
public JDBCUnifiedArchiveRepository()
-
-
Method Details
-
archiveMessage
public void archiveMessage(tigase.xmpp.jid.BareJID owner, tigase.xmpp.jid.JID buddy, Date timestamp, tigase.xml.Element msg, String stableId, Set<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, String stableId, JDBCUnifiedArchiveRepository.FileMetadata fileMetadata) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
addItemJingle
public void addItemJingle(tigase.xmpp.jid.BareJID owner, String stableId, String sid, String action, 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, String stableId, String buddyResource) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
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 Stream<? extends UnifiedArchiveRepository.Item> queryRecents(tigase.xmpp.jid.BareJID ownerJid, Date start, Date end, Set<UnifiedArchiveRepository.Type> types, 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, Date start, Date end, Set<UnifiedArchiveRepository.Type> types, Set<UnifiedArchiveRepository.CallCondition> callConditions) throws SQLException - Throws:
SQLException
-
queryFiles
public 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 Integer queryFilesPosition(UnifiedArchiveRepository.FileQuery query, String id) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
queryFilesOffset
protected Integer queryFilesOffset(UnifiedArchiveRepository.FileQuery query, String id) throws tigase.component.exceptions.RepositoryException - Throws:
tigase.component.exceptions.RepositoryException
-
setFileQueryParams
protected int setFileQueryParams(PreparedStatement ps, UnifiedArchiveRepository.FileQuery query) throws SQLException - Throws:
SQLException
-
initPreparedStatements
- Overrides:
initPreparedStatementsin classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>- Throws:
SQLException
-
newCollectionInstance
- Overrides:
newCollectionInstancein classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
newItemInstance
- Overrides:
newItemInstancein classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
setQueryParams
protected int setQueryParams(PreparedStatement stmt, QueryCriteria crit, tigase.archive.FasteningCollation fasteningCollation) throws SQLException - Overrides:
setQueryParamsin classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>- Throws:
SQLException
-
getDataRepository
protected tigase.db.DataRepository getDataRepository()
-