1 package org.opensync.engine.server;
2
3 import java.io.FileNotFoundException;
4 import java.net.MalformedURLException;
5 import java.sql.SQLException;
6 import java.util.List;
7
8 import org.dom4j.Document;
9 import org.dom4j.DocumentException;
10 import org.xml.sax.SAXException;
11
12 /***
13 * The adpter interface is used to convert the data source format to the OpenSync
14 * data format
15 */
16
17 public interface Adapter {
18
19 /***
20 * Set the tables descriptor
21 *
22 * @param tablesDescriptor the url of the tables descriptor
23 */
24 public void setTablesDescriptor(String tablesDescriptor);
25 /***
26 * Get the tables descriptor
27 *
28 */
29 public String getTablesDescriptor();
30 /***
31 * Set the themes descriptor
32 *
33 * @param themesDescriptor the url of the themes descriptor
34 */
35 public void setThemesDescriptor(String themesDescriptor);
36
37 /***
38 * Get the themes descriptor
39 *
40 */
41 public String getThemesDescriptor();
42
43 public Document readThemeDescriptor() throws FileNotFoundException, DocumentException, SAXException, MalformedURLException;
44
45 public List getPKs(Document themes, String theme) throws DocumentException, FileNotFoundException, SAXException, MalformedURLException;
46
47 /***
48 * Adapt the the data source format to the OpenSync
49 * data format
50 *
51 * @param xml the view in source format
52 * @param view the view
53 * @exception Exception
54 */
55 public String adaptInputView(String xml,View view, Statistic stat, Window win)throws Exception;
56 /***
57 * Adapt the the data OpenSync format to the
58 * data source format
59 *
60 * @param xml the view in OpenSync format
61 * @param view the view
62 * @exception Exception
63 */
64 public String adaptOutputView(String xml,View view, Statistic stat)throws Exception;
65
66 public void init();
67
68 /***
69 *
70 * @throws OpenSyncException
71 */
72 public void release() throws SQLException;
73
74 /***
75 *
76 * @throws OpenSyncException
77 */
78 public void releaseWithException() throws SQLException;
79
80 /***
81 *
82 * @throws OpenSyncException
83 */
84 public void validate() throws OpenSyncException;
85
86 /***
87 *
88 * @param status
89 */
90 public void startReadInputFile(boolean status);
91
92
93 }