org.gvsig.remoteclient.wmts
Class WMTSProtocolHandler

java.lang.Object
  extended by org.gvsig.remoteclient.ogc.OGCProtocolHandler
      extended by org.gvsig.remoteclient.wmts.WMTSProtocolHandler
Direct Known Subclasses:
WMTSProtocolHandler1_0_0

public abstract class WMTSProtocolHandler
extends OGCProtocolHandler

Abstract class that represents handlers to comunicate via WMS protocol.

Author:
Nacho Brodin (nachobrodin@gmail.com)

Field Summary
protected  java.lang.String encoding
          Encoding used to parse different xml documents.
protected  boolean forceLongitudeFirstAxisOrder
           
protected  WMTSServiceInformation serviceInfo
           
 
Fields inherited from class org.gvsig.remoteclient.ogc.OGCProtocolHandler
downloader, host, name, port, version
 
Constructor Summary
WMTSProtocolHandler()
           
 
Method Summary
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(WMTSStatus status, int x, int y)
           
protected abstract  WMTSGetTileRequest createGetTileRequest(WMTSStatus status)
           
 java.io.File downloadFile(java.net.URL url, org.gvsig.compat.net.ICancellable cancel)
           
 void getCapabilities(WMTSServerDescription status, boolean override, org.gvsig.compat.net.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(WMTSStatus status, int x, int y, org.gvsig.compat.net.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.
 OGCServiceInformation getServiceInformation()
           
 java.io.File getTile(WMTSStatus status, org.gvsig.compat.net.ICancellable cancel)
           
 java.io.File getTile(WMTSStatus status, org.gvsig.compat.net.ICancellable cancel, java.io.File file)
           
 java.net.URL getTileURL(WMTSStatus status)
           
protected  java.lang.String parseException(byte[] data)
           
 void setForceLongitudeFirstAxisOrder(boolean force)
          Sets longitude first in the axis order read from the capabilities file
protected abstract  void setServerDescription(WMTSServerDescription status)
          Sets the status object
 
Methods inherited from class org.gvsig.remoteclient.ogc.OGCProtocolHandler
addOperationByAttribute, fileToBytes, getHost, getName, getPort, getSymbol, getVersion, parseCapabilities, parseHTTPTag, parserDcpType, setHost, setName, setPort, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected java.lang.String encoding
Encoding used to parse different xml documents.


serviceInfo

protected WMTSServiceInformation serviceInfo

forceLongitudeFirstAxisOrder

protected boolean forceLongitudeFirstAxisOrder
Constructor Detail

WMTSProtocolHandler

public WMTSProtocolHandler()
Method Detail

createGetFeatureInfoRequest

protected abstract WMTSGetFeatureInfoRequest createGetFeatureInfoRequest(WMTSStatus status,
                                                                         int x,
                                                                         int y)

createGetTileRequest

protected abstract WMTSGetTileRequest createGetTileRequest(WMTSStatus status)

createGetCapabilitiesRequest

protected abstract WMTSGetCapabilitiesRequest createGetCapabilitiesRequest()

setForceLongitudeFirstAxisOrder

public void setForceLongitudeFirstAxisOrder(boolean force)
Sets longitude first in the axis order read from the capabilities file

Parameters:
force -

setServerDescription

protected abstract void setServerDescription(WMTSServerDescription status)
Sets the status object

Parameters:
status -

getTile

public java.io.File getTile(WMTSStatus status,
                            org.gvsig.compat.net.ICancellable cancel,
                            java.io.File file)
                     throws ServerErrorException,
                            WMTSException
Throws:
ServerErrorException
WMTSException

getTile

public java.io.File getTile(WMTSStatus status,
                            org.gvsig.compat.net.ICancellable cancel)
                     throws ServerErrorException,
                            WMTSException
Throws:
ServerErrorException
WMTSException

getTileURL

public java.net.URL getTileURL(WMTSStatus status)
                        throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

downloadFile

public java.io.File downloadFile(java.net.URL url,
                                 org.gvsig.compat.net.ICancellable cancel)
                          throws DownloadException
Throws:
DownloadException

getFeatureInfo

public java.lang.String getFeatureInfo(WMTSStatus status,
                                       int x,
                                       int y,
                                       org.gvsig.compat.net.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.


getCapabilities

public void getCapabilities(WMTSServerDescription status,
                            boolean override,
                            org.gvsig.compat.net.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

Parameters:
override, - if true the previous downloaded data will be overridden

buildCapabilitiesSuitableVersionRequest

public 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.


getServiceInformation

public OGCServiceInformation getServiceInformation()
Specified by:
getServiceInformation in class OGCProtocolHandler

parseException

protected java.lang.String parseException(byte[] data)
                                   throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004-2013 gvSIG. All Rights Reserved.