public abstract class WMSProtocolHandler extends OGCProtocolHandler
Abstract class that represents handlers to comunicate via WMS protocol.
Modifier and Type | Field and Description |
---|---|
protected String |
encoding
Encoding used to parse different xml documents.
|
TreeMap |
layers |
WMSLayer |
rootLayer |
protected WMSServiceInformation |
serviceInfo
WMS metadata
|
downloader, host, name, port, version
Constructor and Description |
---|
WMSProtocolHandler() |
Modifier and Type | Method and Description |
---|---|
byte[] |
_getMap(WMSStatus status)
Builds a GetMap request that is sent to the WMS
the response (image) will be redirect to the
WMS client
|
static String |
buildCapabilitiesSuitableVersionRequest(String _host,
String _version)
Builds the GetCapabilitiesRequest according to the OGC WMS Specifications
without a VERSION, to get the highest version than a WMS supports.
|
void |
close() |
protected abstract WMSGetCapabilitiesRequest |
createGetCapabilitiesRequest(WMSStatus status) |
protected abstract WMSGetFeatureInfoRequest |
createGetFeatureInfoRequest(WMSStatus status,
int x,
int y) |
protected abstract WMSGetLegendGraphicRequest |
createGetLegendGraphicRequest(WMSStatus status,
String layerName) |
protected abstract WMSGetMapRequest |
createGetMapRequest(WMSStatus status) |
void |
getCapabilities(WMSStatus status,
boolean override,
ICancellable cancel)
Builds a GetCapabilities request that is sent to the WMS
the response will be parse to extract the data needed by the
WMS client
|
String |
getExceptionMessage(File f)
Returns the exception message if the file is a XML instead of a image.
|
String |
getFeatureInfo(WMSStatus status,
int x,
int y,
int featureCount,
ICancellable cancel)
It will send a GetFeatureInfo request to the WMS
Parsing the response and redirecting the info to the WMS client
TODO: return a stored file instead a String.
|
File |
getLegendGraphic_old(WMSStatus status,
String layerName,
ICancellable cancel) |
File |
getLegendGraphic(WMSStatus status,
String layerName,
ICancellable cancel) |
File |
getMap(WMSStatus status,
ICancellable cancel) |
URL |
getMapURL(WMSStatus status,
ICancellable cancel) |
String |
getName()
returns the alfanumeric information of the layers at the specified point.
|
OGCServiceInformation |
getServiceInformation() |
protected String |
parseException(byte[] data) |
protected void |
parseGetFeatureInfoTag(KXmlParser parser)
Parses the GetFeatureInfo tag
|
protected void |
parseGetLegendGraphicTag(KXmlParser parser)
Parses the GetLegendGraphic tag
|
protected void |
parseGetMapTag(KXmlParser parser)
Parses the GetMap tag
|
protected void |
parseRequestTag(KXmlParser parser)
Parses the Request tag
|
addOperationByAttribute, fileToBytes, getHost, getPort, getSymbol, getVersion, parseCapabilities, parseHTTPTag, parserDcpType, setHost, setName, setPort, setVersion
protected String encoding
protected WMSServiceInformation serviceInfo
public TreeMap layers
public WMSLayer rootLayer
public String getName()
getName
in class OGCProtocolHandler
public OGCServiceInformation getServiceInformation()
getServiceInformation
in class OGCProtocolHandler
public void getCapabilities(WMSStatus status, boolean override, ICancellable cancel)
Builds a GetCapabilities request that is sent to the WMS the response will be parse to extract the data needed by the WMS client
override,
- if true the previous downloaded data will be overriddenpublic String getFeatureInfo(WMSStatus status, int x, int y, int featureCount, ICancellable cancel)
It will send a GetFeatureInfo request to the WMS Parsing the response and redirecting the info to the WMS client
TODO: return a stored file instead a String.public byte[] _getMap(WMSStatus status) throws ServerErrorException, WMSException
Builds a GetMap request that is sent to the WMS the response (image) will be redirect to the WMS client
ServerErrorException
WMSException
public File getLegendGraphic_old(WMSStatus status, String layerName, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public File getLegendGraphic(WMSStatus status, String layerName, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public URL getMapURL(WMSStatus status, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public String getExceptionMessage(File f) throws IOException
file3
- IOException
public File getMap(WMSStatus status, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
protected String parseException(byte[] data)
public static String buildCapabilitiesSuitableVersionRequest(String _host, String _version)
public void close()
protected abstract WMSGetMapRequest createGetMapRequest(WMSStatus status)
status
- The WMS statusprotocolHandler
- The handler to parse the requestsprotected abstract WMSGetFeatureInfoRequest createGetFeatureInfoRequest(WMSStatus status, int x, int y)
protected abstract WMSGetLegendGraphicRequest createGetLegendGraphicRequest(WMSStatus status, String layerName)
protected abstract WMSGetCapabilitiesRequest createGetCapabilitiesRequest(WMSStatus status)
protected void parseRequestTag(KXmlParser parser) throws IOException, XmlPullParserException
Parses the Request tag
IOException
XmlPullParserException
protected void parseGetMapTag(KXmlParser parser) throws IOException, XmlPullParserException
Parses the GetMap tag
IOException
XmlPullParserException
protected void parseGetFeatureInfoTag(KXmlParser parser) throws IOException, XmlPullParserException
Parses the GetFeatureInfo tag
IOException
XmlPullParserException
protected void parseGetLegendGraphicTag(KXmlParser parser) throws IOException, XmlPullParserException
Parses the GetLegendGraphic tag
IOException
XmlPullParserException