public class JDBCMessageArchiveRepository extends AbstractMessageArchiveRepository<JDBCMessageArchiveRepository.Criteria>
| Modifier and Type | Class and Description |
|---|---|
static class |
JDBCMessageArchiveRepository.Criteria |
static class |
JDBCMessageArchiveRepository.Item<Crit extends JDBCMessageArchiveRepository.Criteria> |
MessageArchiveRepository.Direction| Modifier and Type | Field and Description |
|---|---|
protected String |
ADD_MESSAGE |
protected tigase.db.DataRepository |
data_repo |
static String |
JIDS_DOMAIN |
static String |
JIDS_ID |
static String |
JIDS_JID |
static String |
JIDS_TABLE |
static String |
MSGS_BUDDY_ID |
static String |
MSGS_BUDDY_RESOURCE |
protected static String |
MSGS_HASH |
static String |
MSGS_ID |
static String |
MSGS_MSG |
static String |
MSGS_OWNER_ID |
static String |
MSGS_TABLE |
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) |
protected tigase.xml.Element |
addMessageToResults(List<tigase.xml.Element> msgs,
JDBCMessageArchiveRepository.Criteria crit,
Date startTimestamp,
JDBCMessageArchiveRepository.Item item,
tigase.xml.Element msg) |
void |
archiveMessage(tigase.xmpp.BareJID owner,
tigase.xmpp.JID buddy,
MessageArchiveRepository.Direction direction,
Date timestamp,
tigase.xml.Element msg,
Set<String> tags)
Method description
|
protected void |
archiveMessage(tigase.xmpp.BareJID owner,
tigase.xmpp.JID buddy,
MessageArchiveRepository.Direction direction,
Date timestamp,
tigase.xml.Element msg,
Set<String> tags,
Map<String,Object> additionalData) |
void |
deleteExpiredMessages(tigase.xmpp.BareJID owner,
LocalDateTime before) |
void |
destroy()
Destroys instance of this repository and releases resources allocated if possible
|
List<tigase.xml.Element> |
getCollections(tigase.xmpp.BareJID owner,
JDBCMessageArchiveRepository.Criteria crit)
Method description
|
protected String[] |
getCollectionsCombinations() |
protected String[][] |
getCollectionsWheres() |
List<tigase.xml.Element> |
getItems(tigase.xmpp.BareJID owner,
JDBCMessageArchiveRepository.Criteria crit)
Method description
|
protected long[] |
getJidsIds(String... jids)
Method description
|
protected List<String> |
getMessageFields(String combination) |
List<String> |
getTags(tigase.xmpp.BareJID owner,
String startsWith,
JDBCMessageArchiveRepository.Criteria crit)
Method description
|
protected void |
initPreparedStatements(Map<String,String> params) |
void |
initRepository(String conn_str,
Map<String,String> params)
Method description
|
protected void |
initRepositoryDbSchema() |
AbstractCriteria |
newCriteriaInstance() |
protected JDBCMessageArchiveRepository.Item |
newItemInstance() |
void |
removeItems(tigase.xmpp.BareJID owner,
String withJid,
Date start,
Date end)
Method description
|
addCollectionToResults, addMessageToResults, generateHashOfMessagepublic static final String JIDS_ID
public static final String JIDS_JID
public static final String JIDS_DOMAIN
public static final String JIDS_TABLE
public static final String MSGS_ID
public static final String MSGS_BUDDY_ID
public static final String MSGS_BUDDY_RESOURCE
public static final String MSGS_MSG
public static final String MSGS_OWNER_ID
protected static final String MSGS_HASH
public static final String MSGS_TABLE
protected String ADD_MESSAGE
protected tigase.db.DataRepository data_repo
protected String[] getCollectionsCombinations()
protected String[][] getCollectionsWheres()
public void initRepository(String conn_str, Map<String,String> params) throws tigase.db.DBInitException
conn_str - params - SQLExceptiontigase.db.DBInitExceptionprotected void initRepositoryDbSchema()
throws SQLException
SQLExceptionprotected void initPreparedStatements(Map<String,String> params) throws SQLException
SQLExceptionpublic void destroy()
MessageArchiveRepositorypublic void archiveMessage(tigase.xmpp.BareJID owner,
tigase.xmpp.JID buddy,
MessageArchiveRepository.Direction direction,
Date timestamp,
tigase.xml.Element msg,
Set<String> tags)
owner - buddy - direction - timestamp - msg - tags - protected void archiveMessage(tigase.xmpp.BareJID owner,
tigase.xmpp.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
SQLExceptionpublic void deleteExpiredMessages(tigase.xmpp.BareJID owner,
LocalDateTime before)
throws tigase.db.TigaseDBException
tigase.db.TigaseDBExceptionpublic List<tigase.xml.Element> getCollections(tigase.xmpp.BareJID owner, JDBCMessageArchiveRepository.Criteria crit) throws tigase.db.TigaseDBException
owner - crit - tigase.db.TigaseDBExceptionpublic List<tigase.xml.Element> getItems(tigase.xmpp.BareJID owner, JDBCMessageArchiveRepository.Criteria crit) throws tigase.db.TigaseDBException
owner - crit - tigase.db.TigaseDBExceptionpublic void removeItems(tigase.xmpp.BareJID owner,
String withJid,
Date start,
Date end)
throws tigase.db.TigaseDBException
owner - withJid - start - end - tigase.db.TigaseDBExceptionpublic List<String> getTags(tigase.xmpp.BareJID owner, String startsWith, JDBCMessageArchiveRepository.Criteria crit) throws tigase.db.TigaseDBException
owner - startsWith - crit - tigase.db.TigaseDBExceptionprotected tigase.xml.Element addMessageToResults(List<tigase.xml.Element> msgs, JDBCMessageArchiveRepository.Criteria crit, Date startTimestamp, JDBCMessageArchiveRepository.Item item, tigase.xml.Element msg)
protected JDBCMessageArchiveRepository.Item newItemInstance()
protected long[] getJidsIds(String... jids) throws SQLException
jids - SQLExceptionpublic AbstractCriteria newCriteriaInstance()
Copyright © 2017. All rights reserved.