final String version = getValue("VERSION");
if (null == version) {
// spec allows to use custom exception codes, so we'll use
// NoVersionInfo here. No need to define it as a DTD extension
// though
throw new WmsException("Version parameter not provided for DescribeLayer operation",
"NoVersionInfo", getClass().getSimpleName());
}
if (!wms.getVersion().equals(version)) {
// spec allows to use custom exception codes, so we'll use
// InvalidVersion here. No need to define it as a DTD extension
// though
throw new WmsException("Wrong value for version parameter: " + version
+ ". This server accetps version " + getWMS().getVersion(), "InvalidVersion",
getClass().getSimpleName());
}
req.setVersion(version);
String layersParam = getValue("LAYERS");
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(layersParam);
}
List<String> layers = readFlat(layersParam, INNER_DELIMETER);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(layers.toString());
}
int layerCount = layers.size();
if (layerCount == 0) {
throw new WmsException("No LAYERS has been requested", "NoLayerRequested", getClass()
.getName());
}
String layerName = null;
MapLayerInfo layer = null;
for (int i = 0; i < layerCount; i++) {
layerName = (String) layers.get(i);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine(new StringBuffer("Looking for layer ").append(layerName).toString());
}
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("looking featuretypeinfos");
}
LayerInfo layerInfo = wms.getLayerByName(layerName);
if (layerInfo == null) {
throw new WmsException(layerName + ": no such layer on this server",
"LayerNotDefined", getClass().getSimpleName());
}
layer = new MapLayerInfo(layerInfo);
req.addLayer(layer);
if (LOGGER.isLoggable(Level.FINE)) {