Package org.apache.sis.storage.sql
Class SQLStoreProvider
java.lang.Object
org.apache.sis.storage.DataStoreProvider
org.apache.sis.storage.sql.SQLStoreProvider
Provider of
SQLStore instances.- Since:
- 1.0
- Version:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.storage.DataStoreProvider
DataStoreProvider.Prober<S> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringThe format name.private static final org.opengis.parameter.ParameterDescriptorGroupThe parameter descriptor to be returned bygetOpenParameters().(package private) static final StringName of the parameter for the list of queries.static final org.opengis.parameter.ParameterDescriptor<Map>Description of the parameter providing the queries to include as resources in theSQLStore.static final org.opengis.parameter.ParameterDescriptor<DataSource>Description of the "location" parameter.(package private) static final StringName of the parameter for the list of qualified table names.static final org.opengis.parameter.ParameterDescriptor<org.opengis.util.GenericName[]>Description of the parameter providing the list of tables or views to include as resources in theSQLStore.Fields inherited from class org.apache.sis.storage.DataStoreProvider
CREATE, LOCATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opengis.util.GenericNamecreateTableName(String catalog, String schemaPattern, String tablePattern) Create a qualified table name.org.opengis.parameter.ParameterDescriptorGroupReturns a description of all parameters accepted by this provider for opening a connection to the database.Returns a generic name for this data store, used mostly in warnings or error messages.open(StorageConnector connector) Returns aSQLStoreimplementation associated with this provider.open(org.opengis.parameter.ParameterValueGroup parameters) Returns a data store implementation associated with this provider for the given parameters.probeContent(StorageConnector connector) ReturnsProbeResult.SUPPORTEDif the given storage appears to be supported bySQLStore.Methods inherited from class org.apache.sis.storage.DataStoreProvider
getFormat, getLogger, getSupportedVersions, probeContent
-
Field Details
-
NAME
The format name.- See Also:
-
TABLES
Name of the parameter for the list of qualified table names. Values of this parameter areGenericName[].- See Also:
-
QUERIES
Name of the parameter for the list of queries. Values of this parameter areMap<GenericName,String>. Strings are also accepted as keys for convenience.- See Also:
-
SOURCE_PARAM
Description of the "location" parameter. This parameter is mandatory.- Since:
- 1.1
-
TABLES_PARAM
public static final org.opengis.parameter.ParameterDescriptor<org.opengis.util.GenericName[]> TABLES_PARAMDescription of the parameter providing the list of tables or views to include as resources in theSQLStore. At least one ofTABLES_PARAMorQUERIES_PARAMmust be provided.- Since:
- 1.1
-
QUERIES_PARAM
Description of the parameter providing the queries to include as resources in theSQLStore. Map keys are the resource names asGenericNameorStringinstances. Values are SQL statements (asStringinstances) to execute when the associated resource is requested. At least one ofTABLES_PARAMorQUERIES_PARAMmust be provided.- Since:
- 1.1
-
OPEN_DESCRIPTOR
private static final org.opengis.parameter.ParameterDescriptorGroup OPEN_DESCRIPTORThe parameter descriptor to be returned bygetOpenParameters().
-
-
Constructor Details
-
SQLStoreProvider
public SQLStoreProvider()Creates a new provider.
-
-
Method Details
-
createTableName
public static org.opengis.util.GenericName createTableName(String catalog, String schemaPattern, String tablePattern) Create a qualified table name. The returnedGenericNamecan be any of the following:catalog.schemaPattern.tablePatternschemaPattern.tablePatterntablePattern
'_'matches any single character and'%'matches any sequence of characters.- Parameters:
catalog- name of a catalog as it is stored in the database, ornullfor any catalog.schemaPattern- pattern (with'_'and'%'wildcards) of a schema, ornullfor any.tablePattern- pattern (with'_'and'%'wildcards) of a table.- Returns:
- the fully qualified name.
-
getShortName
Returns a generic name for this data store, used mostly in warnings or error messages.- Specified by:
getShortNamein classDataStoreProvider- Returns:
- a short name or abbreviation for the data format.
- See Also:
-
getOpenParameters
public org.opengis.parameter.ParameterDescriptorGroup getOpenParameters()Returns a description of all parameters accepted by this provider for opening a connection to the database. The group containsSOURCE_PARAM,TABLES_PARAMandQUERIES_PARAM.- Specified by:
getOpenParametersin classDataStoreProvider- Returns:
- description of available parameters for opening a connection to a database.
- See Also:
-
probeContent
ReturnsProbeResult.SUPPORTEDif the given storage appears to be supported bySQLStore. ReturningSUPPORTEDfrom 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:
probeContentin classDataStoreProvider- Parameters:
connector- information about the storage (data source).- Returns:
SUPPORTEDif the given storage seems to be usable bySQLStoreinstances.- Throws:
DataStoreException- if an SQL error occurred.
-
open
Returns aSQLStoreimplementation associated with this provider. The store will provide resources for all tables and views in all schemas and catalogs.- Specified by:
openin 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:
-
open
public DataStore open(org.opengis.parameter.ParameterValueGroup parameters) throws DataStoreException Returns a data store implementation associated with this provider for the given parameters.- Overrides:
openin 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:
-