14 |
import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException; |
import dk.daoas.fulddaekning.BoundingBox.BoundingBoxException; |
15 |
|
|
16 |
public class Lookup { |
public class Lookup { |
17 |
|
|
18 |
|
static final String CONFIG_FILENAME = "fulddaekning.properties"; |
19 |
|
|
20 |
static int max_workers; |
static int max_workers; |
21 |
static boolean verbose; |
static boolean verbose; |
22 |
|
|
23 |
|
static boolean rename_tables; |
24 |
|
static String distributor; |
25 |
|
|
26 |
static SafeProperties conf; |
static SafeProperties conf; |
27 |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
28 |
|
|
161 |
|
|
162 |
public static void main(String[] args) throws Exception { |
public static void main(String[] args) throws Exception { |
163 |
|
|
164 |
File confFile = new File("fulddaekning.properties"); |
File confFile = new File( CONFIG_FILENAME ); |
165 |
if (! confFile.exists() ) { |
if (! confFile.exists() ) { |
166 |
logger.warning("Config file not found"); |
logger.warning("Config file not found: " + CONFIG_FILENAME); |
167 |
System.exit(1); |
System.exit(1); |
168 |
} |
} |
169 |
|
|
176 |
verbose = Boolean.parseBoolean( conf.getSafeProperty("VERBOSE") ); |
verbose = Boolean.parseBoolean( conf.getSafeProperty("VERBOSE") ); |
177 |
logger.info("Starting with VERBOSE:" + verbose); |
logger.info("Starting with VERBOSE:" + verbose); |
178 |
|
|
179 |
|
rename_tables = Boolean.parseBoolean( conf.getSafeProperty("RENAMETABLES") ); |
180 |
|
logger.info("Starting with RENAMETABLES:" + rename_tables); |
181 |
|
|
182 |
|
distributor = conf.getSafeProperty("DISTRIBUTOR"); |
183 |
|
distributor = distributor.toUpperCase(); |
184 |
|
Constants.init(distributor); |
185 |
|
|
186 |
|
|
187 |
Database db = new Database(conf); |
Database db = new Database(conf); |
188 |
|
|
189 |
db.resetResultTable(); |
db.resetResultTable(); |
202 |
lookup.doLookup(); |
lookup.doLookup(); |
203 |
} |
} |
204 |
|
|
205 |
|
if (rename_tables) { |
206 |
|
db.renameResultTables(); |
207 |
|
} else { |
208 |
|
logger.info( "Rename tables is disabled !!!" ); |
209 |
|
} |
210 |
|
|
211 |
long now = System.currentTimeMillis(); |
long now = System.currentTimeMillis(); |
212 |
|
|
213 |
logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede); |
logger.info("Flest Ikke-dækkede, " + flestIkkeDaekkede); |