Revision 32367 branches/v2_0_0_prep/libraries/org.gvsig.arcims/src/org/gvsig/remoteclient/arcims/ArcImsProtocolHandler.java

View differences:

ArcImsProtocolHandler.java
52 52
import org.gvsig.fmap.geom.Geometry;
53 53
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
54 54
import org.gvsig.remoteclient.arcims.exceptions.ArcImsException;
55
import org.gvsig.remoteclient.arcims.styling.renderers.ArcImsFLegendFactory;
56 55
import org.gvsig.remoteclient.arcims.styling.renderers.ArcImsRendererFactory;
57 56
import org.gvsig.remoteclient.arcims.styling.renderers.Renderer;
58 57
import org.gvsig.remoteclient.arcims.utils.ArcImsDownloadUtils;
......
66 65
import org.gvsig.remoteclient.arcims.utils.ServiceInformationLayerImage;
67 66
import org.gvsig.remoteclient.utils.BoundaryBox;
68 67
import org.kxml2.io.KXmlParser;
69
import org.xmlpull.v1.XmlPullParserException;
70 68
import org.slf4j.Logger;
71 69
import org.slf4j.LoggerFactory;
70
import org.xmlpull.v1.XmlPullParserException;
72 71

  
73 72
/**
74 73
 * Abstract class that represents handlers to comunicate via ArcIms protocol
75 74
 * 
76 75
 * @author jsanz
77 76
 * @author jcarrasco
77
 * @author vsanjaime version 2.0
78 78
 * 
79 79
 */
80 80
public abstract class ArcImsProtocolHandler {
81

  
81 82
	public static final double INCHES = .02540005;
82
	private static Logger logger = LoggerFactory.getLogger(ArcImsProtocolHandler.class
83
			.getName());
83
	private static Logger logger = LoggerFactory
84
			.getLogger(ArcImsProtocolHandler.class.getName());
84 85

  
85 86
	/**
86 87
	 * Protocol handler name
87 88
	 */
88
	protected String name;
89
	private String name;
89 90

  
90 91
	/**
91 92
	 * protocol handler version
92 93
	 */
93
	protected String version;
94
	private String version;
94 95

  
95 96
	/**
96 97
	 * host of the ArcIms to connect
97 98
	 */
98
	protected String host;
99
	private String host;
99 100

  
100 101
	/**
101 102
	 * port number of the comunication channel of the ArcIms to connect
102 103
	 */
103
	protected String port;
104
	protected String service;
104
	private String port;
105
	private String service;
105 106

  
106 107
	/**
107
	 * ArcIms metadata
108
	 * ArcIms metadata (list of services availables)
108 109
	 */
109
	protected ServiceInformation serviceInfo;
110
	public TreeMap layers;	
111
	public Vector srs;
110
	private ServiceInformation serviceInfo;
112 111

  
113 112
	/**
113
	 * Layers
114
	 */
115
	public TreeMap layers;
116
	public Vector<String> srs;
117

  
118
	/**
114 119
	 * Constructor
115 120
	 */
116 121
	public ArcImsProtocolHandler() {
......
189 194
					tag = kxmlParser.next();
190 195
				}
191 196

  
192
				kxmlParser.require(KXmlParser.END_DOCUMENT, null, null);				
197
				kxmlParser.require(KXmlParser.END_DOCUMENT, null, null);
193 198
			}
194 199
		} catch (XmlPullParserException parser_ex) {
195 200
			logger.error("Parser error", parser_ex);
......
220 225
					throw new ArcImsException("arcims_decimal_error");
221 226
				}
222 227
			}
223
			
228

  
224 229
		} finally {
225 230
		}
226 231

  
......
953 958
	public abstract String getElementInfo(ArcImsStatus status, int x, int y,
954 959
			int featureCount) throws ArcImsException;
955 960

  
961
	/**
962
	 * get Sevice Name
963
	 * 
964
	 * @return
965
	 */
956 966
	public String getName() {
957 967
		return name;
958 968
	}
959 969

  
970
	/**
971
	 * get service version
972
	 * 
973
	 * @return
974
	 */
960 975
	public String getVersion() {
961 976
		return version;
962 977
	}
963 978

  
979
	/**
980
	 * Get service information (services availables)
981
	 * 
982
	 * @return
983
	 */
964 984
	public ServiceInformation getServiceInformation() {
965 985
		return this.serviceInfo;
966 986
	}
967 987

  
988
	/**
989
	 * Get Host
990
	 * 
991
	 * @return
992
	 */
968 993
	public String getHost() {
969 994
		return host;
970 995
	}
971 996

  
997
	/**
998
	 * get Port
999
	 * 
1000
	 * @return
1001
	 */
1002
	public String getPort() {
1003
		return port;
1004
	}
1005

  
1006
	/**
1007
	 * Set host
1008
	 * 
1009
	 * @param _host
1010
	 */
972 1011
	public void setHost(String _host) {
973 1012
		host = _host;
974 1013
	}
975 1014

  
976
	public String getPort() {
977
		return port;
978
	}
979

  
1015
	/**
1016
	 * Set Port
1017
	 * 
1018
	 * @param _port
1019
	 */
980 1020
	public void setPort(String _port) {
981 1021
		port = _port;
982 1022
	}
......
1022 1062
			service = getService();
1023 1063
		} else {
1024 1064
			onlineResource = status.getOnlineResource();
1025
			service = status.getService();
1065
			service = status.getServiceName();
1026 1066
		}
1027 1067

  
1028 1068
		// String symbol = getSymbol(onlineResource);
......
1056 1096
			service = getService();
1057 1097
		} else {
1058 1098
			onlineResource = status.getOnlineResource();
1059
			service = status.getService();
1099
			service = status.getServiceName();
1060 1100
		}
1061 1101

  
1062 1102
		// String symbol = getSymbol(onlineResource);
......
1099 1139
	 */
1100 1140
	public static List<List<String>> getCatalog(URL url, boolean override)
1101 1141
			throws ArcImsException {
1102
		// if (!ArcImsProtocolHandler.getPing(url)){
1103
		// throw new ArcImsException("arcims_no_server");
1104
		// }
1142

  
1105 1143
		List<List<String>> services = new ArrayList<List<String>>();
1106 1144

  
1107 1145
		try {
......
1143 1181
	 * @return ArrayList of ArrayLists with name, type and status
1144 1182
	 * @throws ArcImsException
1145 1183
	 */
1146
	private static List<List<String>> parseClientServices(File f) throws ArcImsException {
1184
	private static List<List<String>> parseClientServices(File f)
1185
			throws ArcImsException {
1147 1186
		List<List<String>> services = new ArrayList<List<String>>();
1148 1187
		List<String> service;
1149 1188

  
......
1404 1443
	 * @throws ArcImsException
1405 1444
	 */
1406 1445
	public ILegend getLegend(String layerId) throws ArcImsException {
1407
		ArcImsFLegendFactory aiff = new ArcImsFLegendFactory(this.serviceInfo,
1408
				layerId);
1446
		// TODO arreglar la simbologia
1447
		// ArcImsFLegendFactory aiff = new
1448
		// ArcImsFLegendFactory(this.serviceInfo,
1449
		// layerId);
1450
		//
1451
		// return aiff.getMainLegend();
1452
		return null;
1453
	}
1409 1454

  
1410
		return aiff.getMainLegend();
1411
	}
1412 1455
}

Also available in: Unified diff