diff flys-aft/src/main/java/de/intevation/aft/Sync.java @ 4073:2c70fae83d0c

start syncing at river level. flys-aft/trunk@3406 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 13 Dec 2011 13:41:43 +0000
parents 88f801888d85
children dbd0b3b1b8b8
line wrap: on
line diff
--- a/flys-aft/src/main/java/de/intevation/aft/Sync.java	Tue Dec 13 12:33:36 2011 +0000
+++ b/flys-aft/src/main/java/de/intevation/aft/Sync.java	Tue Dec 13 13:41:43 2011 +0000
@@ -2,6 +2,8 @@
 
 import java.io.File;
 
+import java.sql.SQLException;
+
 import org.w3c.dom.Document;
 
 import de.intevation.utils.XML;
@@ -32,12 +34,25 @@
             System.exit(1);
         }
 
+        ConnectionBuilder aftConnectionBuilder =
+            new ConnectionBuilder(AFT, config);
+
         ConnectionBuilder flysConnectionBuilder =
             new ConnectionBuilder(FLYS, config);
 
-        ConnectionBuilder aftConnectionBuilder =
-            new ConnectionBuilder(AFT, config);
+        Rivers rivers = new Rivers(
+            aftConnectionBuilder,
+            flysConnectionBuilder);
 
+        try {
+            rivers.sync();
+        }
+        catch (SQLException sqle) {
+            System.err.println("syncing failed: " + sqle.getMessage());
+        }
+        finally {
+            rivers.close();
+        }
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org