svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.h2 / src / main / java / org / gvsig / fmap / dal / store / h2 / H2ResourceParameters.java @ 41719
History | View | Annotate | Download (2.49 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2009 IVER T.I {{Task}}
|
26 |
*/
|
27 |
package org.gvsig.fmap.dal.store.h2; |
28 |
|
29 |
import java.io.File; |
30 |
import org.gvsig.fmap.dal.store.jdbc.JDBCResourceParameters; |
31 |
|
32 |
import static org.gvsig.fmap.dal.store.h2.H2ConnectionParameters.PARAMETER_NAME_BASEFOLDER; |
33 |
|
34 |
public class H2ResourceParameters extends JDBCResourceParameters |
35 |
implements H2ConnectionParameters {
|
36 |
|
37 |
public static final String PARAMETERS_DEFINITION_NAME = "H2SQLResourceParameters"; |
38 |
|
39 |
public H2ResourceParameters() {
|
40 |
super(PARAMETERS_DEFINITION_NAME, H2Resource.NAME);
|
41 |
} |
42 |
|
43 |
public H2ResourceParameters(String url, String host, Integer port, |
44 |
String dbName, String user, String password, |
45 |
String jdbcDriverClassName, Boolean ssl) { |
46 |
super(PARAMETERS_DEFINITION_NAME, H2Resource.NAME, url, host, port, dbName, user, password, jdbcDriverClassName);
|
47 |
if ( ssl != null ) { |
48 |
this.setUseSSL(ssl.booleanValue());
|
49 |
} |
50 |
} |
51 |
|
52 |
public String getUrl() { |
53 |
return H2ParametersHelper.getConnectionString(this); |
54 |
} |
55 |
|
56 |
public Boolean getUseSSL() { |
57 |
return (Boolean) this.getDynValue(PARAMETER_NAME_USESSL); |
58 |
} |
59 |
|
60 |
public void setUseSSL(Boolean useSSL) { |
61 |
this.setDynValue(PARAMETER_NAME_USESSL, useSSL);
|
62 |
} |
63 |
|
64 |
public void setUseSSL(boolean useSSL) { |
65 |
this.setDynValue(PARAMETER_NAME_USESSL, new Boolean(useSSL)); |
66 |
} |
67 |
|
68 |
public File getBaseFolder() { |
69 |
return (File) this.getDynValue(PARAMETER_NAME_BASEFOLDER); |
70 |
} |
71 |
|
72 |
public void setBaseFolder(File baseFolder) { |
73 |
this.setDynValue(PARAMETER_NAME_BASEFOLDER, baseFolder);
|
74 |
} |
75 |
} |