Mercurial > dive4elements > gnv-client
comparison geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnection.java @ 551:1f6e2b256247
Improved the Objectvalidation of the ArcSDE-Databaseconnections
geo-backend/trunk@544 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 15 Jan 2010 10:09:41 +0000 |
parents | 210716612c30 |
children | 5b536542ef56 |
comparison
equal
deleted
inserted
replaced
550:84ba7cbff791 | 551:1f6e2b256247 |
---|---|
40 */ | 40 */ |
41 private static Logger log = Logger.getLogger(ArcSDEPoolableObjectFactory.class); | 41 private static Logger log = Logger.getLogger(ArcSDEPoolableObjectFactory.class); |
42 | 42 |
43 private SeConnection seConnection = null; | 43 private SeConnection seConnection = null; |
44 | 44 |
45 private long serverRoundtripInterval; | |
46 | |
45 | 47 |
46 | 48 |
47 /** | 49 /** |
48 * Constructor | 50 * Constructor |
49 */ | 51 */ |
50 public ArcSDEConnection(String server,String port,String database,String username,String credentials) throws ConnectionException { | 52 public ArcSDEConnection(String server,String port,String database,String username,String credentials, long serverRoundtripInterval) throws ConnectionException { |
51 try { | 53 try { |
52 seConnection = new SeConnection(server,port,database,username,credentials); | 54 seConnection = new SeConnection(server,port,database,username,credentials); |
55 this.serverRoundtripInterval = serverRoundtripInterval; | |
53 } catch (SeException e) { | 56 } catch (SeException e) { |
54 log.error(e,e); | 57 log.error(e,e); |
55 throw new ConnectionException(e); | 58 throw new ConnectionException(e); |
56 } | 59 } |
57 } | 60 } |
386 public String getClientInfo(String arg0) throws SQLException { | 389 public String getClientInfo(String arg0) throws SQLException { |
387 return null; | 390 return null; |
388 } | 391 } |
389 | 392 |
390 public boolean isValid(int arg0) throws SQLException { | 393 public boolean isValid(int arg0) throws SQLException { |
391 return false; | 394 |
395 boolean valid = true; | |
396 try { | |
397 this.seConnection.testServer(serverRoundtripInterval); | |
398 } catch (SeException e) { | |
399 log.debug("The validation of the Connection has occured an Error. The connection is invalid."); | |
400 valid = false; | |
401 } | |
402 | |
403 return valid; | |
392 } | 404 } |
393 | 405 |
394 public void setClientInfo(Properties arg0) throws SQLClientInfoException { | 406 public void setClientInfo(Properties arg0) throws SQLClientInfoException { |
395 } | 407 } |
396 | 408 |