public abstract class ALcdOGCWFSCommandDispatcherFactory extends Object implements 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 and Description |
---|
ALcdOGCWFSCommandDispatcherFactory() |
Modifier and Type | Method and Description |
---|---|
protected void |
addModelReferenceFormatter(ILcdModelReferenceFormatter aFormatter)
Adds a reference formatter.
|
protected void |
addModelReferenceParser(ILcdModelReferenceParser aParser)
Adds a reference parser.
|
protected ILcdWFSClientModelEncoderFactory |
createClientModelEncoderFactory()
Creates an
ILcdWFSClientModelEncoderFactory . |
ALcdOGCCommandDispatcher |
createCommandDispatcher(ILcdInitializationConfig aConfig)
Called during servlet initialization to create a command dispatcher.
|
protected ILcdWFSFilteredModelFactory |
createFilteredModelFactory(ILcdWFSCapabilitiesProvider aCapabilitiesProvider,
ILcdOGCModelProvider aModelProvider)
Creates an
ILcdWFSFilteredModelFactory . |
protected ILcdWFSLockFactory |
createLockFactory(ILcdWFSFilteredModelFactory aFilteredModelFactory)
Creates a lock factory which creates locks for locking support.
|
protected ILcdOGCModelDecoderFactory |
createModelDecoderFactory()
Creates an
ILcdOGCModelDecoderFactory . |
protected ILcdOGCModelProvider |
createModelProvider(ILcdOGCModelDecoderFactory aModelDecoderFactory)
Creates an
ILcdOGCModelProvider , which provides central access to all models. |
ILcdRequestHandler |
createRequestHandler(String aRequest,
TLcdWFSCommandDispatcherContext aCommandDispatcherContext)
Factory method to create a WFS request handler.
|
protected ILcdWFSServerModelEncoderFactory |
createServerModelEncoderFactory()
Creates an
ILcdWFSServerModelEncoderFactory . |
protected ILcdWFSServiceMetaData |
createServiceMetaData()
Deprecated.
Since 2017.0 Please make use of
ILcdWFSCapabilitiesProvider . |
TLcdOWSServiceProvider |
createServiceProvider()
Deprecated.
Since 2017.0 Please make use of
ILcdWFSCapabilitiesProvider . |
protected List<TLcdDataModel> |
createTransactionContentDataModels(ILcdInitializationConfig aConfig)
Creates the data models to configure the transaction XML decoder used by the transaction request handler.
|
protected ILcdWFSTransactionHandlerFactory |
createTransactionHandlerFactory(ILcdOGCModelProvider aModelProvider,
ILcdWFSLockFactory aLockFactory,
ILcdWFSFilteredModelFactory aFilteredModelFactory,
ILcdWFSServerModelEncoderFactory aServerModelEncoderFactory)
Creates a transaction handler factory.
|
protected ILcdWFSCapabilitiesProvider |
createWFSCapabilitiesProvider(ILcdInitializationConfig aConfig,
ILcdOGCModelProvider aModelProvider,
ILcdModelReferenceFormatter aModelReferenceFormatter,
ILcdModelReferenceParser aModelReferenceParser)
Creates a WFS capabilities provider.
|
protected TLcdWFSCommandDispatcher |
createWFSCommandDispatcherInstance()
Called by
createWFSCommandDispatcher() to create a command dispatcher. |
protected ILcdWFSFeatureTypeListDecoder |
createWFSFeatureTypeListDecoder(ILcdOGCModelProvider aModelProvider)
Deprecated.
Since 2017.0 Please make use of
ILcdWFSCapabilitiesProvider . |
ILcdModelReferenceFormatter |
getModelReferenceFormatter()
Get the model reference formatter used by the server.
|
ILcdModelReferenceParser |
getModelReferenceParser()
Get the model reference parser used by the server.
|
protected void |
registerModelReferenceFormatters()
This is called during initialization to give users the opportunity to register a number of
ILcdModelReferenceFormatter s. |
protected void |
registerModelReferenceParsers()
This is called during initialization to give users the opportunity to register a number of
ILcdModelReferenceParser s. |
public ALcdOGCCommandDispatcher createCommandDispatcher(ILcdInitializationConfig aConfig) throws TLcdOGCServiceException
createCommandDispatcher
in interface ILcdOGCCommandDispatcherFactory
aConfig
- The servlet configuration parameters loaded from web.xml.ALcdOGCCommandDispatcher
TLcdOGCServiceException
- when the creation process failscreateWFSCommandDispatcherInstance()
protected ILcdOGCModelDecoderFactory createModelDecoderFactory()
Creates an ILcdOGCModelDecoderFactory
. The ILcdOGCModelDecoderFactory
is used by the server to load data: it is responsible of creating an
ILcdModelDecoder
for a given source. This ILcdModelDecoder
is then
used to decode the data identified by that source.
By default, this method returns a TLcdOGCModelDecoderFactory
instance.
This implementation uses TLcdServiceLoader
to find
ILcdModelDecoder
instances.
ILcdOGCModelDecoderFactory
to read data at the serverprotected ILcdWFSClientModelEncoderFactory createClientModelEncoderFactory()
ILcdWFSClientModelEncoderFactory
. The ILcdWFSClientModelEncoderFactory
is used by the server to create an ILcdModelEncoder
for the output format
requested by the client. The ILcdModelEncoder
is 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.
The ILcdWFSClientModelEncoderFactory
also 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, the TLcdServiceLoader
is used to find an
ILcdWFSClientModelEncoderFactory
instance.
If multiple instances are found, the one annotated with the highest priority is used.
If no instance is found or if null
is returned, TLcdWFSClientModelEncoderFactory
is used by default.ILcdWFSClientModelEncoderFactory
to send data to the clientprotected ILcdWFSServerModelEncoderFactory createServerModelEncoderFactory()
ILcdWFSServerModelEncoderFactory
. The ILcdWFSServerModelEncoderFactory
is 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 the ALcdWFSTransactionHandler
that is created by
the ILcdWFSTransactionHandlerFactory
. To enable transactions, the servlet
configuration parameter 'wfs.enableTransactions' should be set to 'true'.ILcdWFSServerModelEncoderFactory
to store modified data at the server,
returns null by default.createTransactionHandlerFactory(com.luciad.ogc.common.ILcdOGCModelProvider,
ILcdWFSLockFactory, ILcdWFSFilteredModelFactory, ILcdWFSServerModelEncoderFactory)
protected ILcdOGCModelProvider createModelProvider(ILcdOGCModelDecoderFactory aModelDecoderFactory)
ILcdOGCModelProvider
, which provides central access to all models. The
server uses this interface to retrieve a model, instead of directly using the model decoder
factory (see createModelDecoderFactory()
). The model decoder factory should only be
used by the ILcdOGCModelProvider
to decode the necessary models. This centralized
access allows implementations to define additional functionality, like a cache mechanism.
The default implementation returns a TLcdOGCModelProvider
that 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 the ILcdOGCModelProvider#getModel(String, ILcdRequestContext)
is of the type TLcdWFSRequestContext
.aModelDecoderFactory
- The model decoder factory that must be used by the model provider
to read dataprotected ILcdWFSLockFactory createLockFactory(ILcdWFSFilteredModelFactory aFilteredModelFactory)
aFilteredModelFactory
- The filtered model factory which can be used to retrieve features
to be locked, this is the factory that is created by
createFilteredModelFactory()
.protected ILcdWFSTransactionHandlerFactory createTransactionHandlerFactory(ILcdOGCModelProvider aModelProvider, ILcdWFSLockFactory aLockFactory, ILcdWFSFilteredModelFactory aFilteredModelFactory, ILcdWFSServerModelEncoderFactory aServerModelEncoderFactory)
ILcdModel
, and stores these changes on
commit using an ILcdModelEncoder
created by the ILcdWFSServerModelEncoderFactory
.
To enable transactions, the servlet configuration parameter 'wfs.enableTransactions'
should be set to 'true'.aModelProvider
- the model provider created by createModelProvider(com.luciad.ogc.common.ILcdOGCModelDecoderFactory)
.aLockFactory
- the lock factory created by createLockFactory(com.luciad.ogc.wfs.ILcdWFSFilteredModelFactory)
.aFilteredModelFactory
- the filtered model factory created by createFilteredModelFactory(com.luciad.ogc.wfs.ILcdWFSCapabilitiesProvider, com.luciad.ogc.common.ILcdOGCModelProvider)
aServerModelEncoderFactory
- the server model encoder factory created by createServerModelEncoderFactory()
null
if transactional support is
not required.protected TLcdWFSCommandDispatcher createWFSCommandDispatcherInstance()
createWFSCommandDispatcher()
to create a command dispatcher.TLcdWFSCommandDispatcher
.protected ILcdWFSFeatureTypeListDecoder createWFSFeatureTypeListDecoder(ILcdOGCModelProvider aModelProvider)
ILcdWFSCapabilitiesProvider
.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 supplied
ILcdOGCModelProvider
should be used. This instance provides central access to all
models that need to be decoded.
By default, this method will return null
. Unless the createWFSCapabilitiesProvider
method is implemented directly, this method needs to be implemented
as well.
aModelProvider
- The model provider used to read dataILcdWFSFeatureTypeListDecoder
protected ILcdWFSCapabilitiesProvider createWFSCapabilitiesProvider(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider, ILcdModelReferenceFormatter aModelReferenceFormatter, ILcdModelReferenceParser aModelReferenceParser) throws TLcdOGCServiceException
Creates a WFS capabilities provider.
By default, this method creates an ILcdWFSCapabilitiesProvider
instance
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 ILcdWFSCapabilitiesProvider
for more information.
aConfig
- The servlet configuration parameters.aModelProvider
- The model provideraModelReferenceFormatter
- Formatter for model references.aModelReferenceParser
- Parser for model references.null
.TLcdOGCServiceException
- when the capabilities provider can not be created.protected void registerModelReferenceFormatters()
ILcdModelReferenceFormatter
s. 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 the addModelReferenceFormatter(ILcdModelReferenceFormatter)
method. The formatter that should be called first should be added last.protected final void addModelReferenceFormatter(ILcdModelReferenceFormatter aFormatter)
aFormatter
- An ILcdModelReferenceFormatter
protected void registerModelReferenceParsers()
ILcdModelReferenceParser
s. These reference parsers are used to parse incoming srs
strings. To register a new reference parser, use the addModelReferenceParser(ILcdModelReferenceParser)
method. The parser that should be called first should be added last.protected final void addModelReferenceParser(ILcdModelReferenceParser aParser)
aParser
- An ILcdModelReferenceParser
protected ILcdWFSFilteredModelFactory createFilteredModelFactory(ILcdWFSCapabilitiesProvider aCapabilitiesProvider, ILcdOGCModelProvider aModelProvider) throws TLcdOGCServiceException
ILcdWFSFilteredModelFactory
. This factory is responsible for supporting
the use of filters in WFS requests.aCapabilitiesProvider
- The list of data offered by the WFS serviceaModelProvider
- The model provider used to read dataILcdWFSFilteredModelFactory
TLcdOGCServiceException
- if the creation of the object failsprotected ILcdWFSServiceMetaData createServiceMetaData()
ILcdWFSCapabilitiesProvider
.ILcdWFSServiceMetaData
, which provides values to be written to the
Service section of the WFS capabilities. If this method returns null
, default
values will be written to the capabilities.ILcdWFSServiceMetaData
public TLcdOWSServiceProvider createServiceProvider()
ILcdWFSCapabilitiesProvider
.protected List<TLcdDataModel> createTransactionContentDataModels(ILcdInitializationConfig aConfig)
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 TLcdXMLSchemaMappingAnnotation
that 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 via
TLcdXMLDataModelBuilder
.
aConfig
- The servlet configuration parameterspublic ILcdModelReferenceFormatter getModelReferenceFormatter()
public ILcdModelReferenceParser getModelReferenceParser()
public ILcdRequestHandler createRequestHandler(String aRequest, TLcdWFSCommandDispatcherContext aCommandDispatcherContext) throws TLcdWFSServiceException
aRequest
- the name of a WFS request, e.g. "GetCapabilities"aCommandDispatcherContext
- global objects that may be used by the request handlersTLcdWFSServiceException
- if no handler can be createdcreateCommandDispatcher(com.luciad.ogc.common.ILcdInitializationConfig)