org.opensync.engine.server.config
Class ConfigDoc

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.opensync.engine.server.config.ConfigDoc
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.io.Serializable

public class ConfigDoc
extends org.xml.sax.helpers.DefaultHandler
implements java.io.Serializable, org.xml.sax.ErrorHandler

This class represents the document of the OpenSync server

See Also:
Serialized Form

Field Summary
protected  Agendas agendas
          The agendas
protected  long lastModified
          The date of the last modification
protected  Sources sources
          The sources
protected  Synchronizations synchronizations
          The synchronizations
 
Constructor Summary
ConfigDoc()
          Construct the ConfigDoc object
 
Method Summary
 long checkLastModified(long lastModified)
          Return the lastModified from the files used in the Agendas Thus, we follow the Agendas, Tasks, Synchronisations, Sources, Views hierarchy to find XML configurations files which may have changed since the last update of the opensync.dat file in %OPENSYNC_HOME%\etc folder.
 void checkSourcesAvailability()
           
 void checkXML()
           
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 Agendas getAgendas()
          Get all agendas
static java.lang.String getConfigFileName()
           
 long getLastModified()
          Get the date of the last modification
 Source getSource(java.lang.String source)
          Get a source
 Sources getSources()
          Get all sources
 Synchronization getSynchronization(java.lang.String synchronization)
          Get a synchronization
 Synchronizations getSynchronizations()
          Get all synchronizations
 void init()
          Initialize the document with parsing the config file
 void readFile()
           
protected  void readObject(java.io.ObjectInputStream ois)
          Read the document from a stream
 void setLastModified(long lastModified)
           
 java.lang.String toString()
          Use for debug only
 void warning(org.xml.sax.SAXParseException exception)
           
protected  void writeObject(java.io.ObjectOutputStream oos)
          Write the document in a stream
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lastModified

protected long lastModified
The date of the last modification


sources

protected Sources sources
The sources


synchronizations

protected Synchronizations synchronizations
The synchronizations


agendas

protected Agendas agendas
The agendas

Constructor Detail

ConfigDoc

public ConfigDoc()
Construct the ConfigDoc object

Method Detail

getSynchronizations

public Synchronizations getSynchronizations()
Get all synchronizations


getSources

public Sources getSources()
Get all sources


getSource

public Source getSource(java.lang.String source)
Get a source

Parameters:
source - the source name to get

getSynchronization

public Synchronization getSynchronization(java.lang.String synchronization)
Get a synchronization

Parameters:
synchronization - the synchronization name to get

init

public void init()
          throws javax.xml.parsers.ParserConfigurationException,
                 OpenSyncException,
                 org.xml.sax.SAXException,
                 java.io.IOException
Initialize the document with parsing the config file

Throws:
OpenSyncException
java.io.IOException
org.xml.sax.SAXException
DocumentException
javax.xml.parsers.ParserConfigurationException

checkLastModified

public long checkLastModified(long lastModified)
                       throws java.io.IOException,
                              OpenSyncException
Return the lastModified from the files used in the Agendas Thus, we follow the Agendas, Tasks, Synchronisations, Sources, Views hierarchy to find XML configurations files which may have changed since the last update of the opensync.dat file in %OPENSYNC_HOME%\etc folder.

Returns:
Throws:
java.io.IOException
OpenSyncException

readFile

public void readFile()
              throws javax.xml.parsers.ParserConfigurationException,
                     OpenSyncException,
                     org.xml.sax.SAXException,
                     java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
OpenSyncException
org.xml.sax.SAXException
java.io.IOException

setLastModified

public void setLastModified(long lastModified)

checkXML

public void checkXML()
              throws org.xml.sax.SAXException,
                     javax.xml.parsers.ParserConfigurationException,
                     java.io.FileNotFoundException,
                     java.net.MalformedURLException,
                     java.io.IOException
Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.FileNotFoundException
java.net.MalformedURLException
java.io.IOException

checkSourcesAvailability

public void checkSourcesAvailability()
                              throws OpenSyncException
Throws:
OpenSyncException

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

getAgendas

public Agendas getAgendas()
Get all agendas


toString

public java.lang.String toString()
Use for debug only


writeObject

protected void writeObject(java.io.ObjectOutputStream oos)
                    throws java.io.IOException
Write the document in a stream

Parameters:
oos - the stream
Throws:
java.io.IOException

readObject

protected void readObject(java.io.ObjectInputStream ois)
                   throws java.lang.ClassNotFoundException,
                          java.io.IOException
Read the document from a stream

Parameters:
ois - the stream
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getLastModified

public long getLastModified()
Get the date of the last modification


getConfigFileName

public static java.lang.String getConfigFileName()


Copyright © 2004 sourceforge. All Rights Reserved.