Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.history
Interface HistoryReader

All Known Implementing Classes:
HistoryReaderImpl

public interface HistoryReader

Used to serach over the history records

Author:
Alexander Pelov, Damian Minkov

Method Summary
 void addSearchProgressListener(HistorySearchProgressListener listener)
          Adding progress listener for monitoring progress of search process
 int countRecords()
          Total count of records that current history reader will read through
 QueryResultSet<HistoryRecord> findByEndDate(Date endDate)
          Searches the history for all records with timestamp before endDate.
 QueryResultSet<HistoryRecord> findByKeyword(String keyword, String field)
          Searches the history for all records containing the keyword.
 QueryResultSet<HistoryRecord> findByKeyword(String keyword, String field, boolean caseSensitive)
          Searches the history for all records containing the keyword.
 QueryResultSet<HistoryRecord> findByKeywords(String[] keywords, String field)
          Searches the history for all records containing all keywords.
 QueryResultSet<HistoryRecord> findByKeywords(String[] keywords, String field, boolean caseSensitive)
          Searches the history for all records containing all keywords.
 QueryResultSet<HistoryRecord> findByPeriod(Date startDate, Date endDate)
          Searches the history for all records with timestamp between startDate and endDate.
 QueryResultSet<HistoryRecord> findByPeriod(Date startDate, Date endDate, String[] keywords, String field)
          Searches for all history records containing all keywords, with timestamp between startDate and endDate.
 QueryResultSet<HistoryRecord> findByPeriod(Date startDate, Date endDate, String[] keywords, String field, boolean caseSensitive)
          Searches for all history records containing all keywords, with timestamp between startDate and endDate.
 QueryResultSet<HistoryRecord> findByStartDate(Date startDate)
          Searches the history for all records with timestamp after startDate.
 QueryResultSet<HistoryRecord> findFirstRecordsAfter(Date date, int count)
          Returns the supplied number of recent messages after the given date
 QueryResultSet<HistoryRecord> findLast(int count)
          Returns the supplied number of recent messages
 QueryResultSet<HistoryRecord> findLastRecordsBefore(Date date, int count)
          Returns the supplied number of recent messages before the given date
 void removeSearchProgressListener(HistorySearchProgressListener listener)
          Removing progress listener
 

Method Detail

findByStartDate

QueryResultSet<HistoryRecord> findByStartDate(Date startDate)
                                              throws RuntimeException
Searches the history for all records with timestamp after startDate.

Parameters:
startDate - the date after all records will be returned
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByEndDate

QueryResultSet<HistoryRecord> findByEndDate(Date endDate)
                                            throws RuntimeException
Searches the history for all records with timestamp before endDate.

Parameters:
endDate - the date before which all records will be returned
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByPeriod

QueryResultSet<HistoryRecord> findByPeriod(Date startDate,
                                           Date endDate)
                                           throws RuntimeException
Searches the history for all records with timestamp between startDate and endDate.

Parameters:
startDate - start of the interval in which we search
endDate - end of the interval in which we search
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByKeyword

QueryResultSet<HistoryRecord> findByKeyword(String keyword,
                                            String field)
                                            throws RuntimeException
Searches the history for all records containing the keyword.

Parameters:
keyword - the keyword to search for
field - the field where to look for the keyword
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByKeyword

QueryResultSet<HistoryRecord> findByKeyword(String keyword,
                                            String field,
                                            boolean caseSensitive)
                                            throws RuntimeException
Searches the history for all records containing the keyword.

Parameters:
keyword - the keyword to search for
field - the field where to look for the keyword
caseSensitive - is keywords search case sensitive
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByKeywords

QueryResultSet<HistoryRecord> findByKeywords(String[] keywords,
                                             String field)
                                             throws RuntimeException
Searches the history for all records containing all keywords.

Parameters:
keywords - array of keywords we search for
field - the field where to look for the keyword
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByKeywords

QueryResultSet<HistoryRecord> findByKeywords(String[] keywords,
                                             String field,
                                             boolean caseSensitive)
                                             throws RuntimeException
Searches the history for all records containing all keywords.

Parameters:
keywords - array of keywords we search for
field - the field where to look for the keyword
caseSensitive - is keywords search case sensitive
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByPeriod

QueryResultSet<HistoryRecord> findByPeriod(Date startDate,
                                           Date endDate,
                                           String[] keywords,
                                           String field)
                                           throws UnsupportedOperationException
Searches for all history records containing all keywords, with timestamp between startDate and endDate.

Parameters:
startDate - start of the interval in which we search
endDate - end of the interval in which we search
keywords - array of keywords we search for
field - the field where to look for the keyword
Returns:
the found records
Throws:
UnsupportedOperationException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByPeriod

QueryResultSet<HistoryRecord> findByPeriod(Date startDate,
                                           Date endDate,
                                           String[] keywords,
                                           String field,
                                           boolean caseSensitive)
                                           throws UnsupportedOperationException
Searches for all history records containing all keywords, with timestamp between startDate and endDate.

Parameters:
startDate - start of the interval in which we search
endDate - end of the interval in which we search
keywords - array of keywords we search for
field - the field where to look for the keyword
caseSensitive - is keywords search case sensitive
Returns:
the found records
Throws:
UnsupportedOperationException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findLast

QueryResultSet<HistoryRecord> findLast(int count)
                                       throws RuntimeException
Returns the supplied number of recent messages

Parameters:
count - messages count
Returns:
the found records
Throws:
RuntimeException

findFirstRecordsAfter

QueryResultSet<HistoryRecord> findFirstRecordsAfter(Date date,
                                                    int count)
                                                    throws RuntimeException
Returns the supplied number of recent messages after the given date

Parameters:
date - messages after date
count - messages count
Returns:
QueryResultSet the found records
Throws:
RuntimeException

findLastRecordsBefore

QueryResultSet<HistoryRecord> findLastRecordsBefore(Date date,
                                                    int count)
                                                    throws RuntimeException
Returns the supplied number of recent messages before the given date

Parameters:
date - messages before date
count - messages count
Returns:
QueryResultSet the found records
Throws:
RuntimeException

addSearchProgressListener

void addSearchProgressListener(HistorySearchProgressListener listener)
Adding progress listener for monitoring progress of search process

Parameters:
listener - HistorySearchProgressListener

removeSearchProgressListener

void removeSearchProgressListener(HistorySearchProgressListener listener)
Removing progress listener

Parameters:
listener - HistorySearchProgressListener

countRecords

int countRecords()
                 throws UnsupportedOperationException
Total count of records that current history reader will read through

Returns:
the number of searched messages
Throws:
UnsupportedOperationException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.