org.opensync.engine.server
Class OpenSync

java.lang.Object
  extended byorg.opensync.engine.server.OpenSync
All Implemented Interfaces:
java.util.EventListener, TaskListener

public class OpenSync
extends java.lang.Object
implements TaskListener

This class represents the OpenSync application


Nested Class Summary
(package private)  class OpenSync.Flag
           
 
Field Summary
protected  AppFrm appFrame
          The frame of the application
protected static java.lang.String[] args
          The command arguments
protected  ConfigDoc configDoc
          The config document
protected static DatabaseManager dbMgr
          The internal XML database server for incremental synchronizations
protected  java.lang.String home
          The home directory of the OpenSync application
protected  boolean incrementalMode
           
protected static OpenSync instance
          The instance of the OpenSync server
protected  java.util.Locale locale
           
protected  Log log
          The log
protected  PoolManager poolManager
          The pool manager
protected  OpenSyncProps properties
          The properties of the application
protected  TasksScheduler tasksScheduler
          The task scheduler
 
Constructor Summary
OpenSync()
          Create the OpenSync object
 
Method Summary
static java.lang.Process executeCmd(java.lang.String command)
           
 AppFrm getAppFrame()
          Get the application Frame
 ConfigDoc getConfigDoc()
          Get the config document
 java.lang.String getDirectoryPath(java.lang.String directory, boolean check)
          Get of the absolute path of a directory (OpenSync_HOME + directory)
 java.lang.String getFilePath(java.lang.String fileName, boolean check)
          Get of the absolute path of a file (OpenSync_HOME + file)
 java.lang.String getHome()
           
 boolean getIncrementalMode()
          Get the incremental mode
static OpenSync getInstance()
          Get the instance of the OpenSync object (singleton)
 java.util.Locale getLocale()
           
 Log getLog()
          Get the log
 PoolManager getPoolManager()
          Get the pool manager
 OpenSyncProps getProperties()
          Get the properties of the application
protected  void init()
          Initialize the OpenSync application
protected  void init(Task task)
          Register the log object to all tasks
 void loadProperties()
           
 boolean loadState()
          Load the state of the server
static void main(java.lang.String[] args)
          The main of the OpenSync application
protected  void notification()
           
static void restart()
          Restart the server
 void saveState()
          Save the state of the server
 void saveStateNotWorkingUnderAix()
           
 void setAppFrame(AppFrm appFrame)
          Set the application Frame
 void setHome(java.lang.String home)
           
protected static void setInstance()
          Set the instance of the OpenSync object (singleton)
 void setLocale(java.util.Locale locale)
           
 void setLog(Log log)
           
 void setProperties(OpenSyncProps properties)
           
protected  void start()
          Start the OpenSync server
static void startXMLDatabase()
           
 void taskFail(TaskEvent event)
          Implements the TaskListenr interface
 void taskStart(TaskEvent event)
          Implements the TaskListenr interface
 void taskStop(TaskEvent event)
          Implements the TaskListenr interface
static void usage()
          Print the usage of the command line
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

protected static OpenSync instance
The instance of the OpenSync server


dbMgr

protected static DatabaseManager dbMgr
The internal XML database server for incremental synchronizations


configDoc

protected ConfigDoc configDoc
The config document


log

protected Log log
The log


tasksScheduler

protected TasksScheduler tasksScheduler
The task scheduler


appFrame

protected AppFrm appFrame
The frame of the application


poolManager

protected PoolManager poolManager
The pool manager


home

protected java.lang.String home
The home directory of the OpenSync application


locale

protected java.util.Locale locale

incrementalMode

protected boolean incrementalMode

args

protected static java.lang.String[] args
The command arguments


properties

protected OpenSyncProps properties
The properties of the application

Constructor Detail

OpenSync

public OpenSync()
Create the OpenSync object

Method Detail

getInstance

public static OpenSync getInstance()
Get the instance of the OpenSync object (singleton)


setInstance

protected static void setInstance()
Set the instance of the OpenSync object (singleton)


start

protected void start()
              throws javax.xml.parsers.ParserConfigurationException,
                     java.io.IOException,
                     OpenSyncException,
                     org.xml.sax.SAXException
Start the OpenSync server

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

taskStart

public void taskStart(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskStart in interface TaskListener
Parameters:
event - the task event

taskFail

public void taskFail(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskFail in interface TaskListener
Parameters:
event - the task event

taskStop

public void taskStop(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskStop in interface TaskListener
Parameters:
event - the task event

notification

protected void notification()
                     throws org.xml.sax.SAXException,
                            javax.xml.parsers.ParserConfigurationException,
                            javax.mail.MessagingException,
                            java.io.IOException
Throws:
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
javax.mail.MessagingException
java.io.IOException

init

protected void init()
Initialize the OpenSync application


init

protected void init(Task task)
Register the log object to all tasks

Parameters:
task -

getDirectoryPath

public java.lang.String getDirectoryPath(java.lang.String directory,
                                         boolean check)
                                  throws java.io.FileNotFoundException
Get of the absolute path of a directory (OpenSync_HOME + directory)

Parameters:
directory - the directory
check - check if it exists
Throws:
java.io.FileNotFoundException

getFilePath

public java.lang.String getFilePath(java.lang.String fileName,
                                    boolean check)
                             throws java.io.FileNotFoundException
Get of the absolute path of a file (OpenSync_HOME + file)

Parameters:
fileName - the file name
check - check if it exists
Throws:
java.io.FileNotFoundException

getProperties

public OpenSyncProps getProperties()
Get the properties of the application


getPoolManager

public PoolManager getPoolManager()
Get the pool manager


getLog

public Log getLog()
Get the log


getConfigDoc

public ConfigDoc getConfigDoc()
Get the config document


getIncrementalMode

public boolean getIncrementalMode()
Get the incremental mode


getAppFrame

public AppFrm getAppFrame()
Get the application Frame


setAppFrame

public void setAppFrame(AppFrm appFrame)
Set the application Frame

Parameters:
appFrame - the frame a the application

restart

public static void restart()
Restart the server


loadProperties

public void loadProperties()
                    throws OpenSyncException,
                           java.io.IOException,
                           java.io.FileNotFoundException
Throws:
OpenSyncException
java.io.IOException
java.io.FileNotFoundException

startXMLDatabase

public static void startXMLDatabase()

main

public static void main(java.lang.String[] args)
The main of the OpenSync application

Parameters:
args - the arguments

executeCmd

public static java.lang.Process executeCmd(java.lang.String command)
                                    throws java.io.IOException
Throws:
java.io.IOException

usage

public static void usage()
Print the usage of the command line


saveState

public void saveState()
Save the state of the server


saveStateNotWorkingUnderAix

public void saveStateNotWorkingUnderAix()

loadState

public boolean loadState()
                  throws org.xml.sax.SAXException,
                         javax.xml.parsers.ParserConfigurationException,
                         java.io.IOException,
                         OpenSyncException
Load the state of the server

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

setProperties

public void setProperties(OpenSyncProps properties)
Parameters:
properties - The properties to set.

getHome

public java.lang.String getHome()
Returns:
Returns the home.

setHome

public void setHome(java.lang.String home)
Parameters:
home - The home to set.

getLocale

public java.util.Locale getLocale()
Returns:
Returns the locale.

setLocale

public void setLocale(java.util.Locale locale)
Parameters:
locale - The locale to set.

setLog

public void setLog(Log log)


Copyright © 2004 sourceforge. All Rights Reserved.