Statistics
| Revision:

root / trunk / extensions / extWCS / src / com / iver / cit / gvsig / fmap / drivers / RemoteServiceDriver.java @ 4356

History | View | Annotate | Download (3.64 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*
19
* For more information, contact:
20
*
21
*  Generalitat Valenciana
22
*   Conselleria d'Infraestructures i Transport
23
*   Av. Blasco Ib??ez, 50
24
*   46010 VALENCIA
25
*   SPAIN
26
*
27
*      +34 963862235
28
*   gvsig@gva.es
29
*      www.gvsig.gva.es
30
*
31
*    or
32
*
33
*   IVER T.I. S.A
34
*   Salamanca 50
35
*   46005 Valencia
36
*   Spain
37
*
38
*   +34 963163400
39
*   dac@iver.es
40
*/
41
package com.iver.cit.gvsig.fmap.drivers;
42

    
43
import java.io.IOException;
44

    
45
import com.hardcode.driverManager.Driver;
46
import com.iver.cit.gvsig.fmap.DriverException;
47
import com.iver.cit.gvsig.fmap.services.RemoteService;
48

    
49
/**
50
 * 
51
 * @author jaume
52
 */
53
public abstract class RemoteServiceDriver implements Driver, RemoteService {
54
        private String serviceName;
55
        private String hostName;
56
        private int portName;
57
        private boolean connected = false;
58
        /* (non-Javadoc)
59
         * @see com.iver.cit.gvsig.fmap.services.RemoteService#setServiceName(java.lang.String)
60
         */
61
        public void setServiceName(String name) {
62
                serviceName = name;
63
        }
64

    
65
        /**
66
         * Name of the remote service that we are accessing at. (WCS, WMS, ...)
67
         * 
68
         * Nombre del servicio remoto al que se accede (WCS, WMS, ...)
69
         * @return String
70
         */
71
        public String getServiceName() {
72
                return serviceName;
73
        }
74

    
75
        /**
76
         * Establishes the connection to the remote server.
77
         * 
78
         * Establece la conexi?n con el servidor remoto.
79
         */
80
        public abstract void connect() throws IOException, DriverException;
81

    
82
        /**
83
         * You're right. It tells you if you are connected or not.
84
         * 
85
         * True si se la conexi?n est? establecida, false si no.
86
         * @return boolean
87
         */
88
        public boolean isConnected() {
89
                return connected;
90
        }
91

    
92
        /**
93
         * Closes the connection to the remote service. Most of the cases this is not
94
         * needed since they are non-session-oriented protocols. 
95
         * Read the specific service notes for more information.
96
         * 
97
         * Cierra la conexi?n con el servicio remoto. En la mayor parte de los casos
98
         * no se necesita ya que suelen ser protocolos no orientados a sesi?n.
99
         * Lea las notas espec?ficas del servicio para m?s informaci?n.
100
         */
101
        public abstract void close();
102
        
103
        /**
104
         * Obtains the host name.
105
         * 
106
         * Devuelve el nombre del host.
107
         */
108
        public String getHost() {
109
                return hostName;
110
        }
111
        
112
        /**
113
         * Sets the host name.
114
         * 
115
         * Establece el nombre del host.
116
         * @throws IOException 
117
         */
118
        public void setHost(String hostName) throws IOException {
119
                this.hostName = hostName;
120
        }
121

    
122
        /**
123
         * Returns the port number it is being use for connect.
124
         * 
125
         * Devuelve el puerto al que se ha conectado.
126
         */
127
        public int getPort() {
128
                return portName;
129
        }
130
        
131

    
132
        /**
133
         * Sets the service connection port.
134
         * 
135
         * Establece el puerto de conexi?n para el servicio.
136
         */
137
        public void setPort(int portName) {
138
                this.portName = portName;
139
        }
140
        
141
        /**
142
         * Sets the connected flag.
143
         * 
144
         * Establece el flag de "conectado".
145
         * @param connected
146
         */
147
        public void setConnected(boolean connected) {
148
                this.connected = connected;
149
        }
150
}