public class HistoryReaderImpl extends java.lang.Object implements HistoryReader
Modifier | Constructor and Description |
---|---|
protected |
HistoryReaderImpl(HistoryImpl historyImpl)
Creates an instance of HistoryReaderImpl.
|
Modifier and Type | Method and Description |
---|---|
void |
addSearchProgressListener(HistorySearchProgressListener listener)
Adding progress listener for monitoring progress of search process
|
int |
countRecords()
Count the number of messages that a search will return
Actually only the last file is parsed and its nodes are counted.
|
(package private) static HistoryRecord |
filterByKeyword(org.w3c.dom.NodeList propertyNodes,
java.util.Date timestamp,
java.lang.String[] keywords,
java.lang.String field,
boolean caseSensitive)
If there is keyword restriction and doesn't match the conditions
return null.
|
(package private) static java.util.Vector<java.lang.String> |
filterFilesByDate(java.util.Iterator<java.lang.String> filelist,
java.util.Date startDate,
java.util.Date endDate)
Used to limit the files if any starting or ending date exist
So only few files to be searched.
|
(package private) static java.util.Vector<java.lang.String> |
filterFilesByDate(java.util.Iterator<java.lang.String> filelist,
java.util.Date startDate,
java.util.Date endDate,
boolean reverseOrder)
Used to limit the files if any starting or ending date exist
So only few files to be searched.
|
QueryResultSet<HistoryRecord> |
findByEndDate(java.util.Date endDate)
Searches the history for all records with timestamp before
endDate.
|
QueryResultSet<HistoryRecord> |
findByKeyword(java.lang.String keyword,
java.lang.String field)
Searches the history for all records containing the keyword.
|
QueryResultSet<HistoryRecord> |
findByKeyword(java.lang.String keyword,
java.lang.String field,
boolean caseSensitive)
Searches the history for all records containing the keyword.
|
QueryResultSet<HistoryRecord> |
findByKeywords(java.lang.String[] keywords,
java.lang.String field)
Searches the history for all records containing all keywords.
|
QueryResultSet<HistoryRecord> |
findByKeywords(java.lang.String[] keywords,
java.lang.String field,
boolean caseSensitive)
Searches the history for all records containing all keywords.
|
QueryResultSet<HistoryRecord> |
findByPeriod(java.util.Date startDate,
java.util.Date endDate)
Searches the history for all records with timestamp between
startDate and endDate.
|
QueryResultSet<HistoryRecord> |
findByPeriod(java.util.Date startDate,
java.util.Date endDate,
java.lang.String[] keywords,
java.lang.String field)
Searches for all history records containing all keywords,
with timestamp between startDate and endDate.
|
QueryResultSet<HistoryRecord> |
findByPeriod(java.util.Date startDate,
java.util.Date endDate,
java.lang.String[] keywords,
java.lang.String field,
boolean caseSensitive)
Searches for all history records containing all keywords,
with timestamp between startDate and endDate.
|
QueryResultSet<HistoryRecord> |
findByStartDate(java.util.Date startDate)
Searches the history for all records with timestamp after
startDate.
|
QueryResultSet<HistoryRecord> |
findFirstRecordsAfter(java.util.Date date,
int count)
Returns the supplied number of recent messages after the given date
|
QueryResultSet<HistoryRecord> |
findLast(int count)
Returns the last count messages.
|
QueryResultSet<HistoryRecord> |
findLast(int count,
java.lang.String[] keywords,
java.lang.String field,
boolean caseSensitive)
Returns the supplied number of recent messages
containing all keywords.
|
QueryResultSet<HistoryRecord> |
findLastRecordsBefore(java.util.Date date,
int count)
Returns the supplied number of recent messages before the given date
|
(package private) static boolean |
isInPeriod(java.util.Date timestamp,
java.util.Date startDate,
java.util.Date endDate)
Evaluetes does timestamp is in the given time period.
|
(package private) static boolean |
matchKeyword(java.lang.String value,
java.lang.String[] keywords,
boolean caseSensitive)
Check if a value is in the given keyword(s)
If no keyword(s) given must return true
|
void |
removeSearchProgressListener(HistorySearchProgressListener listener)
Removing progress listener
|
protected HistoryReaderImpl(HistoryImpl historyImpl)
historyImpl
- the parent History implementationpublic QueryResultSet<HistoryRecord> findByStartDate(java.util.Date startDate) throws java.lang.RuntimeException
findByStartDate
in interface HistoryReader
startDate
- the date after all records will be returnedjava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByEndDate(java.util.Date endDate) throws java.lang.RuntimeException
findByEndDate
in interface HistoryReader
endDate
- the date before which all records will be returnedjava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByPeriod(java.util.Date startDate, java.util.Date endDate) throws java.lang.RuntimeException
findByPeriod
in interface HistoryReader
startDate
- start of the interval in which we searchendDate
- end of the interval in which we searchjava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByKeyword(java.lang.String keyword, java.lang.String field) throws java.lang.RuntimeException
findByKeyword
in interface HistoryReader
keyword
- the keyword to search forfield
- the field where to look for the keywordjava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByKeywords(java.lang.String[] keywords, java.lang.String field) throws java.lang.RuntimeException
findByKeywords
in interface HistoryReader
keywords
- array of keywords we search forfield
- the field where to look for the keywordjava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByPeriod(java.util.Date startDate, java.util.Date endDate, java.lang.String[] keywords, java.lang.String field) throws java.lang.UnsupportedOperationException
findByPeriod
in interface HistoryReader
startDate
- start of the interval in which we searchendDate
- end of the interval in which we searchkeywords
- array of keywords we search forfield
- the field where to look for the keywordjava.lang.UnsupportedOperationException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findLast(int count) throws java.lang.RuntimeException
findLast
in interface HistoryReader
count
- intjava.lang.RuntimeException
public QueryResultSet<HistoryRecord> findLast(int count, java.lang.String[] keywords, java.lang.String field, boolean caseSensitive) throws java.lang.RuntimeException
findLast
in interface HistoryReader
count
- messages countkeywords
- array of keywords we search forfield
- the field where to look for the keywordcaseSensitive
- is keywords search case sensitivejava.lang.RuntimeException
public QueryResultSet<HistoryRecord> findByKeyword(java.lang.String keyword, java.lang.String field, boolean caseSensitive) throws java.lang.RuntimeException
findByKeyword
in interface HistoryReader
keyword
- the keyword to search forfield
- the field where to look for the keywordcaseSensitive
- is keywords search case sensitivejava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByKeywords(java.lang.String[] keywords, java.lang.String field, boolean caseSensitive) throws java.lang.RuntimeException
findByKeywords
in interface HistoryReader
keywords
- array of keywords we search forfield
- the field where to look for the keywordcaseSensitive
- is keywords search case sensitivejava.lang.RuntimeException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findByPeriod(java.util.Date startDate, java.util.Date endDate, java.lang.String[] keywords, java.lang.String field, boolean caseSensitive) throws java.lang.UnsupportedOperationException
findByPeriod
in interface HistoryReader
startDate
- start of the interval in which we searchendDate
- end of the interval in which we searchkeywords
- array of keywords we search forfield
- the field where to look for the keywordcaseSensitive
- is keywords search case sensitivejava.lang.UnsupportedOperationException
- Thrown if an exception occurs during the execution of the
query, such as internal IO error.public QueryResultSet<HistoryRecord> findFirstRecordsAfter(java.util.Date date, int count) throws java.lang.RuntimeException
findFirstRecordsAfter
in interface HistoryReader
date
- messages after datecount
- messages countjava.lang.RuntimeException
public QueryResultSet<HistoryRecord> findLastRecordsBefore(java.util.Date date, int count) throws java.lang.RuntimeException
findLastRecordsBefore
in interface HistoryReader
date
- messages before datecount
- messages countjava.lang.RuntimeException
static boolean isInPeriod(java.util.Date timestamp, java.util.Date startDate, java.util.Date endDate)
timestamp
- DatestartDate
- Date the start of the periodendDate
- Date the end of the periodstatic HistoryRecord filterByKeyword(org.w3c.dom.NodeList propertyNodes, java.util.Date timestamp, java.lang.String[] keywords, java.lang.String field, boolean caseSensitive)
propertyNodes
- NodeListtimestamp
- Datekeywords
- String[]field
- StringcaseSensitive
- booleanstatic boolean matchKeyword(java.lang.String value, java.lang.String[] keywords, boolean caseSensitive)
value
- Stringkeywords
- String[]caseSensitive
- booleanstatic java.util.Vector<java.lang.String> filterFilesByDate(java.util.Iterator<java.lang.String> filelist, java.util.Date startDate, java.util.Date endDate)
filelist
- IteratorstartDate
- DateendDate
- Datestatic java.util.Vector<java.lang.String> filterFilesByDate(java.util.Iterator<java.lang.String> filelist, java.util.Date startDate, java.util.Date endDate, boolean reverseOrder)
filelist
- IteratorstartDate
- DateendDate
- DatereverseOrder
- reverse order of filespublic void addSearchProgressListener(HistorySearchProgressListener listener)
addSearchProgressListener
in interface HistoryReader
listener
- HistorySearchProgressListenerpublic void removeSearchProgressListener(HistorySearchProgressListener listener)
removeSearchProgressListener
in interface HistoryReader
listener
- HistorySearchProgressListenerpublic int countRecords() throws java.lang.UnsupportedOperationException
countRecords
in interface HistoryReader
java.lang.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.
Distributable under Apache license.