public abstract class WMTSProtocolHandler
extends java.lang.Object
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.
|
protected boolean |
forceChangeAxisOrder |
protected java.lang.String |
host |
protected java.lang.String |
name |
protected java.lang.String |
port |
protected java.lang.String |
version |
Constructor and Description |
---|
WMTSProtocolHandler() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected abstract WMTSGetCapabilitiesRequest |
createGetCapabilitiesRequest() |
protected abstract WMTSGetFeatureInfoRequest |
createGetFeatureInfoRequest(WMTSStatusImpl status,
int x,
int y) |
protected abstract WMTSGetTileRequest |
createGetTileRequest(WMTSStatusImpl status) |
java.io.File |
downloadFile(java.net.URL url,
ICancellable cancel,
java.io.File forceFile) |
protected byte[] |
fileToBytes(java.io.File file)
Copy the file in a byte array
|
java.lang.String |
getBaseURL(java.lang.String operation)
Gets the URL base for a operation (GetCapabilities, GetTile, ...)
|
java.lang.String |
getBaseURL(java.lang.String operation,
int protocol)
Gets the URL base for a operation (GetCapabilities, GetTile, ...) and
a protocol GET or POST
|
void |
getCapabilities(WMTSServerDescription 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 |
getFeatureInfo(WMTSStatusImpl status,
int x,
int y,
ICancellable cancel)
It will send a GetFeatureInfo request to the WMTS
Parsing the response and redirecting the info to the WMTS client
TODO: return a stored file instead a String.
|
java.lang.String |
getHost() |
java.io.File |
getLegendGraphic(WMTSLayer layer,
WMTSStyle style,
ICancellable cancel) |
java.lang.String |
getName() |
java.lang.String |
getPort() |
WMTSServerDescription |
getServerDescription() |
java.lang.String |
getSymbol(java.lang.String h)
Just for not repeat code.
|
java.io.File |
getTile(java.lang.String url,
ICancellable cancel,
java.io.File file) |
java.io.File |
getTile(WMTSStatus status,
ICancellable cancel) |
java.io.File |
getTile(WMTSStatusImpl status,
ICancellable cancel,
java.io.File file) |
java.net.URL |
getTileURL(WMTSStatusImpl status) |
java.lang.String |
getVersion() |
abstract boolean |
parseCapabilities(java.io.File f)
parses the data retrieved by the Capabilities XML document
|
protected java.lang.String |
parseException(byte[] data) |
void |
setForceChangeAxisOrder(boolean force)
Sets longitude first in the axis order read from the capabilities file
|
void |
setHost(java.lang.String host) |
void |
setName(java.lang.String name) |
void |
setPort(java.lang.String port) |
void |
setVersion(java.lang.String version) |
protected java.lang.String encoding
protected boolean forceChangeAxisOrder
protected java.lang.String name
protected java.lang.String version
protected java.lang.String host
protected java.lang.String port
protected abstract WMTSGetFeatureInfoRequest createGetFeatureInfoRequest(WMTSStatusImpl status, int x, int y)
protected abstract WMTSGetTileRequest createGetTileRequest(WMTSStatusImpl status)
protected abstract WMTSGetCapabilitiesRequest createGetCapabilitiesRequest()
public abstract boolean parseCapabilities(java.io.File f)
public WMTSServerDescription getServerDescription()
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- The host to set.public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name to set.public java.lang.String getPort()
public void setPort(java.lang.String port)
port
- The port to set.public java.lang.String getVersion()
public void setVersion(java.lang.String version)
version
- The version to set.public java.lang.String getSymbol(java.lang.String h)
h
- protected byte[] fileToBytes(java.io.File file) throws java.io.IOException
file
- The file to copyjava.io.IOException
public void setForceChangeAxisOrder(boolean force)
force
- public java.io.File getTile(WMTSStatusImpl status, ICancellable cancel, java.io.File file) throws ServerErrorException, WMTSException
ServerErrorException
WMTSException
public java.io.File getTile(WMTSStatus status, ICancellable cancel) throws ServerErrorException, WMTSException
ServerErrorException
WMTSException
public java.io.File getTile(java.lang.String url, ICancellable cancel, java.io.File file) throws ServerErrorException, WMTSException
ServerErrorException
WMTSException
public java.net.URL getTileURL(WMTSStatusImpl status) throws java.net.MalformedURLException
java.net.MalformedURLException
public java.lang.String getBaseURL(java.lang.String operation)
operation
- public java.lang.String getBaseURL(java.lang.String operation, int protocol)
operation
- public java.io.File downloadFile(java.net.URL url, ICancellable cancel, java.io.File forceFile) throws DownloadException
DownloadException
public java.io.File getLegendGraphic(WMTSLayer layer, WMTSStyle style, ICancellable cancel) throws ServerErrorException, WMTSException, DownloadException
ServerErrorException
WMTSException
DownloadException
public java.lang.String getFeatureInfo(WMTSStatusImpl status, int x, int y, ICancellable cancel)
It will send a GetFeatureInfo request to the WMTS Parsing the response and redirecting the info to the WMTS client
TODO: return a stored file instead a String.public void getCapabilities(WMTSServerDescription 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 static java.lang.String buildCapabilitiesSuitableVersionRequest(java.lang.String _host, java.lang.String _version)
protected java.lang.String parseException(byte[] data) throws java.io.IOException
java.io.IOException