Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.impl.history.HistoryImpl
All Implemented Interfaces:
History

public class HistoryImpl
extends Object
implements History

Author:
Alexander Pelov, Yana Stamcheva

Field Summary
static String SUPPORTED_FILETYPE
          The supported filetype.
 
Constructor Summary
protected HistoryImpl(HistoryID id, File directory, HistoryRecordStructure historyRecordStructure, HistoryServiceImpl historyServiceImpl)
          Creates an instance of HistoryImpl by specifying the history identifier, the directory, the HistoryRecordStructure to use and the parent HistoryServiceImpl.
 
Method Summary
protected  Document createDocument(String filename)
           
protected  Document getDocumentForFile(String filename)
           
protected  Iterator<String> getFileList()
           
 Document getFixedDocument(File file)
          Returns the fixed document as xml Document if file cannot be fixed return null
 HistoryRecordStructure getHistoryRecordsStructure()
          Returns the current HistoryRecordStructure.
protected  HistoryServiceImpl getHistoryServiceImpl()
           
 HistoryID getID()
          Returns the identifier of this history.
 InteractiveHistoryReader getInteractiveReader()
          Returns an object that can be used to read and query this history.
 HistoryReader getReader()
          Returns an object which can be used to read and query this history.
 HistoryWriter getWriter()
          Returns an object which can be used to append records to this history.
 void setHistoryRecordsStructure(HistoryRecordStructure structure)
          Sets the given structure to be the new history records structure used in this history implementation.
protected  void writeFile(String filename)
           
protected  void writeFile(String filename, Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED_FILETYPE

public static final String SUPPORTED_FILETYPE
The supported filetype.

See Also:
Constant Field Values
Constructor Detail

HistoryImpl

protected HistoryImpl(HistoryID id,
                      File directory,
                      HistoryRecordStructure historyRecordStructure,
                      HistoryServiceImpl historyServiceImpl)
Creates an instance of HistoryImpl by specifying the history identifier, the directory, the HistoryRecordStructure to use and the parent HistoryServiceImpl.

Parameters:
id - the identifier
directory - the directory
historyRecordStructure - the structure
historyServiceImpl - the parent history service
Method Detail

getID

public HistoryID getID()
Returns the identifier of this history.

Specified by:
getID in interface History
Returns:
the identifier of this history

getHistoryRecordsStructure

public HistoryRecordStructure getHistoryRecordsStructure()
Returns the current HistoryRecordStructure.

Specified by:
getHistoryRecordsStructure in interface History
Returns:
the current HistoryRecordStructure

setHistoryRecordsStructure

public void setHistoryRecordsStructure(HistoryRecordStructure structure)
Sets the given structure to be the new history records structure used in this history implementation.

Specified by:
setHistoryRecordsStructure in interface History
Parameters:
structure - the new HistoryRecordStructure to use

getReader

public HistoryReader getReader()
Description copied from interface: History
Returns an object which can be used to read and query this history.

Specified by:
getReader in interface History
Returns:
an object which can be used to read and query this history

getInteractiveReader

public InteractiveHistoryReader getInteractiveReader()
Returns an object that can be used to read and query this history. The InteractiveHistoryReader differs from the HistoryReader in the way it manages query results. It allows to cancel a search at any time and to track history results through a HistoryQueryListener.

Specified by:
getInteractiveReader in interface History
Returns:
an object that can be used to read and query this history

getWriter

public HistoryWriter getWriter()
Description copied from interface: History
Returns an object which can be used to append records to this history.

Specified by:
getWriter in interface History
Returns:
an object which can be used to append records to this history

getHistoryServiceImpl

protected HistoryServiceImpl getHistoryServiceImpl()

createDocument

protected Document createDocument(String filename)

writeFile

protected void writeFile(String filename)
                  throws InvalidParameterException,
                         IOException
Throws:
InvalidParameterException
IOException

writeFile

protected void writeFile(String filename,
                         Document doc)
                  throws InvalidParameterException,
                         IOException
Throws:
InvalidParameterException
IOException

getFileList

protected Iterator<String> getFileList()

getDocumentForFile

protected Document getDocumentForFile(String filename)
                               throws InvalidParameterException,
                                      RuntimeException
Throws:
InvalidParameterException
RuntimeException

getFixedDocument

public Document getFixedDocument(File file)
Returns the fixed document as xml Document if file cannot be fixed return null

Parameters:
file - File the file trying to fix
Returns:
Document the fixed doc

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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