Class ALcdOGCWFSCommandDispatcherFactory
- All Implemented Interfaces:
ILcdOGCCommandDispatcherFactory
createCommandDispatcher method to be called, which will in turn call all protected
factory methods of this class to construct the instances which are required by the request
handlers. The final server initialization step is to create a request handler for each WFS
request using the createRequestHandler method. These handlers can then be registered
on the TLcdWFSCommandDispatcher instance that is created by the
createWFSCommandDispatcherInstance factory method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidAdds a reference formatter.protected final voidAdds a reference parser.protected ILcdWFSClientModelEncoderFactoryCreates anILcdWFSClientModelEncoderFactory.Called during servlet initialization to create a command dispatcher.protected ILcdWFSFilteredModelFactorycreateFilteredModelFactory(ILcdWFSCapabilitiesProvider aCapabilitiesProvider, ILcdOGCModelProvider aModelProvider) Creates anILcdWFSFilteredModelFactory.protected ILcdWFSLockFactorycreateLockFactory(ILcdWFSFilteredModelFactory aFilteredModelFactory) Creates a lock factory which creates locks for locking support.protected ILcdOGCModelDecoderFactoryCreates anILcdOGCModelDecoderFactory.protected ILcdOGCModelProvidercreateModelProvider(ILcdOGCModelDecoderFactory aModelDecoderFactory) Creates anILcdOGCModelProvider, which provides central access to all models.createRequestHandler(String aRequest, TLcdWFSCommandDispatcherContext aCommandDispatcherContext) Factory method to create a WFS request handler.protected ILcdWFSServerModelEncoderFactoryCreates anILcdWFSServerModelEncoderFactory.protected ILcdWFSServiceMetaDataDeprecated.Deprecated.Since 2017.0 Please make use ofILcdWFSCapabilitiesProvider.protected List<TLcdDataModel> Creates the data models to configure the transaction XML decoder used by the transaction request handler.protected ILcdWFSTransactionHandlerFactorycreateTransactionHandlerFactory(ILcdOGCModelProvider aModelProvider, ILcdWFSLockFactory aLockFactory, ILcdWFSFilteredModelFactory aFilteredModelFactory, ILcdWFSServerModelEncoderFactory aServerModelEncoderFactory) Creates a transaction handler factory.protected ILcdWFSCapabilitiesProvidercreateWFSCapabilitiesProvider(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider, ILcdModelReferenceFormatter aModelReferenceFormatter, ILcdModelReferenceParser aModelReferenceParser) Creates a WFS capabilities provider.protected TLcdWFSCommandDispatcherCalled bycreateWFSCommandDispatcher()to create a command dispatcher.protected ILcdWFSFeatureTypeListDecodercreateWFSFeatureTypeListDecoder(ILcdOGCModelProvider aModelProvider) Deprecated.Since 2017.0 Please make use ofILcdWFSCapabilitiesProvider.Get the model reference formatter used by the server.Get the model reference parser used by the server.protected voidThis is called during initialization to give users the opportunity to register a number ofILcdModelReferenceFormatters.protected voidThis is called during initialization to give users the opportunity to register a number ofILcdModelReferenceParsers.
-
Constructor Details
-
ALcdOGCWFSCommandDispatcherFactory
public ALcdOGCWFSCommandDispatcherFactory()
-
-
Method Details
-
createCommandDispatcher
public ALcdOGCCommandDispatcher createCommandDispatcher(ILcdInitializationConfig aConfig) throws TLcdOGCServiceException Called during servlet initialization to create a command dispatcher. This method also configures the dispatcher, by registering the necessary request handlers and setting up global objects such as a model decoder factory.- Specified by:
createCommandDispatcherin interfaceILcdOGCCommandDispatcherFactory- Parameters:
aConfig- The servlet configuration parameters loaded from web.xml.- Returns:
- An
ALcdOGCCommandDispatcher - Throws:
TLcdOGCServiceException- when the creation process fails- See Also:
-
createModelDecoderFactory
Creates an
ILcdOGCModelDecoderFactory. TheILcdOGCModelDecoderFactoryis used by the server to load data: it is responsible of creating anILcdModelDecoderfor a given source. ThisILcdModelDecoderis then used to decode the data identified by that source.By default, this method returns a
TLcdOGCModelDecoderFactoryinstance. This implementation usesTLcdServiceLoaderto findILcdModelDecoderinstances.- Returns:
- an
ILcdOGCModelDecoderFactoryto read data at the server
-
createClientModelEncoderFactory
Creates anILcdWFSClientModelEncoderFactory. TheILcdWFSClientModelEncoderFactoryis used by the server to create anILcdModelEncoderfor the output format requested by the client. TheILcdModelEncoderis then used to encode the features that were returned by the server. This factory is also used to generate encoders for the schemas that describe the data. These schemas can be requested using DescribeFeatureType requests. TheILcdWFSClientModelEncoderFactoryalso specifies the output formats that will be supported by the server, these output formats will be advertised in the capabilities document of the server. By default, theTLcdServiceLoaderis used to find anILcdWFSClientModelEncoderFactoryinstance. If multiple instances are found, the one annotated with the highest priority is used. If no instance is found or ifnullis returned,TLcdWFSClientModelEncoderFactoryis used by default.- Returns:
- an
ILcdWFSClientModelEncoderFactoryto send data to the client
-
createServerModelEncoderFactory
Creates anILcdWFSServerModelEncoderFactory. TheILcdWFSServerModelEncoderFactoryis used by the default transaction handler to store modified data at the server. A server model encoder factory is required if the default transaction handler is used; otherwise it depends on the implementation of theALcdWFSTransactionHandlerthat is created by theILcdWFSTransactionHandlerFactory. To enable transactions, the servlet configuration parameter 'wfs.enableTransactions' should be set to 'true'.- Returns:
- an
ILcdWFSServerModelEncoderFactoryto store modified data at the server, returns null by default. - See Also:
-
createModelProvider
Creates anILcdOGCModelProvider, which provides central access to all models. The server uses this interface to retrieve a model, instead of directly using the model decoder factory (seecreateModelDecoderFactory()). The model decoder factory should only be used by theILcdOGCModelProviderto decode the necessary models. This centralized access allows implementations to define additional functionality, like a cache mechanism. The default implementation returns aTLcdOGCModelProviderthat maintains a cache for all decoded models. To prevent memory problems, it makes use of soft reference 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. The request context object type supplied to theILcdOGCModelProvider#getModel(String, ILcdRequestContext)is of the typeTLcdWFSRequestContext.- Parameters:
aModelDecoderFactory- The model decoder factory that must be used by the model provider to read data- Returns:
- a model provider.
-
createLockFactory
Creates a lock factory which creates locks for locking support. To enable locking the servlet configuration parameter 'wfs.enableLocking' should be set to 'true'. The default implementation creates a factory which locks all features 'in memory'. This means that the data in the underlying data store can still be read or written by other processes at all times.- Parameters:
aFilteredModelFactory- The filtered model factory which can be used to retrieve features to be locked, this is the factory that is created bycreateFilteredModelFactory().- Returns:
- A valid lock factory.
- Since:
- 10.0
-
createTransactionHandlerFactory
protected ILcdWFSTransactionHandlerFactory createTransactionHandlerFactory(ILcdOGCModelProvider aModelProvider, ILcdWFSLockFactory aLockFactory, ILcdWFSFilteredModelFactory aFilteredModelFactory, ILcdWFSServerModelEncoderFactory aServerModelEncoderFactory) Creates a transaction handler factory. This is only required in case the WFS server should support transactions. The default implementation of this method creates a transaction handler which applies the changes to anILcdModel, and stores these changes on commit using anILcdModelEncodercreated by theILcdWFSServerModelEncoderFactory. To enable transactions, the servlet configuration parameter 'wfs.enableTransactions' should be set to 'true'.- Parameters:
aModelProvider- the model provider created bycreateModelProvider(com.luciad.ogc.common.ILcdOGCModelDecoderFactory).aLockFactory- the lock factory created bycreateLockFactory(com.luciad.ogc.wfs.ILcdWFSFilteredModelFactory).aFilteredModelFactory- the filtered model factory created bycreateFilteredModelFactory(com.luciad.ogc.wfs.ILcdWFSCapabilitiesProvider, com.luciad.ogc.common.ILcdOGCModelProvider)aServerModelEncoderFactory- the server model encoder factory created bycreateServerModelEncoderFactory()- Returns:
- a valid transaction handler factory, or
nullif transactional support is not required. - Since:
- 10.0 f
-
createWFSCommandDispatcherInstance
Called bycreateWFSCommandDispatcher()to create a command dispatcher.- Returns:
- a
TLcdWFSCommandDispatcher.
-
createWFSFeatureTypeListDecoder
protected ILcdWFSFeatureTypeListDecoder createWFSFeatureTypeListDecoder(ILcdOGCModelProvider aModelProvider) Deprecated.Since 2017.0 Please make use ofILcdWFSCapabilitiesProvider.Called during servlet initialization to create an
ILcdWFSFeatureTypeListDecoder. The feature type list decoder is responsible for creating the list of data offered by the WFS service.If access to the data is required to construct the feature type list (e.g., to add more info about the data to the corresponding
ILcdWFSFeatureType), the suppliedILcdOGCModelProvidershould be used. This instance provides central access to all models that need to be decoded.By default, this method will return
null. Unless thecreateWFSCapabilitiesProvidermethod is implemented directly, this method needs to be implemented as well.- Parameters:
aModelProvider- The model provider used to read data- Returns:
- an
ILcdWFSFeatureTypeListDecoder
-
createWFSCapabilitiesProvider
protected ILcdWFSCapabilitiesProvider createWFSCapabilitiesProvider(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider, ILcdModelReferenceFormatter aModelReferenceFormatter, ILcdModelReferenceParser aModelReferenceParser) throws TLcdOGCServiceException Creates a WFS capabilities provider.
By default, this method creates an
ILcdWFSCapabilitiesProviderinstance based on the results of the following methods:This method offers advantages over these separate methods. It in particular eases the implementation of access control, and it allows to return feature types lazily. See
ILcdWFSCapabilitiesProviderfor more information.- Parameters:
aConfig- The servlet configuration parameters.aModelProvider- The model provideraModelReferenceFormatter- Formatter for model references.aModelReferenceParser- Parser for model references.- Returns:
- a WFS capabilities provider, never
null. - Throws:
TLcdOGCServiceException- when the capabilities provider can not be created.- Since:
- 2017.0
-
registerModelReferenceFormatters
protected void registerModelReferenceFormatters()This is called during initialization to give users the opportunity to register a number ofILcdModelReferenceFormatters. These reference formatters are used to generate the SRS strings for each feature type, as listed in the WFS capabilities document. To register a new reference formatter, use theaddModelReferenceFormatter(ILcdModelReferenceFormatter)method. The formatter that should be called first should be added last. -
addModelReferenceFormatter
Adds a reference formatter.- Parameters:
aFormatter- AnILcdModelReferenceFormatter
-
registerModelReferenceParsers
protected void registerModelReferenceParsers()This is called during initialization to give users the opportunity to register a number ofILcdModelReferenceParsers. These reference parsers are used to parse incoming srs strings. To register a new reference parser, use theaddModelReferenceParser(ILcdModelReferenceParser)method. The parser that should be called first should be added last.- Since:
- 10.0
-
addModelReferenceParser
Adds a reference parser.- Parameters:
aParser- AnILcdModelReferenceParser- Since:
- 10.0
-
createFilteredModelFactory
protected ILcdWFSFilteredModelFactory createFilteredModelFactory(ILcdWFSCapabilitiesProvider aCapabilitiesProvider, ILcdOGCModelProvider aModelProvider) throws TLcdOGCServiceException Creates anILcdWFSFilteredModelFactory. This factory is responsible for supporting the use of filters in WFS requests. By default, theTLcdServiceLoaderis used to find anILcdWFSFilteredModelFactoryinstance. If multiple instances are found, the one annotated with the highest priority is used. If no instance is found or ifnullis returned,TLcdWFSFilteredModelFactoryis used by default.- Parameters:
aCapabilitiesProvider- The list of data offered by the WFS serviceaModelProvider- The model provider used to read data- Returns:
- an
ILcdWFSFilteredModelFactory - Throws:
TLcdOGCServiceException- if the creation of the object fails
-
createServiceMetaData
Deprecated.Since 2017.0 Please make use ofILcdWFSCapabilitiesProvider.Creates anILcdWFSServiceMetaData, which provides values to be written to the Service section of the WFS capabilities. If this method returnsnull, default values will be written to the capabilities.- Returns:
- an
ILcdWFSServiceMetaData
-
createServiceProvider
Deprecated.Since 2017.0 Please make use ofILcdWFSCapabilitiesProvider.Returns the general service info/metadata that will appear in the server's capabilities.- Returns:
- the general service info/metadata that will appear in the server's capabilities.
- Since:
- 10.0
-
createTransactionContentDataModels
Creates the data models to configure the transaction XML decoder used by the transaction request handler.
The transaction XML decoder is already configured with the data models required to parse regular WFS transaction requests containing GML data. Through this method, additional data models can be supplied to make the decoder aware of specific formats (for example
AIXM 5.1).The default implementation of this method picks up all suitable data models available in the Luciad API, including
AIXM 5.1.Each data model needs to be equipped with annotations of type
TLcdXMLSchemaMappingAnnotationthat indicate how the XML data needs to be decoded. This is automatically the case for all XML format-based data models available in the Luciad API and for data models created viaTLcdXMLDataModelBuilder.- Parameters:
aConfig- The servlet configuration parameters- Returns:
- the data models to configure the transaction XML decoder
- Since:
- 2017.0
-
getModelReferenceFormatter
Get the model reference formatter used by the server.- Returns:
- the model reference formatter
- Since:
- 2012.1
-
getModelReferenceParser
Get the model reference parser used by the server.- Returns:
- the model reference parser
- Since:
- 2012.1
-
createRequestHandler
public ILcdRequestHandler createRequestHandler(String aRequest, TLcdWFSCommandDispatcherContext aCommandDispatcherContext) throws TLcdWFSServiceException Factory method to create a WFS request handler. This method is called for all requests defined by the WFS specification, and the returned handlers are registered with the WFS command dispatcher.- Parameters:
aRequest- the name of a WFS request, e.g. "GetCapabilities"aCommandDispatcherContext- global objects that may be used by the request handlers- Returns:
- an ILcdRequestHandler that can respond to the specified request
- Throws:
TLcdWFSServiceException- if no handler can be created- See Also:
-
ILcdWFSCapabilitiesProvider.