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
ConstructorsConstructorDescriptionDefault constructor.TLcdOGCWMSCommandDispatcher(TLcdDataModel[] aDataModels) Creates a newTLcdOGCWMSCommandDispatcherinstance, configured with a list ofTLcdDataModelinstances. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddGXYLayers(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 voidaddGXYLayers(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.voidaddGXYViewEncoder(ILcdGXYViewEncoder aGXYViewEncoder) Adds aILcdGXYViewEncoderimplementation for encoding views into a specific format, specified by their MIME-TYPE.voidaddSLDWMSGXYLayerFactory(ALcdSLDWMSGXYLayerFactory aSLDWMSGXYLayerFactory) Adds aALcdSLDWMSGXYLayerFactoryto create aILcdGXYLayerfor SLD layers.voidaddWMSDescribeLayerEncoder(ILcdWMSDescribeLayerRequestEncoder aWMSDescribeLayerEncoder) Adds aILcdWMSDescribeLayerRequestEncoderimplementation for creating and encoding describe layer responses into a specific format, specified by their MIME-TYPE.voidaddWMSFeatureInfoEncoder(ILcdWMSFeatureInfoRequestEncoder aWMSFeatureInfoEncoder) Adds aILcdWMSFeatureInfoRequestEncoderimplementation for encoding selection on views into a specific format, specified by their MIME-TYPE.voidaddWMSGetFeatureInfoEncoder(ILcdWMSGetFeatureInfoRequestEncoder aWMSGetFeatureInfoEncoder) Adds aILcdWMSGetFeatureInfoRequestEncoderimplementation for encoding selection on views into a specific format, specified by their MIME-TYPE.voidaddWMSGetLegendGraphicEncoder(ILcdWMSGetLegendGraphicRequestEncoder aWMSGetLegendGraphicEncoder) Adds aILcdWMSGetLegendGraphicRequestEncoderimplementation for encoding legend graphics into a specific format, specified by their MIME-TYPE.voidaddWMSGXYLayerFactory(ILcdWMSGXYLayerFactory aWMSGXYLayerFactory) Adds aILcdWMSGXYLayerFactoryto create aILcdGXYLayerfor aALcdWMSLayer.voidaddXYWorldReferenceParser(ILcdXYWorldReferenceParser aXYWorldReferenceParser) Adds aILcdXYWorldReferenceParserto parse aILcdXYWorldReferencefrom a given text encoding.protected voidclearGXYView(TLcdGXYViewBufferedImage aGXYView) Method called to clear the initialized view.voiddispose()Disposes of this object and allows it to release any system resources that it is holding.protected voidexportFeatureInfo(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse, ILcdGXYLayerSubsetList aSelectionSublist) Encodes the given selection in theILcdGXYLayerSubsetListfrom a givenILcdGXYViewand sends it to the client.protected voidexportGXYView(TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) Encodes a givenTLcdGXYViewBufferedImageto the format specified in theHttpServletRequestand sends the encoded result to theHttpServletResponse.protected ALcdSLDWMSGXYLayerFactoryReturns a composite SLD WMS layer factory, containing all the registeredALcdSLDWMSGXYLayerFactoryinstances.protected ILcdWMSGXYLayerFactoryReturns a composite WMS layer factory, containing all the registeredILcdWMSGXYLayerFactoryinstances.TheILcdModelProviderthat is currently used by the command dispatcher.TheILcdRemoteOWSModelProviderthat is currently used by the command dispatcher.TheILcdSLDFeatureTypeStyleProviderthat is currently used by the command dispatcher.Deprecated.protected ALcdWMSCapabilitiesgetWMSCapabilities(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).voidhandleRequest(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) This method receives a request and handles it.protected voidhandleUnknownCommand(jakarta.servlet.http.HttpServletRequest aRequest, jakarta.servlet.http.HttpServletResponse aResponse) This method handles unknown request ( not GetFeatureInfo, GetCapabilities or capabilities, GetMap or map).protected voidhandleWMSServiceException(TLcdWMSServiceException aWMSServiceException, jakarta.servlet.http.HttpServletRequest aHttpServletRequest, jakarta.servlet.http.HttpServletResponse aHttpServletResponse) This method handles what should be done in case aTLcdWMSServiceExceptionhad occurred.protected voidinitialiseGXYView(TLcdGXYViewBufferedImage aGXYViewSFCT, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) Initialise the view based on the parameter values of the request.booleanReturns whether the command dispatcher should support user styling of layers.protected voidloadGXYLayerArraySFCT(ALcdWMSLayer[] aWmsLayers, String[] aStyles, TLcdGXYViewBufferedImage aGXYView, jakarta.servlet.http.HttpServletRequest aHttpServletRequest) This method is subject to changes, and should therefore not be used!protected ILcdXYWorldReferenceparseXYWorldReference(String aXYWorldReferenceAsString) Converts the value of the text representation into aILcdXYWorldReferenceusing theILcdXYWorldReferenceParserobjects of this command dispatcher.protected ILcdGXYLayerSubsetListperformSelectionAt(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 ILcdGXYLayerSubsetListperformSelectionInBounds(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.voidsetEnableUserStyleSupport(boolean aEnableUserStyleSupport) Controls whether the command dispatcher should support user styling of layers.voidsetModelProvider(ILcdModelProvider aModelProvider) Sets aILcdModelProviderto be used within the command dispatcher to obtain a model for a source.voidsetRemoteOWSModelProvider(ILcdRemoteOWSModelProvider aRemoteOWSModelProvider) Sets aILcdRemoteOWSModelProviderto be used within the command dispatcher to obtain a model for a user-defined layer.voidsetSLDFeatureTypeStyleProvider(ILcdWMSSLDFeatureTypeStyleProvider aSLDFeatureTypeStyleProvider) Sets aILcdSLDFeatureTypeStyleProviderto 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.voidsetWMSCapabilities(ALcdWMSCapabilities aCapabilities) Deprecated.voidsetWMSCapabilitiesProvider(ILcdWMSCapabilitiesProvider aWMSCapabilitiesProvider) Sets the WMS capabilities provider.voidsetWMSCapabilitiesUpdater(ILcdWMSCapabilitiesUpdater aCapabilitiesUpdater) Sets a capabilities updater.voidsetWMSOnlineResourceResolver(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, setGXYViewPoolSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdDisposable
close
-
Constructor Details
-
TLcdOGCWMSCommandDispatcher
public TLcdOGCWMSCommandDispatcher()Default constructor. -
TLcdOGCWMSCommandDispatcher
Creates a newTLcdOGCWMSCommandDispatcherinstance, configured with a list ofTLcdDataModelinstances. 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 aILcdGXYViewEncoderimplementation 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- theILcdGXYViewEncoderimplementation to add.
-
addWMSFeatureInfoEncoder
Adds aILcdWMSFeatureInfoRequestEncoderimplementation 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 typeILcdWMSGetFeatureInfoRequestEncoderwill have precedence above the objects of the typeILcdWMSFeatureInfoRequestEncoder, if they have the same MIME type.- Parameters:
aWMSFeatureInfoEncoder- theILcdWMSFeatureInfoRequestEncoderimplementation to add.
-
addWMSGetFeatureInfoEncoder
public void addWMSGetFeatureInfoEncoder(ILcdWMSGetFeatureInfoRequestEncoder aWMSGetFeatureInfoEncoder) Adds aILcdWMSGetFeatureInfoRequestEncoderimplementation 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 encodingGetFeatureInforesponses. Registered objects of the typeILcdWMSGetFeatureInfoRequestEncoderwill have precedence above the objects of the typeILcdWMSFeatureInfoRequestEncoder, if they have the same MIME type.- Parameters:
aWMSGetFeatureInfoEncoder- theILcdWMSGetFeatureInfoRequestEncoderimplementation 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
ALcdWMSCapabilitiesobject 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 providerallows providing always up to date versions of the capabilities.There is no need to use a
ILcdWMSCapabilitiesDecoderin conjunction with aILcdWMSCapabilitiesUpdateranymore.- Parameters:
aWMSCapabilitiesProvider- the WMS capabilities provider.- Since:
- 2017.0
-
getWMSCapabilitiesProvider
Returns the WMS capabilities provider.- Returns:
- the WMS capabilities provider.
- Since:
- 2017.0
-
getModelProvider
TheILcdModelProviderthat 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. AnILcdModelProvidertherefore 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.SoftReferenceobjects, 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:
ILcdModelProviderto provide the model for a source.- See Also:
-
setModelProvider
Sets aILcdModelProviderto be used within the command dispatcher to obtain a model for a source.- Parameters:
aModelProvider- the model provider implementation.- See Also:
-
addWMSGXYLayerFactory
Adds aILcdWMSGXYLayerFactoryto create aILcdGXYLayerfor aALcdWMSLayer. Note that added implementations can be called for multiple simultaneous request and thus should be thread safe!- Parameters:
aWMSGXYLayerFactory- aILcdWMSGXYLayerFactoryto create aILcdGXYLayerfor aALcdWMSLayer.
-
getCompositeWMSGXYLayerFactory
Returns a composite WMS layer factory, containing all the registeredILcdWMSGXYLayerFactoryinstances. 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
ILcdWMSGXYLayerFactoryinstances.
-
addXYWorldReferenceParser
Adds aILcdXYWorldReferenceParserto parse aILcdXYWorldReferencefrom 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 aILcdXYWorldReferencefrom a given text encoding.
-
parseXYWorldReference
Converts the value of the text representation into aILcdXYWorldReferenceusing theILcdXYWorldReferenceParserobjects of this command dispatcher.- Parameters:
aXYWorldReferenceAsString- the text representation of the coordinate system.- Returns:
- the corresponding
ILcdXYWorldReference, null if theILcdXYWorldReferencecan not be created, - See Also:
-
addSLDWMSGXYLayerFactory
Adds aALcdSLDWMSGXYLayerFactoryto create aILcdGXYLayerfor SLD layers. Note that added implementations can be called for multiple simultaneous request and thus should be thread safe!- Parameters:
aSLDWMSGXYLayerFactory- aALcdSLDWMSGXYLayerFactoryto create aILcdGXYLayerfor SLD layers.
-
addWMSGetLegendGraphicEncoder
public void addWMSGetLegendGraphicEncoder(ILcdWMSGetLegendGraphicRequestEncoder aWMSGetLegendGraphicEncoder) Adds aILcdWMSGetLegendGraphicRequestEncoderimplementation 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- theILcdWMSGetLegendGraphicRequestEncoderimplementation to add.
-
addWMSDescribeLayerEncoder
Adds aILcdWMSDescribeLayerRequestEncoderimplementation 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- theILcdWMSDescribeLayerRequestEncoderimplementation to add.
-
getCompositeSLDWMSGXYLayerFactory
Returns a composite SLD WMS layer factory, containing all the registeredALcdSLDWMSGXYLayerFactoryinstances. 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
ALcdSLDWMSGXYLayerFactoryinstances.
-
getRemoteOWSModelProvider
TheILcdRemoteOWSModelProviderthat 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. AnILcdRemoteOWSModelProvidertherefore 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:
ILcdRemoteOWSModelProviderto provide the model for a user-defined layer.- See Also:
-
setRemoteOWSModelProvider
Sets aILcdRemoteOWSModelProviderto be used within the command dispatcher to obtain a model for a user-defined layer.- Parameters:
aRemoteOWSModelProvider- the model provider implementation.- See Also:
-
getSLDFeatureTypeStyleProvider
TheILcdSLDFeatureTypeStyleProviderthat 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. AnILcdSLDFeatureTypeStyleProvidertherefore provides central access to all sld feature type style information.- Returns:
ILcdSLDFeatureTypeStyleProviderto provide the SLD feature type styles.- Since:
- 2022.0
- See Also:
-
setSLDFeatureTypeStyleProvider
public void setSLDFeatureTypeStyleProvider(ILcdWMSSLDFeatureTypeStyleProvider aSLDFeatureTypeStyleProvider) Sets aILcdSLDFeatureTypeStyleProviderto 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:ALcdWMSCommandDispatcherThis method receives a request and handles it.- Specified by:
handleRequestin classALcdWMSCommandDispatcher- Parameters:
aRequest- the receivedHttpServletRequest.aResponse- theHttpServletResponseto 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 aTLcdWMSServiceExceptionhad 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- theTLcdGXYViewBufferedImageto be initialised.aHttpServletRequest- theHttpServletRequestcontaining 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- theTLcdGXYViewBufferedImageto 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- theTLcdGXYViewBufferedImageto 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 benullifaStyleListis null andaStyledLayerDescriptoris notnull.aStyleList- An array of style ids. This argument can only benullifaLayerListis null andaStyledLayerDescriptoris notnull.aStyledLayerDescriptor- A Styled Layer Descriptor. This argument can only benullifaLayerListandaStyleListare notnull.aGXYView- theTLcdGXYViewBufferedImageto 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 thegetModelmethod of themodel provider. Note that the default implementation ofILcdModelProvideruses model caching. - for each
ILcdModel, a correspondingILcdGXYLayeris created via thecreateGXYLayermethod of thecomposite layer factory. - the label of each
ILcdGXYLayeris set to the name of the correspondingALcdWMSLayerinstance, because this property is supposed to be unique. - the
ILcdGXYLayerobjects are added to the suppliedTLcdGXYViewBufferedImageobject.
- Throws:
IOExceptionjakarta.servlet.ServletExceptionTLcdWMSServiceException
- 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 givenTLcdGXYViewBufferedImageto the format specified in theHttpServletRequestand sends the encoded result to theHttpServletResponse.- Parameters:
aGXYView- theTLcdGXYViewBufferedImageto be exported.aRequest- theHttpServletRequestcontaining the format to export in.aResponse- theHttpServletResponseto 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 theILcdGXYLayerSubsetListfrom a givenILcdGXYViewand sends it to the client.- Parameters:
aGXYView- theTLcdGXYViewBufferedImagein which the elements are selected .aRequest- the receivedHttpServletRequest.aResponse- theHttpServletResponseto send the result to.aSelectionSublist- aILcdGXYLayerSubsetListcontaining 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 aTLcdWMSServiceExceptionspecifying an invalid request.- Parameters:
aRequest- theHttpServletRequestcontaining the unknown request.aResponse- theHttpServletResponseto 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 theILcdGXYLayerobjects 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 theILcdGXYLayerobjects 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 forDescribeLayerand 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 forDescribeLayerviaaddWMSDescribeLayerEncoder(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:ILcdDisposableDisposes 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:
disposein interfaceILcdDisposable- Overrides:
disposein classALcdWMSCommandDispatcher
-
ILcdWMSCapabilitiesProvider.