public abstract class WMSProtocolHandler extends OGCProtocolHandler
Abstract class that represents handlers to comunicate via WMS protocol.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
encoding
Encoding used to parse different xml documents.
|
java.util.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 java.lang.String |
buildCapabilitiesSuitableVersionRequest(java.lang.String _host,
java.lang.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,
java.lang.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
|
java.lang.String |
getExceptionMessage(java.io.File f)
Returns the exception message if the file is a XML instead of a image.
|
java.lang.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.
|
java.io.File |
getLegendGraphic_old(WMSStatus status,
java.lang.String layerName,
ICancellable cancel) |
java.io.File |
getLegendGraphic(WMSStatus status,
java.lang.String layerName,
ICancellable cancel) |
java.io.File |
getMap(WMSStatus status,
ICancellable cancel) |
java.net.URL |
getMapURL(WMSStatus status,
ICancellable cancel) |
java.lang.String |
getName()
returns the alfanumeric information of the layers at the specified point.
|
OGCServiceInformation |
getServiceInformation() |
protected java.lang.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 java.lang.String encoding
protected WMSServiceInformation serviceInfo
public java.util.TreeMap layers
public WMSLayer rootLayer
public java.lang.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 java.lang.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 java.io.File getLegendGraphic_old(WMSStatus status, java.lang.String layerName, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public java.io.File getLegendGraphic(WMSStatus status, java.lang.String layerName, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public java.net.URL getMapURL(WMSStatus status, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
public java.lang.String getExceptionMessage(java.io.File f) throws java.io.IOException
file3
- java.io.IOException
public java.io.File getMap(WMSStatus status, ICancellable cancel) throws ServerErrorException, WMSException
ServerErrorException
WMSException
protected java.lang.String parseException(byte[] data)
public static java.lang.String buildCapabilitiesSuitableVersionRequest(java.lang.String _host, java.lang.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, java.lang.String layerName)
protected abstract WMSGetCapabilitiesRequest createGetCapabilitiesRequest(WMSStatus status)
protected void parseRequestTag(KXmlParser parser) throws java.io.IOException, XmlPullParserException
Parses the Request tag
java.io.IOException
XmlPullParserException
protected void parseGetMapTag(KXmlParser parser) throws java.io.IOException, XmlPullParserException
Parses the GetMap tag
java.io.IOException
XmlPullParserException
protected void parseGetFeatureInfoTag(KXmlParser parser) throws java.io.IOException, XmlPullParserException
Parses the GetFeatureInfo tag
java.io.IOException
XmlPullParserException
protected void parseGetLegendGraphicTag(KXmlParser parser) throws java.io.IOException, XmlPullParserException
Parses the GetLegendGraphic tag
java.io.IOException
XmlPullParserException