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