01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20: package com.salmonllc.sql;
21:
22: /**
23: * This interface should be implemented for DataStores that use non standard data sources to retrieve their data.
24: */
25: public interface DataSourceOut {
26: /**
27: * This method will be called for each row that was deleted in the datastore. The method must delete the row from the database.Return true to keep processing rows and false to stop.
28: */
29: public boolean deleteRow(DataStore ds, DataStoreRow row,
30: DBConnection conn) throws Exception;
31:
32: /**
33: * This method will be called for each row that was inserted in the datastore. The method must insert the row into the database. Return true to keep processing rows and false to stop.
34: */
35: public boolean insertRow(DataStore ds, DataStoreRow row,
36: DBConnection conn) throws Exception;
37:
38: /**
39: * This method will be after the data update loop starts.
40: * @return boolean true if the DataStore was updated properly and false if not.
41: */
42: public void postUpdate(DataStore ds, DBConnection conn,
43: boolean handleTrans, boolean updateSucceeded)
44: throws Exception;
45:
46: /**
47: * This method will be called before the data update loop starts.
48: * @return boolean true if the DataStore should be updated and false if not
49: */
50: public boolean preUpdate(DataStore ds, DBConnection conn,
51: boolean handleTrans) throws Exception;
52:
53: /**
54: * This method will be called for each row that was modified in the datastore. The method must take the values in the datastore and update the database.Return true to keep processing rows and false to stop.
55: */
56: public boolean updateRow(DataStore ds, DataStoreRow row,
57: DBConnection conn) throws Exception;
58: }
|