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 Properties conf; |
static boolean rename_tables; |
24 |
|
static String distributor; |
25 |
|
|
26 |
|
static SafeProperties conf; |
27 |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
static Logger logger = Logger.getLogger( Lookup.class.toString() ); |
28 |
|
|
29 |
int postnr; |
int postnr; |
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 |
|
|
170 |
conf = new Properties(); |
conf = new SafeProperties(); |
171 |
conf.load( new FileReader(confFile) ); |
conf.load( new FileReader(confFile) ); |
172 |
|
|
173 |
max_workers = Integer.parseInt( conf.getProperty("MAX_WORKERS") ); |
max_workers = Integer.parseInt( conf.getSafeProperty("MAX_WORKERS") ); |
174 |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
logger.info("Starting with MAX_WORKERS:" + max_workers); |
175 |
|
|
176 |
verbose = Boolean.parseBoolean( conf.getProperty("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); |