public class JDBCMessageArchiveRepository<Q extends QueryCriteria> extends AbstractMessageArchiveRepository<Q,tigase.db.DataRepository> implements tigase.db.util.RepositoryVersionAware
Modifier and Type | Class and Description |
---|---|
static class |
JDBCMessageArchiveRepository.Item<Q extends QueryCriteria> |
tigase.db.util.RepositoryVersionAware.SchemaVersion
MessageArchiveRepository.CollectionHandler<Q extends tigase.xmpp.mam.Query>, MessageArchiveRepository.Direction
Modifier and Type | Field and Description |
---|---|
protected String |
ADD_MESSAGE_QUERY |
protected String |
ADD_TAG_TO_MESSAGE_QUERY |
protected tigase.db.DataRepository |
data_repo |
protected String |
DELETE_EXPIRED_MESSAGES_QUERY |
protected String |
GET_COLLECTIONS_COUNT_QUERY |
protected String |
GET_COLLECTIONS_QUERY |
protected String |
GET_MESSAGE_POSITION_QUERY |
protected String |
GET_MESSAGES_COUNT_QUERY |
protected String |
GET_MESSAGES_QUERY |
protected String |
GET_TAGS_FOR_USER_COUNT_QUERY |
protected String |
GET_TAGS_FOR_USER_QUERY |
protected String |
REMOVE_MESSAGES_QUERY |
MSG_BODY_PATH, MSG_SUBJECT_PATH
Constructor and Description |
---|
JDBCMessageArchiveRepository() |
Modifier and Type | Method and Description |
---|---|
protected int |
addMessageAdditionalInfo(PreparedStatement stmt,
int i,
Map<String,Object> additionalData) |
void |
archiveMessage(tigase.xmpp.jid.BareJID owner,
tigase.xmpp.jid.JID buddy,
MessageArchiveRepository.Direction direction,
Date timestamp,
tigase.xml.Element msg,
Set<String> tags) |
protected Long |
archiveMessage(tigase.xmpp.jid.BareJID owner,
tigase.xmpp.jid.JID buddy,
MessageArchiveRepository.Direction direction,
Date timestamp,
tigase.xml.Element msg,
Set<String> tags,
Map<String,Object> additionalData) |
protected Timestamp |
convertToTimestamp(Date date) |
void |
deleteExpiredMessages(tigase.xmpp.jid.BareJID owner,
LocalDateTime before) |
List<String> |
getTags(tigase.xmpp.jid.BareJID owner,
String startsWith,
Q crit) |
protected void |
initPreparedStatements(tigase.db.DataRepository data_repo) |
protected JDBCMessageArchiveRepository.Item |
newItemInstance() |
Q |
newQuery() |
void |
queryCollections(Q crit,
MessageArchiveRepository.CollectionHandler<Q> collectionHandler) |
void |
queryItems(Q crit,
tigase.xmpp.mam.MAMRepository.ItemHandler<Q,tigase.xmpp.mam.MAMRepository.Item> itemHandler) |
void |
removeItems(tigase.xmpp.jid.BareJID owner,
String withJid,
Date start,
Date end) |
protected int |
setCountQueryParams(PreparedStatement stmt,
String ownerJid,
Q crit,
Boolean groupByType) |
void |
setDataSource(tigase.db.DataRepository data_repo) |
void |
setItemsQueryParams(PreparedStatement stmt,
String ownerJid,
Q crit,
Boolean groupByType) |
protected int |
setQueryParams(PreparedStatement stmt,
Q crit,
Boolean groupByType,
int i) |
calculateOffsetAndPosition, generateHashOfMessage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy
@ConfigField(desc="Query to add message to store", alias="add-message-query") protected String ADD_MESSAGE_QUERY
@ConfigField(desc="Query to add tag to message in store", alias="add-tag-to-message-query") protected String ADD_TAG_TO_MESSAGE_QUERY
@ConfigField(desc="Query to delete expired messages", alias="delete-expired-messages-query") protected String DELETE_EXPIRED_MESSAGES_QUERY
@ConfigField(desc="Query to retrieve number of collections", alias="get-collections-count-query") protected String GET_COLLECTIONS_COUNT_QUERY
@ConfigField(desc="Query to retrieve list of collections", alias="get-collections-query") protected String GET_COLLECTIONS_QUERY
@ConfigField(desc="Query to retrieve number of messages", alias="get-messages-count-query") protected String GET_MESSAGES_COUNT_QUERY
@ConfigField(desc="Query to retrieve list of messages", alias="get-messages-query") protected String GET_MESSAGES_QUERY
@ConfigField(desc="Query to retrieve message possition", alias="get-message-position-query") protected String GET_MESSAGE_POSITION_QUERY
@ConfigField(desc="Query to retrieve number of tags used by user", alias="get-tags-for-user-count-query") protected String GET_TAGS_FOR_USER_COUNT_QUERY
@ConfigField(desc="Query to retrieve tags used by user", alias="get-tags-for-user-query") protected String GET_TAGS_FOR_USER_QUERY
@ConfigField(desc="Query to remove messages", alias="remove-messages-query") protected String REMOVE_MESSAGES_QUERY
protected tigase.db.DataRepository data_repo
public void setDataSource(tigase.db.DataRepository data_repo)
setDataSource
in interface tigase.db.DataSourceAware<tigase.db.DataRepository>
public void archiveMessage(tigase.xmpp.jid.BareJID owner, tigase.xmpp.jid.JID buddy, MessageArchiveRepository.Direction direction, Date timestamp, tigase.xml.Element msg, Set<String> tags)
archiveMessage
in interface MessageArchiveRepository<Q extends QueryCriteria,tigase.db.DataRepository>
public void deleteExpiredMessages(tigase.xmpp.jid.BareJID owner, LocalDateTime before) throws tigase.db.TigaseDBException
deleteExpiredMessages
in interface MessageArchiveRepository<Q extends QueryCriteria,tigase.db.DataRepository>
tigase.db.TigaseDBException
public void queryCollections(Q crit, MessageArchiveRepository.CollectionHandler<Q> collectionHandler) throws tigase.db.TigaseDBException
queryCollections
in interface MessageArchiveRepository<Q extends QueryCriteria,tigase.db.DataRepository>
tigase.db.TigaseDBException
public void queryItems(Q crit, tigase.xmpp.mam.MAMRepository.ItemHandler<Q,tigase.xmpp.mam.MAMRepository.Item> itemHandler) throws tigase.db.TigaseDBException, tigase.component.exceptions.ComponentException
queryItems
in interface tigase.xmpp.mam.MAMRepository<Q extends QueryCriteria,tigase.xmpp.mam.MAMRepository.Item>
tigase.db.TigaseDBException
tigase.component.exceptions.ComponentException
public void removeItems(tigase.xmpp.jid.BareJID owner, String withJid, Date start, Date end) throws tigase.db.TigaseDBException
removeItems
in interface MessageArchiveRepository<Q extends QueryCriteria,tigase.db.DataRepository>
tigase.db.TigaseDBException
public List<String> getTags(tigase.xmpp.jid.BareJID owner, String startsWith, Q crit) throws tigase.db.TigaseDBException
getTags
in interface MessageArchiveRepository<Q extends QueryCriteria,tigase.db.DataRepository>
tigase.db.TigaseDBException
public void setItemsQueryParams(PreparedStatement stmt, String ownerJid, Q crit, Boolean groupByType) throws SQLException
SQLException
public Q newQuery()
newQuery
in interface tigase.xmpp.mam.MAMRepository<Q extends QueryCriteria,tigase.xmpp.mam.MAMRepository.Item>
protected void initPreparedStatements(tigase.db.DataRepository data_repo) throws SQLException
SQLException
protected Long archiveMessage(tigase.xmpp.jid.BareJID owner, tigase.xmpp.jid.JID buddy, MessageArchiveRepository.Direction direction, Date timestamp, tigase.xml.Element msg, Set<String> tags, Map<String,Object> additionalData)
protected int addMessageAdditionalInfo(PreparedStatement stmt, int i, Map<String,Object> additionalData) throws SQLException
SQLException
protected int setCountQueryParams(PreparedStatement stmt, String ownerJid, Q crit, Boolean groupByType) throws SQLException
SQLException
protected int setQueryParams(PreparedStatement stmt, Q crit, Boolean groupByType, int i) throws SQLException
SQLException
protected JDBCMessageArchiveRepository.Item newItemInstance()
Copyright © 2012–2019 "Tigase, Inc.". All rights reserved.