Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.history
Class InteractiveHistoryReaderImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.history.InteractiveHistoryReaderImpl
All Implemented Interfaces:
InteractiveHistoryReader

public class InteractiveHistoryReaderImpl
extends Object
implements InteractiveHistoryReader

The InteractiveHistoryReaderImpl is an implementation of the InteractiveHistoryReader interface. It allows to search in the history in an interactive way, i.e. be able to cancel the search at any time and track the results through a HistoryQueryListener.

Author:
Yana Stamcheva

Constructor Summary
InteractiveHistoryReaderImpl(HistoryImpl history)
          Creates an instance of InteractiveHistoryReaderImpl by specifying the corresponding history implementation.
 
Method Summary
 HistoryQuery findByKeyword(String keyword, String field, int recordCount)
          Searches the history for all records containing the keyword.
 HistoryQuery findByKeywords(String[] keywords, String field, int recordCount)
          Searches the history for all records containing all keywords.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractiveHistoryReaderImpl

public InteractiveHistoryReaderImpl(HistoryImpl history)
Creates an instance of InteractiveHistoryReaderImpl by specifying the corresponding history implementation.

Parameters:
history - the corresponding HistoryImpl to read from
Method Detail

findByKeyword

public HistoryQuery findByKeyword(String keyword,
                                  String field,
                                  int recordCount)
Searches the history for all records containing the keyword.

Specified by:
findByKeyword in interface InteractiveHistoryReader
Parameters:
keyword - the keyword to search for
field - the field where to look for the keyword
recordCount - limits the result to this record count
Returns:
the found records
Throws:
RuntimeException - Thrown if an exception occurs during the execution of the query, such as internal IO error.

findByKeywords

public HistoryQuery findByKeywords(String[] keywords,
                                   String field,
                                   int recordCount)
Searches the history for all records containing all keywords.

Specified by:
findByKeywords in interface InteractiveHistoryReader
Parameters:
keywords - array of keywords we search for
field - the field where to look for the keyword
recordCount - limits the result to this record count
Returns:
the found records
Throws:
RuntimeException - 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.