org.geotools.catalog
Interface ServiceFactory

All Known Implementing Classes:
ShapefileServiceFactory, WFSServiceFactory, WMSServiceFactory

public interface ServiceFactory

This is the required addition on the part of a data provider. We also use this interface internally, so look in this plugin for examples.

Since:
0.6
Author:
David Zwiers, Refractions Research

Method Summary
 boolean canProcess(java.net.URI uri)
          Determines if the ServiceExtension can process the specified uri and use it to create a set of connection paramters.
 java.util.Map createParams(java.net.URI uri)
          The primary intention is for drag 'n' drop.
 Service createService(Catalog parent, java.net.URI id, java.util.Map params)
          Creates an IService based on the params provided.
 

Method Detail

createService

public Service createService(Catalog parent,
                             java.net.URI id,
                             java.util.Map params)
Creates an IService based on the params provided. This may or may not return a singleton, caching is optional. Error messages can be retrieved using the getStatus and getMessage methods. It is important to note that this method must inspect the url to determine if it can be used to create the service. If it cannot, null must be returned.

Parameters:
parent - The catalog containing the service, may be null
id - The sugested service id, should be generated when null.
params - The set of connection params. These param values may either be parsed, or unparsed (String).
Returns:
the IService created, or null when a service cannot be created from these params.
See Also:
IService#getStatus(), IService#getMessage()

canProcess

public boolean canProcess(java.net.URI uri)
Determines if the ServiceExtension can process the specified uri and use it to create a set of connection paramters.

Parameters:
uri - The uri representing the service.
Returns:
true if the uri can be processed, otherwise false.

createParams

public java.util.Map createParams(java.net.URI uri)
The primary intention is for drag 'n' drop. This generates a set of params for the given URL ... in most cases this will be passed to the createService method. It is important to note that this method must inspect the url to determine if it can be used to create the service. If it cannot, null must be returned.

Parameters:
uri - The potential source of params.
Returns:
Map of params to be used for creation, null if the URL cannot be used.


Copyright © GeoTools. All Rights Reserved.