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
Modifier and TypeClassDescriptionprotected static class
static class
static class
protected static class
static class
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 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_QUERY
Fields inherited from class tigase.archive.db.AbstractMessageArchiveRepository
MSG_BODY_PATH, MSG_SUBJECT_PATH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addItemFile
(tigase.xmpp.jid.BareJID owner, String stableId, JDBCUnifiedArchiveRepository.FileMetadata fileMetadata) void
addItemJingle
(tigase.xmpp.jid.BareJID owner, String stableId, String sid, String action, String reason, boolean offline, tigase.archive.db.MessageArchiveRepository.Direction direction) void
addItemOffline
(tigase.xmpp.jid.BareJID owner, String stableId, String buddyResource) void
archiveMessage
(tigase.xmpp.jid.BareJID owner, tigase.xmpp.jid.JID buddy, Date timestamp, tigase.xml.Element msg, String stableId, Set<String> tags) protected tigase.db.DataRepository
protected void
initPreparedStatements
(tigase.db.DataRepository data_repo) protected JDBCUnifiedArchiveRepository.Collection
protected JDBCUnifiedArchiveRepository.Item
newQuery()
void
queryCollections
(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 int
protected Integer
protected Integer
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) protected int
queryRecentsCount
(tigase.xmpp.jid.BareJID ownerJid, Date start, Date end, Set<UnifiedArchiveRepository.Type> types, Set<UnifiedArchiveRepository.CallCondition> callConditions) protected int
protected int
setQueryParams
(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, setItemsQueryParams
Methods inherited from class tigase.archive.db.AbstractMessageArchiveRepository
archiveMessage, calculateOffsetAndPosition, calculateOffsetAndPosition, calculateOffsetAndPosition, extractOriginId, findRefStableId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tigase.db.DataSourceAware
setDataSource
Methods inherited from interface tigase.xmpp.mam.MAMRepository
newQuery, queryItems
Methods inherited from interface tigase.archive.db.MessageArchiveRepository
deleteExpiredMessages, destroy, getStableId, getTags, removeItems
Methods 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:
archiveMessage
in interfacetigase.archive.db.MessageArchiveRepository<QueryCriteria,
tigase.db.DataRepository> - Overrides:
archiveMessage
in 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:
newQuery
in interfacetigase.xmpp.mam.MAMRepository<QueryCriteria,
tigase.xmpp.mam.MAMRepository.Item> - Overrides:
newQuery
in 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:
queryCollections
in interfacetigase.archive.db.MessageArchiveRepository<QueryCriteria,
tigase.db.DataRepository> - Overrides:
queryCollections
in 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:
queryRecents
in 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:
queryFiles
in 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:
initPreparedStatements
in classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
- Throws:
SQLException
-
newCollectionInstance
- Overrides:
newCollectionInstance
in classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
newItemInstance
- Overrides:
newItemInstance
in classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
-
setQueryParams
protected int setQueryParams(PreparedStatement stmt, QueryCriteria crit, tigase.archive.FasteningCollation fasteningCollation) throws SQLException - Overrides:
setQueryParams
in classtigase.archive.db.JDBCMessageArchiveRepository<QueryCriteria>
- Throws:
SQLException
-
getDataRepository
protected tigase.db.DataRepository getDataRepository()
-