Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java @ 3923:9fac337192c9
Removed trailing whitespace.
flys-artifacts/trunk@5607 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 27 Sep 2012 08:53:59 +0000 |
parents | 2fdbe78a8fc2 |
children | a2735a4bf75e |
comparison
equal
deleted
inserted
replaced
3922:e1d3f6bccf2b | 3923:9fac337192c9 |
---|---|
40 | 40 |
41 private static final Logger logger = Logger.getLogger(WMSDBArtifact.class); | 41 private static final Logger logger = Logger.getLogger(WMSDBArtifact.class); |
42 | 42 |
43 public static final Pattern DB_URL_PATTERN = | 43 public static final Pattern DB_URL_PATTERN = |
44 Pattern.compile("(.*)\\/\\/(.*):([0-9]+)\\/([a-zA-Z]+)"); | 44 Pattern.compile("(.*)\\/\\/(.*):([0-9]+)\\/([a-zA-Z]+)"); |
45 | 45 |
46 public static final Pattern DB_PSQL_URL_PATTERN = | 46 public static final Pattern DB_PSQL_URL_PATTERN = |
47 Pattern.compile("(.*)\\/\\/(.*):([0-9]+)\\/([a-zA-Z0-9]+)"); | 47 Pattern.compile("(.*)\\/\\/(.*):([0-9]+)\\/([a-zA-Z0-9]+)"); |
48 | 48 |
49 | 49 |
50 @Override | 50 @Override |
231 | 231 |
232 logger.debug("Created connection: '" + connection + "'"); | 232 logger.debug("Created connection: '" + connection + "'"); |
233 | 233 |
234 return connection; | 234 return connection; |
235 } | 235 } |
236 | 236 |
237 protected String getPostgreSQLConnection() { | 237 protected String getPostgreSQLConnection() { |
238 SessionFactoryImpl sf = (SessionFactoryImpl) | 238 SessionFactoryImpl sf = (SessionFactoryImpl) |
239 SessionFactoryProvider.getSessionFactory(); | 239 SessionFactoryProvider.getSessionFactory(); |
240 | 240 |
241 String user = SessionFactoryProvider.getUser(sf); | 241 String user = SessionFactoryProvider.getUser(sf); |
242 String pass = SessionFactoryProvider.getPass(sf); | 242 String pass = SessionFactoryProvider.getPass(sf); |
243 String url = SessionFactoryProvider.getURL(sf); | 243 String url = SessionFactoryProvider.getURL(sf); |
244 | 244 |
245 Matcher m = DB_PSQL_URL_PATTERN.matcher(url); | 245 Matcher m = DB_PSQL_URL_PATTERN.matcher(url); |
246 if (!m.matches()) { | 246 if (!m.matches()) { |
247 logger.warn("Could not parse PostgreSQL Connection string."); | 247 logger.warn("Could not parse PostgreSQL Connection string."); |
248 return null; | 248 return null; |
249 } | 249 } |
362 | 362 |
363 FileTools.deleteRecursive(dir); | 363 FileTools.deleteRecursive(dir); |
364 MapfileGenerator.getInstance().update(); | 364 MapfileGenerator.getInstance().update(); |
365 } | 365 } |
366 } | 366 } |
367 | 367 |
368 /** | 368 /** |
369 * This method returns the extent of a DB layer in the projection of the | 369 * This method returns the extent of a DB layer in the projection of the |
370 * database. | 370 * database. |
371 * | 371 * |
372 * @return the extent of the DB layer in the projection of the database. | 372 * @return the extent of the DB layer in the projection of the database. |
373 */ | 373 */ |
374 protected Envelope getExtent() { | 374 protected Envelope getExtent() { |
375 return getExtent(false); | 375 return getExtent(false); |
376 } | 376 } |
386 * This method returns the extent of the DB layer. The projection of the | 386 * This method returns the extent of the DB layer. The projection of the |
387 * extent depends on the <i>reproject</i> parameter. If reproject is set, | 387 * extent depends on the <i>reproject</i> parameter. If reproject is set, |
388 * the extent is reprojected into the original projection which is | 388 * the extent is reprojected into the original projection which is |
389 * specified in the configuration. Otherwise, the projection of the | 389 * specified in the configuration. Otherwise, the projection of the |
390 * database is used. | 390 * database is used. |
391 * | 391 * |
392 * @param reproject True, to reproject the extent into the projection | 392 * @param reproject True, to reproject the extent into the projection |
393 * specified in the configuration. | 393 * specified in the configuration. |
394 * | 394 * |
395 * @return the extent of the database layer. | 395 * @return the extent of the database layer. |
396 */ | 396 */ |
397 protected abstract Envelope getExtent(boolean reproject); | 397 protected abstract Envelope getExtent(boolean reproject); |
398 | 398 |
399 protected abstract String getFilter(); | 399 protected abstract String getFilter(); |