Package org.apache.sis.storage.sql
Class SQLStoreProvider
- Object
-
- DataStoreProvider
-
- SQLStoreProvider
-
public class SQLStoreProvider extends DataStoreProvider
Provider ofSQLStore
instances.- Since:
- 1.0
Defined in the
sis-sqlstore
module
-
-
Field Summary
-
Fields inherited from class DataStoreProvider
CREATE, LOCATION
-
-
Constructor Summary
Constructors Constructor Description SQLStoreProvider()
Creates a new provider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GenericName
createTableName(String catalog, String schemaPattern, String tablePattern)
Create a qualified table name.ParameterDescriptorGroup
getOpenParameters()
Returns a description of all parameters accepted by this provider for opening a connection to the database.String
getShortName()
Returns a generic name for this data store, used mostly in warnings or error messages.DataStore
open(StorageConnector connector)
Returns aSQLStore
implementation associated with this provider.DataStore
open(ParameterValueGroup parameters)
Returns a data store implementation associated with this provider for the given parameters.ProbeResult
probeContent(StorageConnector connector)
ReturnsProbeResult.SUPPORTED
if the given storage appears to be supported bySQLStore
.-
Methods inherited from class DataStoreProvider
getFormat, getLogger, getSupportedVersions
-
-
-
-
Method Detail
-
createTableName
public static GenericName createTableName(String catalog, String schemaPattern, String tablePattern)
Create a qualified table name. The returnedGenericName
can be any of the following:catalog.schemaPattern.tablePattern
schemaPattern.tablePattern
tablePattern
'_'
matches any single character and'%'
matches any sequence of characters.- Parameters:
catalog
- name of a catalog as it is stored in the database, ornull
for any catalog.schemaPattern
- pattern (with'_'
and'%'
wildcards) of a schema, ornull
for any.tablePattern
- pattern (with'_'
and'%'
wildcards) of a table.- Returns:
- the fully qualified name.
-
getShortName
public String getShortName()
Returns a generic name for this data store, used mostly in warnings or error messages.- Specified by:
getShortName
in classDataStoreProvider
- Returns:
- a short name or abbreviation for the data format.
- See Also:
DataStoreProvider.getFormat()
-
getOpenParameters
public ParameterDescriptorGroup getOpenParameters()
Returns a description of all parameters accepted by this provider for opening a connection to the database.- Specified by:
getOpenParameters
in classDataStoreProvider
- Returns:
- description of available parameters for opening a connection to a database.
- See Also:
DataStoreProvider.LOCATION
,DataStoreProvider.CREATE
,DataStoreProvider.open(ParameterValueGroup)
,DataStore.getOpenParameters()
-
probeContent
public ProbeResult probeContent(StorageConnector connector) throws DataStoreException
ReturnsProbeResult.SUPPORTED
if the given storage appears to be supported bySQLStore
. ReturningSUPPORTED
from this method does not guarantee that reading or writing will succeed, only that there appears to be a reasonable chance of success based on a brief inspection of the connection.- Specified by:
probeContent
in classDataStoreProvider
- Parameters:
connector
- information about the storage (data source).- Returns:
SUPPORTED
if the given storage seems to be usable bySQLStore
instances.- Throws:
DataStoreException
- if an I/O error occurred.
-
open
public DataStore open(StorageConnector connector) throws DataStoreException
Returns aSQLStore
implementation associated with this provider.- Specified by:
open
in classDataStoreProvider
- Parameters:
connector
- information about the storage (data source).- Returns:
- a data store implementation associated with this provider for the given storage.
- Throws:
DataStoreException
- if an error occurred while creating the data store instance.- See Also:
DataStores.open(Object)
-
open
public DataStore open(ParameterValueGroup parameters) throws DataStoreException
Returns a data store implementation associated with this provider for the given parameters.- Overrides:
open
in classDataStoreProvider
- Parameters:
parameters
- opening parameters as defined bygetOpenParameters()
.- Returns:
- a data store implementation associated with this provider for the given parameters.
- Throws:
DataStoreException
- if an error occurred while creating the data store instance.- See Also:
DataStoreProvider.LOCATION
,DataStoreProvider.CREATE
,DataStoreProvider.getOpenParameters()
-
-