| net.refractions.udig.catalog.ServiceExtension
All known Subclasses: net.refractions.udig.catalog.hsql.internal.HsqlServiceExtension, net.refractions.udig.mapgraphic.internal.MapGraphicServiceExtension, net.refractions.udig.catalog.memory.MemoryServiceExtensionImpl, net.refractions.udig.catalog.internal.shp.ShpServiceExtension, net.refractions.udig.catalog.internal.db2.DB2ServiceExtension, net.refractions.udig.catalog.internal.wfs.WFSServiceExtension, net.refractions.udig.catalog.internal.arcsde.ArcServiceExtension, net.refractions.udig.catalog.internal.gml.GMLServiceExtension,
ServiceExtension | public interface ServiceExtension (Code) | | This is the required addition on the part of a data provider.
Example:
public class MyService implements ServiceExtension {
public Map createParams( URL url ) {
if( url.toString().endsWith(".my") ){
Map map = new HashMap();
map.put("url",url);
return map;
}
return null; // url must be for someone else
}
public IService createService( URL id, Map params ) {
if( params.get("url") == null ||
!params.get("url").toString().endsWith(".xml") ){
return null;
}
return new MyService( params );
}
}
We also use this interface internally, so look in this plugin for additional examples.
author: David Zwiers, Refractions Research since: 0.6 |
createParams | Map<String, Serializable> createParams(URL url)(Code) | | 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: url - The potential source of params. Map of params to be used for creation, null if the URL cannot be used. |
createService | IService createService(URL id, Map<String, Serializable> params)(Code) | | 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: id - The sugested service id, should be generated when null. Parameters: params - The set of connection params. These param values may either be parsed, orunparsed (String). the IService created, or null when a service cannot be created from these params. See Also: IService.getStatus See Also: IService.getMessage |
|
|