Revision 41301 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.remoteclient/src/main/java/org/gvsig/remoteclient/wfs/WFSClient.java
WFSClient.java | ||
---|---|---|
33 | 33 |
import org.gvsig.compat.net.ICancellable; |
34 | 34 |
import org.gvsig.remoteclient.RemoteClient; |
35 | 35 |
import org.gvsig.remoteclient.wfs.exceptions.WFSException; |
36 |
import org.slf4j.Logger; |
|
37 |
import org.slf4j.LoggerFactory; |
|
36 | 38 |
|
37 | 39 |
/** |
38 | 40 |
* Represents the class the with the necessary logic to connect to a |
... | ... | |
41 | 43 |
*/ |
42 | 44 |
public class WFSClient extends RemoteClient{ |
43 | 45 |
|
46 |
private static Logger logger = LoggerFactory.getLogger(WFSClient.class); |
|
47 |
|
|
44 | 48 |
private WFSProtocolHandler handler; |
45 | 49 |
|
46 | 50 |
//private Logger LOG = LoggerFactory.getLogger(WFSClient.class); |
... | ... | |
66 | 70 |
try { |
67 | 71 |
handler = WFSProtocolHandlerFactory.negotiate(host); |
68 | 72 |
} catch(ConnectException conE) { |
69 |
conE.printStackTrace();
|
|
73 |
logger.warn("Can'r negotiate version for the host '"+host+"'.",conE);
|
|
70 | 74 |
throw conE; |
71 | 75 |
} catch(IOException ioE) { |
72 |
ioE.printStackTrace();
|
|
76 |
logger.warn("Can'r negotiate version for the host '"+host+"'.",ioE);
|
|
73 | 77 |
throw ioE; |
74 | 78 |
} catch(Exception e) { |
75 |
e.printStackTrace();
|
|
79 |
logger.warn("Can'r negotiate version for the host '"+host+"'.",e);
|
|
76 | 80 |
} |
77 | 81 |
}else{ |
78 | 82 |
handler = WFSProtocolHandlerFactory.createVersionDriver(version); |
79 | 83 |
} |
80 | 84 |
|
81 | 85 |
if (handler == null){ |
86 |
logger.warn("Unsupported version '"+version+"' for host '"+host+"'."); |
|
82 | 87 |
throw new UnsupportedOperationException("Unsupported version"); |
83 | 88 |
} |
84 | 89 |
handler.setHost(host); |
... | ... | |
204 | 209 |
return true; |
205 | 210 |
|
206 | 211 |
} catch (Exception e) { |
207 |
e.printStackTrace();
|
|
212 |
logger.warn("Can't connect to host '"+this.hostName+"'.",e);
|
|
208 | 213 |
return false; |
209 | 214 |
} |
210 | 215 |
} |
Also available in: Unified diff