Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wfs / WFSServiceInformation.java @ 40769

History | View | Annotate | Download (4.3 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.remoteclient.wfs;
25

    
26
import java.util.HashMap;
27
import java.util.Iterator;
28
import java.util.Vector;
29

    
30
import org.gvsig.remoteclient.ogc.OGCClientOperation;
31
import org.gvsig.remoteclient.ogc.OGCServiceInformation;
32

    
33
/**
34
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
35
 */
36
public class WFSServiceInformation extends OGCServiceInformation{
37
        public String version;
38
        public String name;
39
        public String scope;
40
        public String title;
41
        public String abstr;
42
        public String keywords;
43
        public String fees;
44
        public String operationsInfo;
45
        public String personname;
46
        public String organization;
47
        public String function;
48
        public String addresstype;
49
        public String address;
50
        public String place;
51
        public String province;
52
        public String postcode;
53
        public String country;
54
        public String phone;
55
        public String fax;
56
        public String email;
57
        public Vector formats;
58
        private HashMap operationsGet; 
59
        private HashMap operationsPost; 
60
        private HashMap namespaces;
61
        private int maxFeatures = -1;
62

    
63
    public WFSServiceInformation() {          
64
                clear();     
65
        }
66

    
67
        public void clear() {
68
                version = new String();
69
                name = new String();
70
                scope = new String();
71
                title = new String();
72
                abstr = new String();
73
                keywords = new String();
74
                fees = new String();
75
                operationsInfo = new String();
76
                personname = new String();
77
                organization = new String();
78
                function = new String();
79
                addresstype = new String();
80
                address = new String();
81
                place = new String();
82
                province = new String();
83
                postcode = new String();
84
                country = new String();
85
                phone = new String();
86
                fax = new String();
87
                email = new String();
88
                formats = new Vector();               
89
                operationsGet = new HashMap();  
90
                operationsPost = new HashMap();   
91
                namespaces = new HashMap();
92
        }
93
        
94
        /**
95
         * Adds a new namespace
96
         * @param namespacePrefix
97
         * Namespace prefix
98
         * @param namespaceURI
99
         * Namespace URI
100
         */
101
        public void addNamespace(String namespacePrefix, String namespaceURI){
102
                namespaces.put(namespacePrefix, namespaceURI);
103
        }
104
        
105
        /**
106
         * Gest a namespace URI
107
         * @param namespaceprefix
108
         * Namespace prefix
109
         * @return
110
         * The namespace URI
111
         */
112
        public String getNamespace(String namespaceprefix){
113
                if (namespaces.containsKey(namespaceprefix)){
114
                        return (String)namespaces.get(namespaceprefix);
115
                }
116
                return null;
117
        }
118
        
119
        public String getNamespacePrefix(String namespace){
120
        if (namespace == null){
121
            return null;
122
        }
123
            Iterator it = namespaces.keySet().iterator();
124
        while (it.hasNext()){
125
            String prefix = (String)it.next();
126
            if (namespace.equals(namespaces.get(prefix))){
127
                return prefix;
128
            }
129
        }
130
        return null;
131
    }
132

    
133
        /* (non-Javadoc)
134
         * @see org.gvsig.remoteClient.ogc.OGCServiceInformation#createOperation(java.lang.String)
135
         */        
136
        public OGCClientOperation createOperation(String name) {
137
                return new WFSOperation(name); 
138
        }
139

    
140
        /* (non-Javadoc)
141
         * @see org.gvsig.remoteClient.ogc.OGCServiceInformation#createOperation(java.lang.String, java.lang.String)
142
         */        
143
        public OGCClientOperation createOperation(String name, String onlineResource) {
144
                return new WFSOperation(name, onlineResource);
145
        }        
146
        
147
   
148
    
149
    /**
150
     * @return the maxFeatures
151
     */
152
    public int getMaxFeatures() {
153
        return maxFeatures;
154
    }
155

    
156
    
157
    /**
158
     * @param maxFeatures the maxFeatures to set
159
     */
160
    public void setMaxFeatures(int maxFeatures) {
161
        this.maxFeatures = maxFeatures;
162
    }
163
}
164