Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_daldb / src / org / gvsig / fmap / dal / serverexplorer / db / DBServerExplorerParameters.java @ 26426

History | View | Annotate | Download (3.21 KB)

1
package org.gvsig.fmap.dal.serverexplorer.db;
2

    
3
import org.gvsig.fmap.dal.DataServerExplorerParameters;
4
import org.gvsig.fmap.dal.DataTypes;
5
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
6
import org.gvsig.tools.ToolsLocator;
7
import org.gvsig.tools.dynobject.DelegatedDynObject;
8
import org.gvsig.tools.dynobject.DynClass;
9
import org.gvsig.tools.dynobject.DynField;
10
import org.gvsig.tools.dynobject.DynObjectManager;
11

    
12
public class DBServerExplorerParameters extends AbstractDataParameters
13
                implements DataServerExplorerParameters {
14

    
15
        public static final String DYNCLASS_NAME = "DBServerExplorerParameters";
16

    
17
        public DBServerExplorerParameters() {
18
                this.delegatedDynObjet = (DelegatedDynObject) ToolsLocator
19
                                .getDynObjectManager()
20
                                .createDynObject(this.registerDynClass());
21
        }
22

    
23
        private DynClass registerDynClass() {
24
                   DynObjectManager dynman = ToolsLocator.getDynObjectManager();
25
            DynClass dynClass = dynman.get(DYNCLASS_NAME);
26
            DynField field;
27
            if (dynClass == null) {
28
                    dynClass = dynman.add(DYNCLASS_NAME);
29

    
30
                    field = dynClass.addDynField("db");
31
                    field.setTheTypeOfAvailableValues(DataTypes.STRING);
32
                    field.setDescription("Data base name");
33
                    field.setType(DynField.SINGLE);
34

    
35
                    field = dynClass.addDynField("host");
36
                        field.setTheTypeOfAvailableValues(DataTypes.STRING);
37
                        field.setDescription("Url to host");
38
                        field.setType(DynField.SINGLE);
39

    
40
                    field = dynClass.addDynField("port");
41
                        field.setTheTypeOfAvailableValues(DataTypes.INT);
42
                        field.setDescription("Server port");
43
                        field.setType(DynField.SINGLE);
44

    
45
                    field = dynClass.addDynField("user");
46
                        field.setTheTypeOfAvailableValues(DataTypes.STRING);
47
                        field.setDescription("User name");
48
                        field.setType(DynField.SINGLE);
49

    
50
                        field = dynClass.addDynField("schema");
51
                        field.setTheTypeOfAvailableValues(DataTypes.STRING);
52
                        field.setDescription("Schema name");
53
                        field.setType(DynField.SINGLE);
54

    
55
                        field = dynClass.addDynField("password");
56
                        field.setTheTypeOfAvailableValues(DataTypes.STRING);
57
                        field.setDescription("Password"); //???
58
                        field.setType(DynField.SINGLE);
59

    
60

    
61
            }
62
            return dynClass;
63
        }
64

    
65
        public String getDb() {
66
                return (String) this.getDynValue("db");
67
        }
68

    
69
        public void setDb(String db) {
70
                this.setDynValue("db", db);
71
        }
72

    
73
        public String getHost() {
74
                return (String) this.getDynValue("host");
75
        }
76

    
77
        public void setHost(String host) {
78
                this.setDynValue("host", host);
79
        }
80

    
81
        public String getPort() {
82
                return (String) this.getDynValue("port");
83
        }
84

    
85
        public void setPort(String port) {
86
                this.setDynValue("port", port);
87
        }
88

    
89
        public String getSchema() {
90
                return (String) this.getDynValue("schema");
91
        }
92

    
93
        public void setSchema(String schema) {
94
                this.setDynValue("schema", schema);
95
        }
96

    
97
        public String getPassw() {
98
                return (String) this.getDynValue("passw");
99
        }
100

    
101
        public void setPassw(String passw) {
102
                this.setDynValue("passw", passw);
103
        }
104

    
105
        public String getUser() {
106
                return (String) this.getDynValue("user");
107
        }
108

    
109
        public void setUser(String user) {
110
                this.setDynValue("user", user);
111
        }
112

    
113
        public String getCatalog() {
114
                return (String) this.getDynValue("catalog");
115
        }
116

    
117
        public void setCatalog(String catalog) {
118
                this.setDynValue("catalog", catalog);
119
        }
120

    
121
        public String getExplorerName() {
122
                return DBServerExplorer.NAME;
123
        }
124

    
125
}