org.opensync.engine.server
Class DefaultAdapter

java.lang.Object
  extended byorg.opensync.engine.server.DefaultAdapter
All Implemented Interfaces:
Adapter, java.io.Serializable
Direct Known Subclasses:
BDAdapter, FileAdapter

public abstract class DefaultAdapter
extends java.lang.Object
implements Adapter, java.io.Serializable

The default implementation of the adpater interface

See Also:
Serialized Form

Field Summary
protected  Connector connector
          The connector used by the adapter
protected  java.lang.String tablesDescriptor
          The url of the tables descriptor
protected  java.lang.String themesDescriptor
          The url of the themes descriptor
 
Constructor Summary
DefaultAdapter()
          Construct a DefaultAdapter
 
Method Summary
abstract  java.lang.String adaptInputView(java.lang.String xml, View view, Statistic stat, Window win)
          Adapt the the data source format to the OpenSync data format
abstract  java.lang.String adaptOutputView(java.lang.String xml, View view, Statistic stat)
          Adapt the the data OpenSync format to the data source format
 Connector getConnector()
          Get the connector used by the adapter
 java.util.List getPKs(org.dom4j.Document themes, java.lang.String theme)
           
 java.lang.String getTablesDescriptor()
          Get the tables descriptor
 java.lang.String getThemesDescriptor()
          Get the themes descriptor
 void init()
           
 org.dom4j.Document readThemeDescriptor()
           
 void release()
           
 void releaseWithException()
           
 void setConnector(Connector connector)
          The the connector used by the adapter
 void setTablesDescriptor(java.lang.String tablesDescriptor)
          Set the tables descriptor
 void setThemesDescriptor(java.lang.String themesDescriptor)
          Set the themes descriptor
 void startReadInputFile(boolean status)
           
 java.lang.String toString()
          Use for debug only
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connector

protected Connector connector
The connector used by the adapter


tablesDescriptor

protected java.lang.String tablesDescriptor
The url of the tables descriptor


themesDescriptor

protected java.lang.String themesDescriptor
The url of the themes descriptor

Constructor Detail

DefaultAdapter

public DefaultAdapter()
Construct a DefaultAdapter

Method Detail

init

public void init()
Specified by:
init in interface Adapter

release

public void release()
             throws java.sql.SQLException
Specified by:
release in interface Adapter
Throws:
java.sql.SQLException

releaseWithException

public void releaseWithException()
                          throws java.sql.SQLException
Specified by:
releaseWithException in interface Adapter
Throws:
java.sql.SQLException

setTablesDescriptor

public void setTablesDescriptor(java.lang.String tablesDescriptor)
Set the tables descriptor

Specified by:
setTablesDescriptor in interface Adapter
Parameters:
tablesDescriptor - the url of the tables descriptor

getTablesDescriptor

public java.lang.String getTablesDescriptor()
Get the tables descriptor

Specified by:
getTablesDescriptor in interface Adapter

setThemesDescriptor

public void setThemesDescriptor(java.lang.String themesDescriptor)
Set the themes descriptor

Specified by:
setThemesDescriptor in interface Adapter
Parameters:
themesDescriptor - the url of the themes descriptor

getThemesDescriptor

public java.lang.String getThemesDescriptor()
Get the themes descriptor

Specified by:
getThemesDescriptor in interface Adapter

readThemeDescriptor

public org.dom4j.Document readThemeDescriptor()
                                       throws java.io.FileNotFoundException,
                                              org.dom4j.DocumentException,
                                              org.xml.sax.SAXException,
                                              java.net.MalformedURLException
Specified by:
readThemeDescriptor in interface Adapter
Throws:
java.io.FileNotFoundException
org.dom4j.DocumentException
org.xml.sax.SAXException
java.net.MalformedURLException

getPKs

public java.util.List getPKs(org.dom4j.Document themes,
                             java.lang.String theme)
                      throws org.dom4j.DocumentException,
                             java.io.FileNotFoundException,
                             org.xml.sax.SAXException,
                             java.net.MalformedURLException
Specified by:
getPKs in interface Adapter
Throws:
org.dom4j.DocumentException
java.io.FileNotFoundException
org.xml.sax.SAXException
java.net.MalformedURLException

validate

public void validate()
              throws OpenSyncException
Specified by:
validate in interface Adapter
Throws:
OpenSyncException

adaptInputView

public abstract java.lang.String adaptInputView(java.lang.String xml,
                                                View view,
                                                Statistic stat,
                                                Window win)
                                         throws java.lang.Exception
Adapt the the data source format to the OpenSync data format

Specified by:
adaptInputView in interface Adapter
Parameters:
xml - the view in source format
view - the view
Throws:
java.io.IOException
java.lang.Exception

adaptOutputView

public abstract java.lang.String adaptOutputView(java.lang.String xml,
                                                 View view,
                                                 Statistic stat)
                                          throws java.lang.Exception
Adapt the the data OpenSync format to the data source format

Specified by:
adaptOutputView in interface Adapter
Parameters:
xml - the view in OpenSync format
view - the view
Throws:
java.lang.Exception

setConnector

public void setConnector(Connector connector)
The the connector used by the adapter

Parameters:
connector -

getConnector

public Connector getConnector()
Get the connector used by the adapter


toString

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


startReadInputFile

public void startReadInputFile(boolean status)
Specified by:
startReadInputFile in interface Adapter
Parameters:
status -


Copyright © 2004 sourceforge. All Rights Reserved.