Strabon

changeset 315:d8aa169eb72b

keep connection details in Strabon in datamembers
author Babis Nikolaou <charnik@di.uoa.gr>
date Thu Jun 21 14:32:26 2012 +0300 (2012-06-21)
parents ccb074b1d2a1
children ab82fc8816c0
files runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java
line diff
     1.1 --- a/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Thu Jun 21 14:16:37 2012 +0300
     1.2 +++ b/runtime/src/main/java/eu/earthobservatory/runtime/generaldb/Strabon.java	Thu Jun 21 14:32:26 2012 +0300
     1.3 @@ -12,7 +12,6 @@
     1.4  import java.io.StringReader;
     1.5  import java.net.MalformedURLException;
     1.6  import java.net.URL;
     1.7 -import java.nio.charset.Charset;
     1.8  import java.sql.SQLException;
     1.9  import java.util.ArrayList;
    1.10  import java.util.Set;
    1.11 @@ -85,19 +84,33 @@
    1.12  
    1.13  	private static Logger logger = LoggerFactory.getLogger(eu.earthobservatory.runtime.generaldb.Strabon.class);
    1.14  
    1.15 +	/**
    1.16 +	 * Connection details
    1.17 +	 */
    1.18 +	protected String databaseName;
    1.19 +	protected String user;
    1.20 +	protected String password;
    1.21 +	protected int port;
    1.22 +	protected String serverName;
    1.23 +	
    1.24  	protected SailBase db_store;
    1.25 -	SailRepository repo1;
    1.26 -	SailRepositoryConnection con1 = null;
    1.27 +	private SailRepository repo1;
    1.28 +	private SailRepositoryConnection con1 = null;
    1.29  
    1.30  	public Strabon(String databaseName, String user, String password, int port, String serverName, boolean checkForLockTable) 
    1.31 -			throws SQLException, ClassNotFoundException 
    1.32 -			{
    1.33 +			throws SQLException, ClassNotFoundException {
    1.34 +		this.databaseName = databaseName;
    1.35 +		this.user = user;
    1.36 +		this.password = password;
    1.37 +		this.port = port;
    1.38 +		this.serverName = serverName;
    1.39 +		
    1.40  		if (checkForLockTable == true) {
    1.41  			checkAndDeleteLock(databaseName, user, password, port, serverName);
    1.42  		}
    1.43  
    1.44  		initiate(databaseName, user, password, port, serverName);
    1.45 -			}
    1.46 +	}
    1.47  
    1.48  
    1.49  	protected abstract void initiate(String databaseName, String user, String password, int port, String serverName) ;