Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

java.lang.Object
  extended by net.java.sip.communicator.impl.history.DBStructSerializer

public class DBStructSerializer
extends Object

Author:
Alexander Pelov

Constructor Summary
DBStructSerializer(HistoryServiceImpl historyService)
          Constructor.
 
Method Summary
 History loadHistory(File dbDatFile)
          This method parses an XML file, and returns a History object created with the information from it.
 void writeHistory(File dbDatFile, History history)
          Write the history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBStructSerializer

public DBStructSerializer(HistoryServiceImpl historyService)
Constructor.

Parameters:
historyService - the history service
Method Detail

writeHistory

public void writeHistory(File dbDatFile,
                         History history)
                  throws IOException
Write the history.

Parameters:
dbDatFile - the database file
history - the history to write
Throws:
IOException - if write failed for any reason

loadHistory

public History loadHistory(File dbDatFile)
                    throws SAXException,
                           IOException,
                           ParseException
This method parses an XML file, and returns a History object created with the information from it. The parsing is non-validating, so if a malformed XML is passed the results are undefined. The file should be with the following structure:

Parameters:
dbDatFile - The file to be parsed.
Returns:
A History object corresponding to this dbstruct file.
Throws:
SAXException - Thrown if an error occurs during XML parsing.
IOException - Thrown if an IO error occurs.
ParseException - Thrown if there is error in the XML data format.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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