Statistics
| Revision:

gvsig-raster / org.gvsig.raster.wcs / trunk / org.gvsig.raster.wcs / org.gvsig.raster.wcs.io / src / main / java / org / gvsig / raster / wcs / io / WCSServerExplorerParameters.java @ 859

History | View | Annotate | Download (3.29 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
* 2009 IVER T.I   {{Task}}
26
*/
27

    
28
package org.gvsig.raster.wcs.io;
29

    
30
import org.gvsig.fmap.dal.DataServerExplorerParameters;
31
import org.gvsig.fmap.dal.spi.AbstractDataParameters;
32
import org.gvsig.tools.ToolsLocator;
33
import org.gvsig.tools.dynobject.DelegatedDynObject;
34
import org.gvsig.tools.dynobject.DynClass;
35
import org.gvsig.tools.dynobject.DynField;
36
import org.gvsig.tools.dynobject.DynObjectManager;
37

    
38
/**
39
 * Parameters for the WCS provider
40
 * @author Nacho Brodin (nachobrodin@gmail.com)
41
 */
42
public class WCSServerExplorerParameters extends AbstractDataParameters implements DataServerExplorerParameters {
43
        public static final String     DYNCLASS_NAME    = "WCSServerExplorerParameters";
44
        protected static final String  FIELD_HOST          = "host";
45
        protected static DynClass      DYNCLASS            = null;
46
        private DelegatedDynObject     delegatedDynObject  = null;
47
        
48
        public WCSServerExplorerParameters() {
49
                super();
50
                initialize();
51
        }
52

    
53
        protected void initialize() {
54
                this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
55
                                .getDynObjectManager().createDynObject(
56
                                                DYNCLASS);
57
        }
58
        
59
        @SuppressWarnings("deprecation")
60
        public static void registerDynClass() {
61
                DynObjectManager dynman = ToolsLocator.getDynObjectManager();
62
                DynClass dynClass;
63
                DynField field;
64
                
65
                if(dynman == null)
66
                        return;
67
                
68
                if (DYNCLASS == null) {
69
                        dynClass = dynman.add(DYNCLASS_NAME);
70

    
71
                        field = dynClass.addDynField(FIELD_HOST);
72
                        field.setTheTypeOfAvailableValues(DynField.ANY);
73
                        field.setDescription("Uniform Resource Identifier (File name or URL)");
74
                        field.setType(org.gvsig.tools.dataTypes.DataTypes.STRING);
75
                        field.setMandatory(true);
76

    
77
                        DYNCLASS = dynClass;
78
                }
79

    
80
        }
81
        
82
        protected DelegatedDynObject getDelegatedDynObject() {
83
                return delegatedDynObject;
84
        }
85
        
86
        /**
87
         * Gets the assigned host
88
         * @return
89
         */
90
        public String getHost() {
91
                return (String) this.getDynValue(FIELD_HOST);
92
        }
93

    
94
        /**
95
         * Assign the host to this explorer
96
         * @param host
97
         */
98
        public void setHost(String host) {
99
                this.setDynValue(FIELD_HOST, host);
100
        }
101

    
102
        /*
103
         * (non-Javadoc)
104
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDataStoreName()
105
         */
106
        public String getDataStoreName() {
107
                return WCSProvider.NAME;
108
        }
109
        
110
        /*
111
         * (non-Javadoc)
112
         * @see org.gvsig.fmap.dal.DataStoreParameters#getDescription()
113
         */
114
        public String getDescription() {
115
                return WCSProvider.DESCRIPTION;
116
        }
117

    
118
        public String getExplorerName() {
119
                return WCSServerExplorer.NAME;
120
        }
121
}