Class SampleDataAccessFactory
Object
SampleDataAccessFactory
- All Implemented Interfaces:
DataAccessFactory
,Factory
Sample implementation of a
DataAccessFactory
for testing.
Enabled with a connection parameter "dbtype" of "sample-data-access".
- Since:
- 2.6
- Author:
- Ben Caradoc-Davies (CSIRO Earth Science and Resource Engineering)
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataAccessFactory
DataAccessFactory.Param
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataAccessFactory.Param
static final String
The "dbtype" connection string required to use this factory.static final Map<String,
Serializable> The connection parameters required to use this factory. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProcess
(Map<String, ?> params) Are these parameters for us?DataAccess<? extends FeatureType,
? extends Feature> createDataStore
(Map<String, ?> params) Create aSampleDataAccess
.Need to implement this.Need to implement this.Returns an empty list, containing no hints.Need to implement this.boolean
Returns true, as this implementation is always available.
-
Field Details
-
DBTYPE_STRING
The "dbtype" connection string required to use this factory.- See Also:
-
DBTYPE
-
PARAMS
The connection parameters required to use this factory.
-
-
Constructor Details
-
SampleDataAccessFactory
public SampleDataAccessFactory()
-
-
Method Details
-
canProcess
Are these parameters for us?- Specified by:
canProcess
in interfaceDataAccessFactory
- Parameters:
params
- The full set of information needed to construct a live data source.- Returns:
- booean true if and only if this factory can process the resource indicated by the param set and all the required params are pressent.
- See Also:
-
createDataStore
public DataAccess<? extends FeatureType,? extends Feature> createDataStore(Map<String, ?> params) throws IOExceptionCreate aSampleDataAccess
.- Specified by:
createDataStore
in interfaceDataAccessFactory
- 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:
IOException
- if there were any problems setting up (creating or connecting) the datasource.- See Also:
-
getDescription
Need to implement this.- Specified by:
getDescription
in interfaceDataAccessFactory
- Returns:
- A human readable description that is suitable for inclusion in a list of available datasources.
- See Also:
-
getDisplayName
Need to implement this.- Specified by:
getDisplayName
in interfaceDataAccessFactory
- Returns:
- A short name suitable for display in a user interface.
- See Also:
-
getParametersInfo
Need to implement this.- Specified by:
getParametersInfo
in interfaceDataAccessFactory
- Returns:
- Param array describing the Map for createDataStore
- See Also:
-
isAvailable
public boolean isAvailable()Returns true, as this implementation is always available.- Specified by:
isAvailable
in interfaceDataAccessFactory
- Returns:
- true if and only if this factory has all the appropriate jars on the classpath to create DataStores.
- See Also:
-
getImplementationHints
Returns an empty list, containing no hints.- Specified by:
getImplementationHints
in interfaceFactory
- Returns:
- The map of hints, or an {@linkplain java.util.Collections.emptyMap() empty map} if none.
- See Also:
-