org.geotools.data.wfs
Class WFSDataStoreFactory

java.lang.Object
  extended byorg.geotools.data.AbstractDataStoreFactory
      extended byorg.geotools.data.wfs.WFSDataStoreFactory
All Implemented Interfaces:
DataStoreFactorySpi, Factory

public class WFSDataStoreFactory
extends AbstractDataStoreFactory

DOCUMENT ME!

Author:
dzwiers

Nested Class Summary
 
Nested classes inherited from class org.geotools.data.DataStoreFactorySpi
DataStoreFactorySpi.Param
 
Field Summary
static DataStoreFactorySpi.Param BUFFER_SIZE
          Integer
protected  java.util.Map cache
           
protected static java.util.logging.Logger logger
           
static DataStoreFactorySpi.Param PASSWORD
          String
static DataStoreFactorySpi.Param PROTOCOL
          boolean
static DataStoreFactorySpi.Param TIMEOUT
          Integer
static DataStoreFactorySpi.Param URL
          url
static DataStoreFactorySpi.Param USERNAME
          String
 
Constructor Summary
WFSDataStoreFactory()
           
 
Method Summary
 boolean canProcess(java.util.Map params)
          Default implementation verifies the Map against the Param information.
 DataStore createDataStore(java.util.Map params)
          Construct a live data source using the params specifed.
 DataStore createNewDataStore(java.util.Map params)
          DOCUMENT ME!
 java.lang.String getDescription()
          Describe the nature of the datasource constructed by this factory.
 java.lang.String getDisplayName()
          Default Implementation abuses the naming convention.
 DataStoreFactorySpi.Param[] getParametersInfo()
          MetaData about the required Parameters (for createDataStore).
 boolean isAvailable()
          Defaults to true, only a few datastores need to check for drivers.
 
Methods inherited from class org.geotools.data.AbstractDataStoreFactory
getImplementationHints, getParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL

public static final DataStoreFactorySpi.Param URL
url


PROTOCOL

public static final DataStoreFactorySpi.Param PROTOCOL
boolean


USERNAME

public static final DataStoreFactorySpi.Param USERNAME
String


PASSWORD

public static final DataStoreFactorySpi.Param PASSWORD
String


TIMEOUT

public static final DataStoreFactorySpi.Param TIMEOUT
Integer


BUFFER_SIZE

public static final DataStoreFactorySpi.Param BUFFER_SIZE
Integer


cache

protected java.util.Map cache

logger

protected static final java.util.logging.Logger logger
Constructor Detail

WFSDataStoreFactory

public WFSDataStoreFactory()
Method Detail

createDataStore

public DataStore createDataStore(java.util.Map params)
                          throws java.io.IOException
Description copied from interface: DataStoreFactorySpi
Construct a live data source using the params specifed.

You can think of this as setting up a connection to the back end data source.

Magic Params: the following params are magic and are honoured by convention by the GeoServer and uDig application.

When we eventually move over to the use of OpperationalParam we will have to find someway to codify this convention.

Parameters:
params - The full set of information needed to construct a live data store. Typical key values for the map include: url - location of a resource, used by file reading datasources. dbtype - the type of the database to connect to, e.g. postgis, mysql
Returns:
The created DataStore, this may be null if the required resource was not found or if insufficent parameters were given. Note that canProcess() should have returned false if the problem is to do with insuficent parameters.
Throws:
java.io.IOException
See Also:
DataStoreFactorySpi.createDataStore(java.util.Map)

createNewDataStore

public DataStore createNewDataStore(java.util.Map params)
                             throws java.io.IOException
DOCUMENT ME!

Parameters:
params - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.io.IOException
See Also:
DataStoreFactorySpi.createNewDataStore(java.util.Map)

getDescription

public java.lang.String getDescription()
Description copied from interface: DataStoreFactorySpi
Describe the nature of the datasource constructed by this factory.

A non localized description of this data store type.

Returns:
A human readable description that is suitable for inclusion in a list of available datasources.
See Also:
DataStoreFactorySpi.getDescription()

getParametersInfo

public DataStoreFactorySpi.Param[] getParametersInfo()
Description copied from interface: DataStoreFactorySpi
MetaData about the required Parameters (for createDataStore).

Interpretation of FeatureDescriptor values:

This should be the same as:


 Object params = factory.getParameters();
 BeanInfo info = getBeanInfo( params );
 
 return info.getPropertyDescriptors();
 

Returns:
Param array describing the Map for createDataStore
See Also:
DataStoreFactorySpi.getParametersInfo()

canProcess

public boolean canProcess(java.util.Map params)
Description copied from class: AbstractDataStoreFactory
Default implementation verifies the Map against the Param information.

It will ensure that:

  • params is not null
  • Everything is of the correct type (or upcovertable to the correct type without Error)
  • Required Parameters are present

Why would you ever want to override this method? If you want to check that a expected file exists and is a directory.

Overrride:

 public boolean canProcess( Map params ) {
     if( !super.canProcess( params ) ){
          return false; // was not in agreement with getParametersInfo
     }
     // example check
     File file = (File) DIRECTORY.lookup( params ); // DIRECTORY is a param
     return file.exists() && file.isDirectory();
 }
 

Specified by:
canProcess in interface DataStoreFactorySpi
Overrides:
canProcess in class AbstractDataStoreFactory
Parameters:
params -
Returns:
true if params is in agreement with getParametersInfo, override for additional checks.
See Also:
DataStoreFactorySpi.canProcess(java.util.Map)

getDisplayName

public java.lang.String getDisplayName()
Description copied from class: AbstractDataStoreFactory
Default Implementation abuses the naming convention.

Will return Foo for org.geotools.data.foo.FooFactory.

Specified by:
getDisplayName in interface DataStoreFactorySpi
Overrides:
getDisplayName in class AbstractDataStoreFactory
Returns:
return display name based on class name
See Also:
DataStoreFactorySpi.getDisplayName()

isAvailable

public boolean isAvailable()
Description copied from class: AbstractDataStoreFactory
Defaults to true, only a few datastores need to check for drivers.

Specified by:
isAvailable in interface DataStoreFactorySpi
Overrides:
isAvailable in class AbstractDataStoreFactory
Returns:
true, override to check for drivers etc...
See Also:
DataStoreFactorySpi.isAvailable()


Copyright © GeoTools. All Rights Reserved.