Class TLcdOGCWMSCommandDispatcher
- All Implemented Interfaces:
ILcdDisposable
,AutoCloseable
- Direct Known Subclasses:
TLcdOGCSLDWMSCommandDispatcher
The protocol versions supported are:
- WMS 1.1.1 ( http://portal.opengeospatial.org/files/?artifact_id=1081&version=1&format=pdf)
- WMS 1.3.0 ( http://portal.opengeospatial.org/files/?artifact_id=14416)
The implemented OpenGIS WMS REQUEST parameter values are :
- GetCapabilities ; returns the capabilities of this servlet.
- GetMap : returns a map. The map is specified by the other parameters of the request.
- GetFeatureInfo (optional) : returns extra information about queryable elements of the map.
GetMap
, GetFeatureInfo
,
GetCapabilities
), this command dispatcher provides also support for
the optional GetLegendGraphic
and DescribeLayer
requests.
The SLD support is enabled by configuring the property enableSldSupport
.
Enabling support for user defined styles is done through configuration of the property enableUserStyleSupport
.
Overwrite the method handleUnknownCommand
to extend the REQUEST command handling.
When a invalid request is received, a TLcdWMSServiceException is thrown and sends an XML report with the exception. as defined in the specifications.
-
Constructor Summary
ConstructorDescriptionDefault constructor.TLcdOGCWMSCommandDispatcher
(TLcdDataModel[] aDataModels) Creates a newTLcdOGCWMSCommandDispatcher
instance, configured with a list ofTLcdDataModel
instances. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addGXYLayers
(jakarta.servlet.http.HttpServletRequest aHttpServletRequest, String[] aLayerList, String[] aStyleList, TLcdSLDStyledLayerDescriptor aStyledLayerDescriptor, TLcdGXYViewBufferedImage aGXYView) Creates the necessary layers based on the specified layer list, style list and/or styled layer descriptor, and adds them to the view.protected void
addGXYLayers
(jakarta.servlet.http.HttpServletRequest aHttpServletRequest, String aLayerList, String aStyleList, TLcdGXYViewBufferedImage aGXYView) Creates the layers from the list with the styles and add it to the view.void
addGXYViewEncoder
(ILcdGXYViewEncoder aGXYViewEncoder) Adds aILcdGXYViewEncoder
implementation for encoding views into a specific format, specified by their MIME-TYPE.void
addSLDWMSGXYLayerFactory
(ALcdSLDWMSGXYLayerFactory aSLDWMSGXYLayerFactory) Adds aALcdSLDWMSGXYLayerFactory
to create aILcdGXYLayer
for SLD layers.void
addWMSDescribeLayerEncoder
(ILcdWMSDescribeLayerRequestEncoder aWMSDescribeLayerEncoder) Adds aILcdWMSDescribeLayerRequestEncoder
implementation for creating and encoding describe layer responses into a specific format, specified by their MIME-TYPE.void
addWMSFeatureInfoEncoder
(ILcdWMSFeatureInfoRequestEncoder aWMSFeatureInfoEncoder) Adds aILcdWMSFeatureInfoRequestEncoder
implementation for encoding selection on views into a specific format, specified by their MIME-TYPE.void
addWMSGetFeatureInfoEncoder
(ILcdWMSGetFeatureInfoRequestEncoder aWMSGetFeatureInfoEncoder) Adds aILcdWMSGetFeatureInfoRequestEncoder
implementation for encoding selection on views into a specific format, specified by their MIME-TYPE.void
addWMSGetLegendGraphicEncoder
(ILcdWMSGetLegendGraphicRequestEncoder aWMSGetLegendGraphicEncoder) Adds aILcdWMSGetLegendGraphicRequestEncoder
implementation for encoding legend graphics into a specific format, specified by their MIME-TYPE.void
addWMSGXYLayerFactory
(ILcdWMSGXYLayerFactory aWMSGXYLayerFactory) Adds aILcdWMSGXYLayerFactory
to create aILcdGXYLayer
for aALcdWMSLayer
.void
addXYWorldReferenceParser
(ILcdXYWorldReferenceParser aXYWorldReferenceParser) Adds aILcdXYWorldReferenceParser
to parse aILcdXYWorldReference
from a given text encoding.protected void
clearGXYView
(TLcdGXYViewBufferedImage aGXYView) Method called to clear the initialized view.void
dispose()
Disposes of this object and allows it to release any system resources that it is holding.protected void
exportFeatureInfo
(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse, ILcdGXYLayerSubsetList aSelectionSublist) Encodes the given selection in theILcdGXYLayerSubsetList
from a givenILcdGXYView
and sends it to the client.protected void
exportGXYView
(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) Encodes a givenTLcdGXYViewBufferedImage
to the format specified in theHttpServletRequest
and sends the encoded result to theHttpServletResponse
.protected ALcdSLDWMSGXYLayerFactory
Returns a composite SLD WMS layer factory, containing all the registeredALcdSLDWMSGXYLayerFactory
instances.protected ILcdWMSGXYLayerFactory
Returns a composite WMS layer factory, containing all the registeredILcdWMSGXYLayerFactory
instances.TheILcdModelProvider
that is currently used by the command dispatcher.TheILcdRemoteOWSModelProvider
that is currently used by the command dispatcher.TheILcdSLDFeatureTypeStyleProvider
that is currently used by the command dispatcher.Deprecated.protected ALcdWMSCapabilities
getWMSCapabilities
(jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Deprecated.Please make use ofILcdWMSCapabilitiesProvider
.Returns the WMS capabilities provider.Returns the currently active capabilities updater.Returns the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).void
handleRequest
(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) This method receives a request and handles it.protected void
handleUnknownCommand
(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) This method handles unknown request ( not GetFeatureInfo, GetCapabilities or capabilities, GetMap or map).protected void
handleWMSServiceException
(TLcdWMSServiceException aWMSServiceException, jakarta.servlet.http.HttpServletRequest aHttpServletRequest, jakarta.servlet.http.HttpServletResponse aHttpServletResponse) This method handles what should be done in case aTLcdWMSServiceException
had occurred.protected void
initialiseGXYView
(TLcdGXYViewBufferedImage aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Initialise the view based on the parameter values of the request.boolean
Returns whether the command dispatcher should support user styling of layers.protected void
loadGXYLayerArraySFCT
(ALcdWMSLayer[] aWmsLayers, String[] aStyles, TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) This method is subject to changes, and should therefore not be used!protected ILcdXYWorldReference
parseXYWorldReference
(String aXYWorldReferenceAsString) Converts the value of the text representation into aILcdXYWorldReference
using theILcdXYWorldReferenceParser
objects of this command dispatcher.protected ILcdGXYLayerSubsetList
performSelectionAt
(int aX, int aY, int aFeatureCount, Vector aGXYLayerList, ILcdGXYView aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Performs a selection on the given view and set of layers, and returns the selected objects as aILcdGXYLayerSubsetList
.protected ILcdGXYLayerSubsetList
performSelectionInBounds
(int aX, int aY, int aSelectionWidth, int aSelectionHeight, int aFeatureCount, Vector aGXYLayerList, ILcdGXYView aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Performs a selection on the given view and set of layers, and returns the selected objects as aILcdGXYLayerSubsetList
.void
setEnableUserStyleSupport
(boolean aEnableUserStyleSupport) Controls whether the command dispatcher should support user styling of layers.void
setModelProvider
(ILcdModelProvider aModelProvider) Sets aILcdModelProvider
to be used within the command dispatcher to obtain a model for a source.void
setRemoteOWSModelProvider
(ILcdRemoteOWSModelProvider aRemoteOWSModelProvider) Sets aILcdRemoteOWSModelProvider
to be used within the command dispatcher to obtain a model for a user-defined layer.void
setSLDFeatureTypeStyleProvider
(ILcdWMSSLDFeatureTypeStyleProvider aSLDFeatureTypeStyleProvider) Sets aILcdSLDFeatureTypeStyleProvider
to be used within the command dispatcher to obtain SLD feature type styles for a WMS layer if no feature type style is included in the request.void
setWMSCapabilities
(ALcdWMSCapabilities aCapabilities) Deprecated.void
setWMSCapabilitiesProvider
(ILcdWMSCapabilitiesProvider aWMSCapabilitiesProvider) Sets the WMS capabilities provider.void
setWMSCapabilitiesUpdater
(ILcdWMSCapabilitiesUpdater aCapabilitiesUpdater) Sets a capabilities updater.void
setWMSOnlineResourceResolver
(ILcdWMSOnlineResourceResolver aWMSOnlineResourceResolver) Sets the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).Methods inherited from class com.luciad.wms.server.ALcdWMSCommandDispatcher
getGXYView, getGXYViewPoolSize, getParameterIgnoreCase, isClassTraceOn, performSelectionAt, performSelectionInBounds, returnGXYView, setClassTraceOn, setGXYViewPoolSize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdOGCWMSCommandDispatcher
public TLcdOGCWMSCommandDispatcher()Default constructor. -
TLcdOGCWMSCommandDispatcher
Creates a newTLcdOGCWMSCommandDispatcher
instance, configured with a list ofTLcdDataModel
instances. These data models are used for decoding XML data in requests.By default, the WMS XML request decoder is already configured with the data models required to parse regular WMS requests, with/without the use of SLD.
However, when using inline features in an SLD WMS request (e.g., AIXM 5.1 features), it is necessary that the decoder also knows the data model(s) that describe this feature data. These data models can be supplied through this constructor.
- Parameters:
aDataModels
- a list of data models to decode SLD inline feature data
-
-
Method Details
-
addGXYViewEncoder
Adds aILcdGXYViewEncoder
implementation for encoding views into a specific format, specified by their MIME-TYPE. Note that there can be only one encoder for a specific MIME-TYPE. Note that added implementations can be called for multiple simultaneous requests and thus should be thread safe!- Parameters:
aGXYViewEncoder
- theILcdGXYViewEncoder
implementation to add.
-
addWMSFeatureInfoEncoder
Adds aILcdWMSFeatureInfoRequestEncoder
implementation for encoding selection on views into a specific format, specified by their MIME-TYPE. Note that there can be only one encoder for a specific MIME-TYPE. It is important to note that added implementations can be called for multiple simultaneous requests and thus should be thread safe! Note that there is a similar interface toILcdWMSFeatureInfoRequestEncoder
, namelyILcdWMSGetFeatureInfoRequestEncoder
, which is used for the same purpose but offers access to extra information related to the current request. The methodaddWMSGetFeatureInfoEncoder(ServletConfig)
can be used to register implementations of this method. Registered objects of the typeILcdWMSGetFeatureInfoRequestEncoder
will have precedence above the objects of the typeILcdWMSFeatureInfoRequestEncoder
, if they have the same MIME type.- Parameters:
aWMSFeatureInfoEncoder
- theILcdWMSFeatureInfoRequestEncoder
implementation to add.
-
addWMSGetFeatureInfoEncoder
public void addWMSGetFeatureInfoEncoder(ILcdWMSGetFeatureInfoRequestEncoder aWMSGetFeatureInfoEncoder) Adds aILcdWMSGetFeatureInfoRequestEncoder
implementation for encoding selection on views into a specific format, specified by their MIME-TYPE. Note that there can be only one encoder for a specific MIME-TYPE. It is important to note that added implementations can be called for multiple simultaneous requests and thus should be thread safe! Note that there is a similar interface toILcdWMSGetFeatureInfoRequestEncoder
, namelyILcdWMSFeatureInfoRequestEncoder
, which is used for the same purpose but doesn't provide access to information related to the current request. This information can be useful while encodingGetFeatureInfo
responses. Registered objects of the typeILcdWMSGetFeatureInfoRequestEncoder
will have precedence above the objects of the typeILcdWMSFeatureInfoRequestEncoder
, if they have the same MIME type.- Parameters:
aWMSGetFeatureInfoEncoder
- theILcdWMSGetFeatureInfoRequestEncoder
implementation to add.
-
getWMSOnlineResourceResolver
Returns the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).- Returns:
- the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).
- See Also:
-
setWMSOnlineResourceResolver
Sets the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).- Parameters:
aWMSOnlineResourceResolver
- the online resource resolver used to retrieve the paths (typically an URL) to online resources defined in WMS responses (e.g. in the capabilities).- See Also:
-
getWMSCapabilities
Deprecated.Please make use ofILcdWMSCapabilitiesProvider
.Returns the most recent capabilities registered in thisTLcdOGCWMSCommandDispatcher
. If the WMS server is configured with a capabilities updater (seeILcdWMSCapabilitiesUpdater
), it is preferred to use the methodgetWMSCapabilities(HttpServletRequest)
while handling requests. This is to assure that there is only one capabilities configuration used for one request.- Returns:
- the most recent capabilities registered in this
TLcdOGCWMSCommandDispatcher
. - See Also:
-
getWMSCapabilities
protected ALcdWMSCapabilities getWMSCapabilities(jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Deprecated.Please make use ofILcdWMSCapabilitiesProvider
.Returns the capabilities object depending on the request. If there isn't yet a capabilities object associated with the given request, the most recent will returned (seegetWMSCapabilities()
. All next invocations of this method with the same request will return the same capabilities, even if a more recent version has already been registered.- Parameters:
aHttpServletRequest
- the servlet request.- Returns:
- a
ALcdWMSCapabilities
object depending on the request. - See Also:
-
setWMSCapabilities
Deprecated.Sets the default capabilities of this WMS.- Parameters:
aCapabilities
- the default capabilities of this WMS.- See Also:
-
setWMSCapabilitiesProvider
Sets the WMS capabilities provider. ThisWMS capabilities provider
allows providing always up to date versions of the capabilities.There is no need to use a
ILcdWMSCapabilitiesDecoder
in conjunction with aILcdWMSCapabilitiesUpdater
anymore.- Parameters:
aWMSCapabilitiesProvider
- the WMS capabilities provider.- Since:
- 2017.0
-
getWMSCapabilitiesProvider
Returns the WMS capabilities provider.- Returns:
- the WMS capabilities provider.
- Since:
- 2017.0
-
getModelProvider
TheILcdModelProvider
that is currently used by the command dispatcher. The command dispatcher uses this interface to obtain a model for a source, rather than directly using the model decoder factories or model decoders. AnILcdModelProvider
therefore provides central access to all models: it typically holds a reference to the model decoder factories and uses them to decode the actual data. The main advantage of this centralized approach is that it allows implementations to define additional functionality, that is global for all model decoders. A typical example is a caching mechanism, to improve the performance. The default implementation maintains a cache for all decoded models. To prevent memory problems, it makes use ofjava.lang.ref.SoftReference
objects, which are cleared at the discretion of the garbage collector in response to memory demand. Soft references are most often used to implement memory-sensitive caches.- Returns:
ILcdModelProvider
to provide the model for a source.- See Also:
-
setModelProvider
Sets aILcdModelProvider
to be used within the command dispatcher to obtain a model for a source.- Parameters:
aModelProvider
- the model provider implementation.- See Also:
-
addWMSGXYLayerFactory
Adds aILcdWMSGXYLayerFactory
to create aILcdGXYLayer
for aALcdWMSLayer
. Note that added implementations can be called for multiple simultaneous request and thus should be thread safe!- Parameters:
aWMSGXYLayerFactory
- aILcdWMSGXYLayerFactory
to create aILcdGXYLayer
for aALcdWMSLayer
.
-
getCompositeWMSGXYLayerFactory
Returns a composite WMS layer factory, containing all the registeredILcdWMSGXYLayerFactory
instances. WhencreateGXYLayer(ILcdModel, ALcdWMSLayer, String)
is invoked, it runs through all the registered layer factories until one is found that is capable of creating the layer.- Returns:
- a composite WMS layer factory, containing all the registered
ILcdWMSGXYLayerFactory
instances.
-
addXYWorldReferenceParser
Adds aILcdXYWorldReferenceParser
to parse aILcdXYWorldReference
from a given text encoding. Note that added implementations can be called for multiple simultaneous request and thus should be thread safe!- Parameters:
aXYWorldReferenceParser
- parser for aILcdXYWorldReference
from a given text encoding.
-
parseXYWorldReference
Converts the value of the text representation into aILcdXYWorldReference
using theILcdXYWorldReferenceParser
objects of this command dispatcher.- Parameters:
aXYWorldReferenceAsString
- the text representation of the coordinate system.- Returns:
- the corresponding
ILcdXYWorldReference
, null if theILcdXYWorldReference
can not be created, - See Also:
-
addSLDWMSGXYLayerFactory
Adds aALcdSLDWMSGXYLayerFactory
to create aILcdGXYLayer
for SLD layers. Note that added implementations can be called for multiple simultaneous request and thus should be thread safe!- Parameters:
aSLDWMSGXYLayerFactory
- aALcdSLDWMSGXYLayerFactory
to create aILcdGXYLayer
for SLD layers.
-
addWMSGetLegendGraphicEncoder
public void addWMSGetLegendGraphicEncoder(ILcdWMSGetLegendGraphicRequestEncoder aWMSGetLegendGraphicEncoder) Adds aILcdWMSGetLegendGraphicRequestEncoder
implementation for encoding legend graphics into a specific format, specified by their MIME-TYPE. Note that there can be only one encoder for a specific MIME-TYPE. Note that added implementations can be called for multiple simultaneous requests and thus should be thread safe!- Parameters:
aWMSGetLegendGraphicEncoder
- theILcdWMSGetLegendGraphicRequestEncoder
implementation to add.
-
addWMSDescribeLayerEncoder
Adds aILcdWMSDescribeLayerRequestEncoder
implementation for creating and encoding describe layer responses into a specific format, specified by their MIME-TYPE. Note that there can be only one encoder for a specific MIME-TYPE. Note that added implementations can be called for multiple simultaneous requests and thus should be thread safe!- Parameters:
aWMSDescribeLayerEncoder
- theILcdWMSDescribeLayerRequestEncoder
implementation to add.
-
getCompositeSLDWMSGXYLayerFactory
Returns a composite SLD WMS layer factory, containing all the registeredALcdSLDWMSGXYLayerFactory
instances. It runs through all the registered layer factories until one is found that is capable of creating the layer.- Returns:
- a composite SLD WMS layer factory, containing all the registered
ALcdSLDWMSGXYLayerFactory
instances.
-
getRemoteOWSModelProvider
TheILcdRemoteOWSModelProvider
that is currently used by the command dispatcher. The command dispatcher uses this interface to obtain a model for a user-defined layer, rather than directly using the remote model decoder factories or model decoders. AnILcdRemoteOWSModelProvider
therefore provides central access to all models: it typically holds a reference to the remote model decoder factories and uses them to decode the actual data. The main advantage of this centralized approach is that it allows implementations to define additional functionality, that is global for all remote model decoders. A typical example is a caching mechanism, to improve the performance. The default implementation does not maintain a cache.- Returns:
ILcdRemoteOWSModelProvider
to provide the model for a user-defined layer.- See Also:
-
setRemoteOWSModelProvider
Sets aILcdRemoteOWSModelProvider
to be used within the command dispatcher to obtain a model for a user-defined layer.- Parameters:
aRemoteOWSModelProvider
- the model provider implementation.- See Also:
-
getSLDFeatureTypeStyleProvider
TheILcdSLDFeatureTypeStyleProvider
that is currently used by the command dispatcher. The command dispatcher uses this interface to obtain the SLD feature type styles for a WMS layer if no feature type style is included in the request. AnILcdSLDFeatureTypeStyleProvider
therefore provides central access to all sld feature type style information.- Returns:
ILcdSLDFeatureTypeStyleProvider
to provide the SLD feature type styles.- Since:
- 2022.0
- See Also:
-
setSLDFeatureTypeStyleProvider
public void setSLDFeatureTypeStyleProvider(ILcdWMSSLDFeatureTypeStyleProvider aSLDFeatureTypeStyleProvider) Sets aILcdSLDFeatureTypeStyleProvider
to be used within the command dispatcher to obtain SLD feature type styles for a WMS layer if no feature type style is included in the request.- Parameters:
aSLDFeatureTypeStyleProvider
- the SLD feature type provider.- Since:
- 2022.0
- See Also:
-
handleRequest
public void handleRequest(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) throws jakarta.servlet.ServletException Description copied from class:ALcdWMSCommandDispatcher
This method receives a request and handles it.- Specified by:
handleRequest
in classALcdWMSCommandDispatcher
- Parameters:
aRequest
- the receivedHttpServletRequest
.aResponse
- theHttpServletResponse
to send the result to.- Throws:
jakarta.servlet.ServletException
- for servlet errors.
-
handleWMSServiceException
protected void handleWMSServiceException(TLcdWMSServiceException aWMSServiceException, jakarta.servlet.http.HttpServletRequest aHttpServletRequest, jakarta.servlet.http.HttpServletResponse aHttpServletResponse) throws jakarta.servlet.ServletException This method handles what should be done in case aTLcdWMSServiceException
had occurred.- Parameters:
aWMSServiceException
- the WMS Service Exception that has occurred.aHttpServletRequest
- the original request.aHttpServletResponse
- the response object to write to.- Throws:
jakarta.servlet.ServletException
- if handling the exception leads to an exception too.
-
initialiseGXYView
protected void initialiseGXYView(TLcdGXYViewBufferedImage aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) throws TLcdWMSServiceException, jakarta.servlet.ServletException Initialise the view based on the parameter values of the request.- Parameters:
aGXYViewSFCT
- theTLcdGXYViewBufferedImage
to be initialised.aHttpServletRequest
- theHttpServletRequest
containing the parameter values.- Throws:
TLcdWMSServiceException
- when the request doesn't follow the WMS and/or SLD specifications.jakarta.servlet.ServletException
- for servlet errors.
-
clearGXYView
Method called to clear the initialized view. Removes the layers from the view.- Parameters:
aGXYView
- theTLcdGXYViewBufferedImage
to be cleared.
-
addGXYLayers
protected void addGXYLayers(jakarta.servlet.http.HttpServletRequest aHttpServletRequest, String aLayerList, String aStyleList, TLcdGXYViewBufferedImage aGXYView) throws TLcdWMSServiceException, jakarta.servlet.ServletException Creates the layers from the list with the styles and add it to the view.- Parameters:
aHttpServletRequest
- the original servlet request for which this method is called.aLayerList
- a comma separated list of layer names.aStyleList
- a comma separate list of style ids.aGXYView
- theTLcdGXYViewBufferedImage
to add the layers to.- Throws:
IllegalArgumentException
- when illegal arguments are passed.TLcdWMSServiceException
- when the request doesn't follow the WMS specifications.jakarta.servlet.ServletException
- for servlet errors.
-
addGXYLayers
protected void addGXYLayers(jakarta.servlet.http.HttpServletRequest aHttpServletRequest, String[] aLayerList, String[] aStyleList, TLcdSLDStyledLayerDescriptor aStyledLayerDescriptor, TLcdGXYViewBufferedImage aGXYView) throws TLcdWMSServiceException, jakarta.servlet.ServletException Creates the necessary layers based on the specified layer list, style list and/or styled layer descriptor, and adds them to the view. The behavior of this method depends on whether a layer list and style list and/or a Styled Layer Descriptor (SLD) is provided. There are three possibilities, following the SLD 1.0.0 specification:- A layer list and style list are provided, but no SLD: This conforms to the behavior of a WMS without SLD support.
The specified named styles are used for the corresponding layers. Note that each of the styles in the style list
can be
null
, indicating that the default style must be used. The implementation will delegate toaddGXYLayers(jakarta.servlet.http.HttpServletRequest, String, String, com.luciad.view.gxy.TLcdGXYViewBufferedImage)
inTLcdOGCWMSCommandDispatcher
. - An SLD is provided, but no layer list and style list: All layers identified in the styled layer descriptor are rendered with all defined styles.
- Both a layer list and style list are provided as well as an SLD: In this case, only the layers identified in the layer list are rendered and the SLD is used as a style library. The style list is interpreted in the usual way, except that the handling of the style names is organized so that the styles defined in the SLD take precedence over the named styles stored within the WMS. The user-defined SLD styles can be given names and they can be marked as being the default style for a layer. To be more specific, if a style named "CenterLine" is referenced for a layer and a style with that name is defined for the corresponding layer in the SLD, then the SLD style definition is used. Otherwise, the standard named-style mechanism built into the WMS is used. If the use of a default style is specified and a style is marked as being the default for the corresponding layer in the SLD, then the default style from the SLD is used; otherwise, the standard default style in the WMS is used.
- Parameters:
aHttpServletRequest
- The original servlet request for which this method is called.aLayerList
- An array of layer names. This argument can only benull
ifaStyleList
is null andaStyledLayerDescriptor
is notnull
.aStyleList
- An array of style ids. This argument can only benull
ifaLayerList
is null andaStyledLayerDescriptor
is notnull
.aStyledLayerDescriptor
- A Styled Layer Descriptor. This argument can only benull
ifaLayerList
andaStyleList
are notnull
.aGXYView
- theTLcdGXYViewBufferedImage
to add the layers to.- Throws:
IllegalArgumentException
- when illegal arguments are passed.TLcdWMSServiceException
- when the request doesn't follow the WMS specifications.jakarta.servlet.ServletException
- for servlet errors.
- A layer list and style list are provided, but no SLD: This conforms to the behavior of a WMS without SLD support.
The specified named styles are used for the corresponding layers. Note that each of the styles in the style list
can be
-
loadGXYLayerArraySFCT
protected void loadGXYLayerArraySFCT(ALcdWMSLayer[] aWmsLayers, String[] aStyles, TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) throws IOException, jakarta.servlet.ServletException, TLcdWMSServiceException This method is subject to changes, and should therefore not be used! The current implementation takes the following steps:- for each
ALcdWMSLayer
, a model is retrieved via thegetModel
method of themodel provider
. Note that the default implementation ofILcdModelProvider
uses model caching. - for each
ILcdModel
, a correspondingILcdGXYLayer
is created via thecreateGXYLayer
method of thecomposite layer factory
. - the label of each
ILcdGXYLayer
is set to the name of the correspondingALcdWMSLayer
instance, because this property is supposed to be unique. - the
ILcdGXYLayer
objects are added to the suppliedTLcdGXYViewBufferedImage
object.
- Throws:
IOException
jakarta.servlet.ServletException
TLcdWMSServiceException
- for each
-
exportGXYView
protected void exportGXYView(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) throws TLcdWMSServiceException, jakarta.servlet.ServletException Encodes a givenTLcdGXYViewBufferedImage
to the format specified in theHttpServletRequest
and sends the encoded result to theHttpServletResponse
.- Parameters:
aGXYView
- theTLcdGXYViewBufferedImage
to be exported.aRequest
- theHttpServletRequest
containing the format to export in.aResponse
- theHttpServletResponse
to write the result to.- Throws:
TLcdWMSServiceException
- when the format value doesn't follow the WMS specifications.jakarta.servlet.ServletException
- for general servlet errors.
-
exportFeatureInfo
protected void exportFeatureInfo(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse, ILcdGXYLayerSubsetList aSelectionSublist) throws TLcdWMSServiceException, jakarta.servlet.ServletException Encodes the given selection in theILcdGXYLayerSubsetList
from a givenILcdGXYView
and sends it to the client.- Parameters:
aGXYView
- theTLcdGXYViewBufferedImage
in which the elements are selected .aRequest
- the receivedHttpServletRequest
.aResponse
- theHttpServletResponse
to send the result to.aSelectionSublist
- aILcdGXYLayerSubsetList
containing the selection to be encoded.- Throws:
TLcdWMSServiceException
- when the format value doesn't follow the WMS specifications.jakarta.servlet.ServletException
- for general servlet errors.
-
handleUnknownCommand
protected void handleUnknownCommand(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) throws TLcdWMSServiceException, jakarta.servlet.ServletException This method handles unknown request ( not GetFeatureInfo, GetCapabilities or capabilities, GetMap or map). The default implementation throws aTLcdWMSServiceException
specifying an invalid request.- Parameters:
aRequest
- theHttpServletRequest
containing the unknown request.aResponse
- theHttpServletResponse
to send the result to.- Throws:
TLcdWMSServiceException
- when the request does not follow the WMS specifications.jakarta.servlet.ServletException
- in case an exception can not be translated into aTLcdWMSServiceException
.
-
performSelectionAt
protected ILcdGXYLayerSubsetList performSelectionAt(int aX, int aY, int aFeatureCount, Vector aGXYLayerList, ILcdGXYView aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Performs a selection on the given view and set of layers, and returns the selected objects as aILcdGXYLayerSubsetList
. The selection is defined by a pixel position aX,aY.- Parameters:
aX
- the x value of the selection position on the view.aY
- the y value of the selection position on the view.aFeatureCount
- the maximum number of objects (features) to be selected.aGXYLayerList
- a vector containing theILcdGXYLayer
objects being queried.aGXYViewSFCT
- the map view for which the selection is requested.aHttpServletRequest
- the original servlet request.- Returns:
- a list of the layers having actually selected objects.
-
performSelectionInBounds
protected ILcdGXYLayerSubsetList performSelectionInBounds(int aX, int aY, int aSelectionWidth, int aSelectionHeight, int aFeatureCount, Vector aGXYLayerList, ILcdGXYView aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Performs a selection on the given view and set of layers, and returns the selected objects as aILcdGXYLayerSubsetList
. The selection is defined by pixel bounds, specified by its upper left location (aX,aY) and its width and height (aSelectionWidth,aSelectionHeight). By default, objects are only selected if their visual representation falls within these bounds.- Parameters:
aX
- the x value of the upper left location of the selection rectangle.aY
- the y value of the upper left location of the selection rectangle.aSelectionWidth
- the width of the selection rectangle.aSelectionHeight
- the height of the selection rectangle.aFeatureCount
- the maximum number of objects (features) to be selected.aGXYLayerList
- vector containing theILcdGXYLayer
objects being queried.aGXYViewSFCT
- the map view for which the selection is requested.aHttpServletRequest
- the original servlet request.- Returns:
- a list of the layers having actually selected objects.
-
isEnableUserStyleSupport
public boolean isEnableUserStyleSupport()Returns whether the command dispatcher should support user styling of layers. This makes only sense in combination when with registered support forDescribeLayer
and availability of layer factories that can deal with SLD.- Returns:
- This method returns whether user style support is active.
- Since:
- 2017.0
-
setEnableUserStyleSupport
public void setEnableUserStyleSupport(boolean aEnableUserStyleSupport) Controls whether the command dispatcher should support user styling of layers. Enabling this has only sense in combination with registering support forDescribeLayer
viaaddWMSDescribeLayerEncoder(ILcdWMSDescribeLayerRequestEncoder)
and by registering support to create layers using SLD throughaddSLDWMSGXYLayerFactory(ALcdSLDWMSGXYLayerFactory)
.- Parameters:
aEnableUserStyleSupport
- The value if user style support is enabled.- Since:
- 2017.0
-
setWMSCapabilitiesUpdater
Sets a capabilities updater.- Parameters:
aCapabilitiesUpdater
- A capabilities updater.
-
getWMSCapabilitiesUpdater
Returns the currently active capabilities updater.- Returns:
- the currently active capabilities updater.
-
dispose
public void dispose()Description copied from interface:ILcdDisposable
Disposes of this object and allows it to release any system resources that it is holding.
The result of calling any other method (other than
finalize
) on this object subsequent to a call to this method is undefined.- Specified by:
dispose
in interfaceILcdDisposable
- Overrides:
dispose
in classALcdWMSCommandDispatcher
-
ILcdWMSCapabilitiesProvider
.