svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.remoteclient / src / main / java / org / gvsig / remoteclient / wfs / request / WFSRequest.java @ 40559
History | View | Annotate | Download (3.55 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.request; |
25 |
|
26 |
import java.io.File; |
27 |
import java.io.IOException; |
28 |
import java.net.ConnectException; |
29 |
import java.net.UnknownHostException; |
30 |
|
31 |
import org.gvsig.compat.net.ICancellable; |
32 |
import org.gvsig.remoteclient.ogc.request.OGCRequest; |
33 |
import org.gvsig.remoteclient.wfs.WFSProtocolHandler; |
34 |
import org.gvsig.remoteclient.wfs.WFSRequestInformation; |
35 |
import org.gvsig.remoteclient.wfs.WFSStatus; |
36 |
|
37 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
38 |
*
|
39 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
40 |
*
|
41 |
* This program is free software; you can redistribute it and/or
|
42 |
* modify it under the terms of the GNU General Public License
|
43 |
* as published by the Free Software Foundation; either version 2
|
44 |
* of the License, or (at your option) any later version.
|
45 |
*
|
46 |
* This program is distributed in the hope that it will be useful,
|
47 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
48 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
49 |
* GNU General Public License for more details.
|
50 |
*
|
51 |
* You should have received a copy of the GNU General Public License
|
52 |
* along with this program; if not, write to the Free Software
|
53 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
54 |
*
|
55 |
* For more information, contact:
|
56 |
*
|
57 |
* Generalitat Valenciana
|
58 |
* Conselleria d'Infraestructures i Transport
|
59 |
* Av. Blasco Ib??ez, 50
|
60 |
* 46010 VALENCIA
|
61 |
* SPAIN
|
62 |
*
|
63 |
* +34 963862235
|
64 |
* gvsig@gva.es
|
65 |
* www.gvsig.gva.es
|
66 |
*
|
67 |
* or
|
68 |
*
|
69 |
* IVER T.I. S.A
|
70 |
* Salamanca 50
|
71 |
* 46005 Valencia
|
72 |
* Spain
|
73 |
*
|
74 |
* +34 963163400
|
75 |
* dac@iver.es
|
76 |
*/
|
77 |
/* CVS MESSAGES:
|
78 |
*
|
79 |
* $Id$
|
80 |
* $Log$
|
81 |
*
|
82 |
*/
|
83 |
/**
|
84 |
* This class sends a WFS request and returns the
|
85 |
* reply in a local File. It tries if the server
|
86 |
* supports both HTTP Get and Post requests.
|
87 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es)
|
88 |
*/
|
89 |
public abstract class WFSRequest extends OGCRequest{ |
90 |
protected WFSStatus status = null; |
91 |
|
92 |
public WFSRequest(WFSStatus status, WFSProtocolHandler protocolHandler) {
|
93 |
super(status, protocolHandler);
|
94 |
this.status = status;
|
95 |
} |
96 |
|
97 |
/*
|
98 |
* (non-Javadoc)
|
99 |
* @see org.gvsig.remoteclient.ogc.request.OGCRequest#sendRequest()
|
100 |
*/
|
101 |
public File sendRequest(ICancellable cancel) throws ConnectException, UnknownHostException, |
102 |
IOException {
|
103 |
if (status != null){ |
104 |
((WFSProtocolHandler)protocolHandler).addLastWfsRequestInformation(createRequestInformation()); |
105 |
} |
106 |
return super.sendRequest(cancel); |
107 |
} |
108 |
|
109 |
/**
|
110 |
* Creates a request information
|
111 |
* @return a request information
|
112 |
*/
|
113 |
public WFSRequestInformation createRequestInformation(){
|
114 |
return new WFSRequestInformation(); |
115 |
} |
116 |
} |