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 @ 40559
History | View | Annotate | Download (3.61 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 |
/*
|
25 |
* AUTHORS (In addition to CIT):
|
26 |
* 2008 IVER T.I. S.A. {{Task}}
|
27 |
*/
|
28 |
package org.gvsig.fmap.dal.serverexplorer.db; |
29 |
|
30 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
31 |
import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
32 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
33 |
import org.gvsig.fmap.dal.store.db.DBHelper; |
34 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
35 |
|
36 |
/**
|
37 |
* Abstract class of {@link DataServerExplorerParameters} for Data Base type
|
38 |
* server
|
39 |
*
|
40 |
* @author jmvivo
|
41 |
*
|
42 |
*/
|
43 |
public abstract class DBServerExplorerParameters extends AbstractDataParameters |
44 |
implements DataServerExplorerParameters, DBConnectionParameter {
|
45 |
|
46 |
public static final String PARAMETERS_DEFINITION_NAME = "DBServerExplorerParameters"; |
47 |
|
48 |
private DelegatedDynObject parameters;
|
49 |
|
50 |
public DBServerExplorerParameters(String parametersDefinitionName, String explorerName) { |
51 |
this.parameters = (DelegatedDynObject) DBHelper.newParameters(parametersDefinitionName);
|
52 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, explorerName);
|
53 |
} |
54 |
|
55 |
public String getExplorerName() { |
56 |
return (String) this.getDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME); |
57 |
} |
58 |
|
59 |
protected DelegatedDynObject getDelegatedDynObject() {
|
60 |
return parameters;
|
61 |
} |
62 |
|
63 |
public String getHost() { |
64 |
return (String) this.getDynValue(HOST_PARAMTER_NAME); |
65 |
} |
66 |
|
67 |
public Integer getPort() { |
68 |
return (Integer) this.getDynValue(PORT_PARAMTER_NAME); |
69 |
} |
70 |
|
71 |
public String getDBName() { |
72 |
return (String) this.getDynValue(DBNAME_PARAMTER_NAME); |
73 |
} |
74 |
|
75 |
public String getUser() { |
76 |
return (String) this.getDynValue(USER_PARAMTER_NAME); |
77 |
} |
78 |
|
79 |
public String getPassword() { |
80 |
return (String) this.getDynValue(PASSWORD_PARAMTER_NAME); |
81 |
} |
82 |
|
83 |
/**
|
84 |
* Set <code>host</code> parameter value
|
85 |
*
|
86 |
* @param host
|
87 |
*/
|
88 |
public void setHost(String host) { |
89 |
this.setDynValue(HOST_PARAMTER_NAME, host);
|
90 |
} |
91 |
|
92 |
/**
|
93 |
* Set <code>port/code> parameter value
|
94 |
*
|
95 |
* @param port
|
96 |
*/
|
97 |
public void setPort(int port) { |
98 |
this.setDynValue(PORT_PARAMTER_NAME, new Integer(port)); |
99 |
} |
100 |
|
101 |
/**
|
102 |
* Set <code>port/code> parameter value
|
103 |
*
|
104 |
* @param port
|
105 |
*/
|
106 |
public void setPort(Integer port) { |
107 |
this.setDynValue(PORT_PARAMTER_NAME, port);
|
108 |
} |
109 |
|
110 |
/**
|
111 |
* Set <code>data base name/code> parameter value
|
112 |
*
|
113 |
* @param data
|
114 |
* base name
|
115 |
*/
|
116 |
public void setDBName(String dbName) { |
117 |
this.setDynValue(DBNAME_PARAMTER_NAME, dbName);
|
118 |
} |
119 |
|
120 |
/**
|
121 |
* Set <code>user/code> parameter value
|
122 |
*
|
123 |
* @param user
|
124 |
*/
|
125 |
public void setUser(String user) { |
126 |
this.setDynValue(USER_PARAMTER_NAME, user);
|
127 |
} |
128 |
|
129 |
/**
|
130 |
* Set <code>password/code> parameter value
|
131 |
*
|
132 |
* @param password
|
133 |
*/
|
134 |
public void setPassword(String password) { |
135 |
this.setDynValue(PASSWORD_PARAMTER_NAME, password);
|
136 |
} |
137 |
|
138 |
} |