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.lib / src / main / java / org / gvsig / fmap / dal / serverexplorer / db / DBServerExplorerParameters.java @ 40596
History | View | Annotate | Download (3.54 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.serverexplorer.db; |
25 |
|
26 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
27 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
28 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
29 |
import org.gvsig.fmap.dal.store.db.DBHelper; |
30 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
31 |
|
32 |
/**
|
33 |
* Abstract class of {@link DataServerExplorerParameters} for Data Base type
|
34 |
* server
|
35 |
*
|
36 |
* @author jmvivo
|
37 |
*
|
38 |
*/
|
39 |
public abstract class DBServerExplorerParameters extends AbstractDataParameters |
40 |
implements DataServerExplorerParameters, DBConnectionParameter {
|
41 |
|
42 |
public static final String PARAMETERS_DEFINITION_NAME = "DBServerExplorerParameters"; |
43 |
|
44 |
private DelegatedDynObject parameters;
|
45 |
|
46 |
public DBServerExplorerParameters(String parametersDefinitionName, String explorerName) { |
47 |
this.parameters = (DelegatedDynObject) DBHelper.newParameters(parametersDefinitionName);
|
48 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, explorerName);
|
49 |
} |
50 |
|
51 |
public String getExplorerName() { |
52 |
return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME); |
53 |
} |
54 |
|
55 |
protected DelegatedDynObject getDelegatedDynObject() {
|
56 |
return parameters;
|
57 |
} |
58 |
|
59 |
public String getHost() { |
60 |
return (String) this.getDynValue(HOST_PARAMTER_NAME); |
61 |
} |
62 |
|
63 |
public Integer getPort() { |
64 |
return (Integer) this.getDynValue(PORT_PARAMTER_NAME); |
65 |
} |
66 |
|
67 |
public String getDBName() { |
68 |
return (String) this.getDynValue(DBNAME_PARAMTER_NAME); |
69 |
} |
70 |
|
71 |
public String getUser() { |
72 |
return (String) this.getDynValue(USER_PARAMTER_NAME); |
73 |
} |
74 |
|
75 |
public String getPassword() { |
76 |
return (String) this.getDynValue(PASSWORD_PARAMTER_NAME); |
77 |
} |
78 |
|
79 |
/**
|
80 |
* Set <code>host</code> parameter value
|
81 |
*
|
82 |
* @param host
|
83 |
*/
|
84 |
public void setHost(String host) { |
85 |
this.setDynValue(HOST_PARAMTER_NAME, host);
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* Set <code>port/code> parameter value
|
90 |
*
|
91 |
* @param port
|
92 |
*/
|
93 |
public void setPort(int port) { |
94 |
this.setDynValue(PORT_PARAMTER_NAME, new Integer(port)); |
95 |
} |
96 |
|
97 |
/**
|
98 |
* Set <code>port/code> parameter value
|
99 |
*
|
100 |
* @param port
|
101 |
*/
|
102 |
public void setPort(Integer port) { |
103 |
this.setDynValue(PORT_PARAMTER_NAME, port);
|
104 |
} |
105 |
|
106 |
/**
|
107 |
* Set <code>data base name/code> parameter value
|
108 |
*
|
109 |
* @param data
|
110 |
* base name
|
111 |
*/
|
112 |
public void setDBName(String dbName) { |
113 |
this.setDynValue(DBNAME_PARAMTER_NAME, dbName);
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* Set <code>user/code> parameter value
|
118 |
*
|
119 |
* @param user
|
120 |
*/
|
121 |
public void setUser(String user) { |
122 |
this.setDynValue(USER_PARAMTER_NAME, user);
|
123 |
} |
124 |
|
125 |
/**
|
126 |
* Set <code>password/code> parameter value
|
127 |
*
|
128 |
* @param password
|
129 |
*/
|
130 |
public void setPassword(String password) { |
131 |
this.setDynValue(PASSWORD_PARAMTER_NAME, password);
|
132 |
} |
133 |
|
134 |
} |