Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libRemoteServices / src / org / gvsig / remoteclient / wfs / request / WFSRequest.java @ 33983

History | View | Annotate | Download (2.61 KB)

1
package org.gvsig.remoteclient.wfs.request;
2

    
3
import java.io.File;
4
import java.io.IOException;
5
import java.net.ConnectException;
6
import java.net.UnknownHostException;
7

    
8
import org.gvsig.compat.net.ICancellable;
9
import org.gvsig.remoteclient.ogc.request.OGCRequest;
10
import org.gvsig.remoteclient.wfs.WFSProtocolHandler;
11
import org.gvsig.remoteclient.wfs.WFSRequestInformation;
12
import org.gvsig.remoteclient.wfs.WFSStatus;
13

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