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 / H2SpatialStoreParameters.java @ 45069
History | View | Annotate | Download (2.6 KB)
1 | 43377 | jjdelcerro | /* 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 | package org.gvsig.fmap.dal.store.h2; |
||
23 | |||
24 | import java.io.File; |
||
25 | import java.util.Properties; |
||
26 | import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
||
27 | 44399 | omartinez | import org.gvsig.fmap.dal.store.jdbc.JDBCConnectionParameters; |
28 | 43377 | jjdelcerro | import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
29 | |||
30 | public class H2SpatialStoreParameters extends JDBCStoreParameters implements H2SpatialConnectionParameters { |
||
31 | |||
32 | private final H2SpatialConnectionParametersHelper helper; |
||
33 | 44399 | omartinez | |
34 | 43377 | jjdelcerro | public H2SpatialStoreParameters() {
|
35 | super(
|
||
36 | H2SpatialLibrary.NAME + "StoreParameters",
|
||
37 | H2SpatialLibrary.NAME |
||
38 | ); |
||
39 | this.helper = new H2SpatialConnectionParametersHelper(this); |
||
40 | } |
||
41 | |||
42 | @Override
|
||
43 | public String getUrl() { |
||
44 | return this.helper.getUrl(); |
||
45 | } |
||
46 | 44399 | omartinez | |
47 | 43377 | jjdelcerro | @Override
|
48 | public void validate() throws ValidateDataParametersException { |
||
49 | this.helper.validate();
|
||
50 | super.validate();
|
||
51 | } |
||
52 | 44399 | omartinez | |
53 | 43377 | jjdelcerro | @Override
|
54 | public Properties getProperties() { |
||
55 | return this.helper.getProperties(); |
||
56 | } |
||
57 | |||
58 | @Override
|
||
59 | public File getFile() { |
||
60 | return this.helper.getFile(); |
||
61 | } |
||
62 | 44399 | omartinez | |
63 | 43377 | jjdelcerro | @Override
|
64 | public void setFile(File database) { |
||
65 | 44399 | omartinez | try {
|
66 | this.helper.setFile(database);
|
||
67 | String url = H2SpatialHelper.getConnectionURL((H2SpatialConnectionParameters) this); |
||
68 | this.setDynValue(JDBCConnectionParameters.URL_PARAMTER_NAME, url);
|
||
69 | } catch (Exception ex) { |
||
70 | } |
||
71 | 43377 | jjdelcerro | } |
72 | |||
73 | 45069 | jjdelcerro | @Override
|
74 | public int getMaxSecondsIdle() { |
||
75 | return this.helper.getMaxSecondsIdle(); |
||
76 | } |
||
77 | |||
78 | @Override
|
||
79 | public boolean getServerAllowOthers() { |
||
80 | return this.helper.getServerAllowOthers(); |
||
81 | } |
||
82 | |||
83 | @Override
|
||
84 | public int getServerPort() { |
||
85 | return this.helper.getServerPort(); |
||
86 | } |
||
87 | |||
88 | 43377 | jjdelcerro | } |