svn-gvsig-desktop / trunk / libraries / libRemoteServices / src / org / gvsig / remoteClient / driver / RemoteServiceDriver.java @ 2992
History | View | Annotate | Download (3.59 KB)
1 | 2988 | luisw2 | /* 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 org.gvsig.remoteClient.driver; |
||
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 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 | */
|
||
117 | public void setHost(String hostName) { |
||
118 | this.hostName = hostName;
|
||
119 | } |
||
120 | |||
121 | /**
|
||
122 | * Returns the port number it is being use for connect.
|
||
123 | *
|
||
124 | * Devuelve el puerto al que se ha conectado.
|
||
125 | */
|
||
126 | public int getPort() { |
||
127 | return portName;
|
||
128 | } |
||
129 | |||
130 | |||
131 | /**
|
||
132 | * Sets the service connection port.
|
||
133 | *
|
||
134 | * Establece el puerto de conexi?n para el servicio.
|
||
135 | */
|
||
136 | public void setPort(int portName) { |
||
137 | this.portName = portName;
|
||
138 | } |
||
139 | |||
140 | /**
|
||
141 | * Sets the connected flag.
|
||
142 | *
|
||
143 | * Establece el flag de "conectado".
|
||
144 | * @param connected
|
||
145 | */
|
||
146 | public void setConnected(boolean connected) { |
||
147 | this.connected = connected;
|
||
148 | } |
||
149 | } |