comparison flys-aft/src/main/java/de/intevation/aft/Sync.java @ 4094:b20b710aa86f

Bubble up modifications up to main(). flys-aft/trunk@3605 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 05 Jan 2012 18:58:49 +0000
parents d556e29592f5
children da9df3641578
comparison
equal deleted inserted replaced
4093:7bddd4601707 4094:b20b710aa86f
21 public static final String FLYS = "flys"; 21 public static final String FLYS = "flys";
22 public static final String AFT = "aft"; 22 public static final String AFT = "aft";
23 23
24 public static final String XPATH_DIPS = "/sync/dips/file/text()"; 24 public static final String XPATH_DIPS = "/sync/dips/file/text()";
25 public static final String XPATH_REPAIR = "/sync/dips/repair/text()"; 25 public static final String XPATH_REPAIR = "/sync/dips/repair/text()";
26 public static final String XPATH_NOTIFICATIONS =
27 "/sync/notifications/notification";
26 28
27 public static final String CONFIG_FILE = 29 public static final String CONFIG_FILE =
28 System.getProperty("config.file", "config.xml"); 30 System.getProperty("config.file", "config.xml");
29 31
30 public static void main(String [] args) { 32 public static void main(String [] args) {
91 93
92 ConnectionBuilder flysConnectionBuilder = 94 ConnectionBuilder flysConnectionBuilder =
93 new ConnectionBuilder(FLYS, config); 95 new ConnectionBuilder(FLYS, config);
94 96
95 SyncContext syncContext = null; 97 SyncContext syncContext = null;
98
99 boolean modified = false;
96 try { 100 try {
97 syncContext = new SyncContext( 101 syncContext = new SyncContext(
98 aftConnectionBuilder.getConnectedStatements(), 102 aftConnectionBuilder.getConnectedStatements(),
99 flysConnectionBuilder.getConnectedStatements(), 103 flysConnectionBuilder.getConnectedStatements(),
100 dips); 104 dips);
101 syncContext.init(); 105 syncContext.init();
102 Rivers rivers = new Rivers(); 106 Rivers rivers = new Rivers();
103 rivers.sync(syncContext); 107 modified = rivers.sync(syncContext);
104 } 108 }
105 catch (SQLException sqle) { 109 catch (SQLException sqle) {
106 log.error("syncing failed", sqle); 110 log.error("syncing failed", sqle);
107 exitCode = 1; 111 exitCode = 1;
108 } 112 }

http://dive4elements.wald.intevation.org