public class DataSource
extends java.lang.Object
DataSet| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
| Modifier | Constructor and Description |
|---|---|
protected |
DataSource(long cPtr,
boolean cMemoryOwn) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkConstraintExists(java.lang.String datasetName,
java.lang.String name)
It checks if a check-constraint with the given name exists in the data source.
|
void |
cloneDataSet(java.lang.String name,
java.lang.String cloneName,
Str2StrMap options)
It clones the dataset in the data source.
|
void |
close()
It closes the data source and clears all the resources used by its internal communication channel.
|
boolean |
dataSetExists(java.lang.String name)
It checks if a dataset with the given name exists in the data source.
|
void |
delete() |
static void |
drop(java.lang.String dsType,
java.lang.String connInfo) |
void |
dropCheckConstraint(java.lang.String datasetName,
java.lang.String name)
It removes the check constraint from the dataset.
|
void |
dropDataSet(java.lang.String name)
It removes the dataset schema from the data source.
|
void |
dropForeignKey(java.lang.String datasetName,
java.lang.String fkName)
It removes the foreign key constraint from the dataset schema.
|
void |
dropIndex(java.lang.String datasetName,
java.lang.String idxName)
It removes the index from the given dataset.
|
void |
dropPrimaryKey(java.lang.String datasetName)
It removes the primary key constraint from the dataset schema.
|
void |
dropProperty(java.lang.String datasetName,
java.lang.String name)
It removes a property from the given dataset.
|
void |
dropSequence(java.lang.String name)
It removes the sequence from the data source.
|
void |
dropUniqueKey(java.lang.String datasetName,
java.lang.String name)
It removes the unique key constraint from the dataset.
|
static boolean |
exists(java.lang.String dsType,
java.lang.String connInfo) |
protected void |
finalize() |
boolean |
foreignKeyExists(java.lang.String datasetName,
java.lang.String name)
It checks if a foreign key with the given name exists in the data source.
|
StrVector |
getCheckConstraintNames(java.lang.String datasetName)
It gets the check constraint names of the given dataset.
|
protected static long |
getCPtr(DataSource obj) |
StrVector |
getDataSetNames()
It gets the dataset names available in the data source.
|
static StrVector |
getDataSourceNames(java.lang.String dsType,
java.lang.String connInfo) |
StrVector |
getForeignKeyNames(java.lang.String datasetName)
It gets the foreign key names of the given dataset.
|
java.lang.String |
getGeometryTypeName(SWIGTYPE_p_te__gm__GeomType type) |
java.lang.String |
getId()
An identification value for the data source.
|
StrVector |
getIndexNames(java.lang.String datasetName)
It gets the index names of the given dataset.
|
long |
getNumberOfDataSets()
It retrieves the number of data sets available in the data source.
|
long |
getNumberOfItems(java.lang.String datasetName)
It retrieves the number of items of the given dataset.
|
long |
getNumberOfProperties(java.lang.String datasetName)
It gets the number of properties of the given dataset.
|
StrVector |
getPropertyNames(java.lang.String datasetName)
It gets the property names of the given dataset.
|
StrVector |
getSequenceNames()
It gets the sequence names available in the data source.
|
java.lang.String |
getType()
It returns the data source type name (in UPPER CASE).
|
StrVector |
getUniqueKeyNames(java.lang.String datasetName)
It gets the unique key names of the given dataset.
|
boolean |
hasDataSets()
It checks if the data source has any dataset.
|
boolean |
indexExists(java.lang.String datasetName,
java.lang.String name)
It checks if an index with the given name exists in the dataset.
|
boolean |
isDataSetNameValid(java.lang.String datasetName)
It checks if the given dataset name is valid.
|
boolean |
isOpened()
It returns true if the data source is opened, otherwise it returns false.
|
boolean |
isPropertyNameValid(java.lang.String propertyName)
It checks if the given property name is valid.
|
boolean |
isValid()
It checks if the data source is valid (available for using).
|
DataSet |
newDataSet(java.lang.String name)
Retrieves the dataset named as name.
|
void |
open()
It opens the data source and makes it ready for using.
|
boolean |
primaryKeyExists(java.lang.String datasetName,
java.lang.String name)
It checks if a primary key exists in the dataset.
|
boolean |
propertyExists(java.lang.String datasetName,
java.lang.String name)
It checks if a property with the given name exists in the dataset.
|
void |
renameDataSet(java.lang.String name,
java.lang.String newName)
It renames a dataset.
|
void |
renameProperty(java.lang.String datasetName,
java.lang.String propertyName,
java.lang.String newPropertyName)
It renames a property of the given dataset.
|
boolean |
sequenceExists(java.lang.String name)
It checks if a sequence with the given name exists in the data source.
|
boolean |
uniqueKeyExists(java.lang.String datasetName,
java.lang.String name)
It checks if a unique key with the given name exists in the dataset.
|
protected static long getCPtr(DataSource obj)
protected void finalize()
finalize in class java.lang.Objectpublic void delete()
public java.lang.String getId()
public java.lang.String getType()
Note that each data source driver must have a unique name.
This method is thread-safe!
public void open()
throws java.io.IOException
If the subclass needs to open a connection to a database server, to open a file, or to get information from a Web Service, this method can do this kind of job to prepare the data source to be in an operational mode. It will use the connection information provided by the setConnectionInfo methods.
This method is not thread-safe!
java.io.IOException - An exception can be thrown, if the data source cannot be opened.public void close()
throws java.io.IOException
This method closes any connection, any opened file, and releases any other resources.
This method is not thread-safe!
java.io.IOException - An exception can be thrown, if the data source cannot be closed.public boolean isOpened()
This method will not check if the data source is available for using; it will just answer if the data source has already been opened. If you want to know if the data source is available for using, check the isValid() method.
This method not thread-safe!
public boolean isValid()
For a DBMS, it will check the opened connections. For a WFS client, it will check if the server is reachable. For a file, it will check if it can be read.
This method is not thread-safe!
public boolean isDataSetNameValid(java.lang.String datasetName)
This method is thread-safe!
datasetName - A dataset name whose validity will be checked.public boolean isPropertyNameValid(java.lang.String propertyName)
propertyName - A property name whose validity will be checked.public StrVector getDataSetNames() throws java.io.IOException
Note that each dataset in the data source must have a unique name. For example, in a DBMS the name may contain the schema name before the table name separated by a dot notation (".").
This method is thread-safe!
java.io.IOException - An exception can be thrown, if the dataset names could not be retrieved.public long getNumberOfDataSets()
throws java.io.IOException
This method is thread-safe!
java.io.IOException - An exception can be thrown, if the number of datasets could not be retrieved.public StrVector getPropertyNames(java.lang.String datasetName) throws java.io.IOException
Note that each dataset in the data source must have a unique name. For example, in a DBMS the name may contain the schema name before the table name separated by a dot notation (".").
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the property names of the dataset could not be retrieved.public long getNumberOfProperties(java.lang.String datasetName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the number of dataset properties could not be retrieved.public boolean propertyExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.name - The property name.java.io.IOException - An exception can be thrown, if the existence of the dataset property could not be obtained.public void dropProperty(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset from where the given property will be removed.name - The property to be removed from the dataset.java.io.IOException - An exception can be thrown, if the dataset property could not be removed.public void renameProperty(java.lang.String datasetName,
java.lang.String propertyName,
java.lang.String newPropertyName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset containing the property to be renamed.propertyName - The property to be renamed from the dataset.newPropertyName - The new property name.java.io.IOException - An exception can be thrown, if the dataset property could not be renamed.public boolean primaryKeyExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.name - The primary key name.java.io.IOException - An exception can be thrown, if the existence of the primary key could not be determined.public void dropPrimaryKey(java.lang.String datasetName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset from where the primary key will be removed.java.io.IOException - An exception can be thrown, if the primary key could not be dropped from the dataset schema.public StrVector getForeignKeyNames(java.lang.String datasetName) throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the foreign key names could not be retrieved.public boolean foreignKeyExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
datasetName - The dataset name.name - The foreign key name.java.io.IOException - An exception can be thrown, if the existence of the foreign key could not be obtained.public void dropForeignKey(java.lang.String datasetName,
java.lang.String fkName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset where the foreign key will be removed.fkName - The foreign key to be removed.java.io.IOException - An exception can be thrown, if the foreign key could not be removed from the dataset schema.public StrVector getUniqueKeyNames(java.lang.String datasetName) throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the unique key names could not be obtained.public boolean uniqueKeyExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.name - The unique key name.java.io.IOException - An exception can be thrown, if the existence of the unique key could not be determined.public void dropUniqueKey(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset from where the unique key will be removed.name - The unique key constraint name.java.io.IOException - An exception can be thrown, if the unique key could not be removed from the dataset schema.public StrVector getCheckConstraintNames(java.lang.String datasetName) throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the check constraint names could not be retrieved.public boolean checkConstraintExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.name - The check-constraint name.java.io.IOException - An exception can be thrown, if the existence of the check constraint could not be determined.public void dropCheckConstraint(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset from where the check constraint will be removed.name - The check constraint to be removed.java.io.IOException - An exception can be thrown, if the check constraint could not be removed from the dataset schema.public StrVector getIndexNames(java.lang.String datasetName) throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the index names could not be retrieved.public boolean indexExists(java.lang.String datasetName,
java.lang.String name)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.name - The index name.java.io.IOException - An exception can be thrown, if the index existence could not be determined.public void dropIndex(java.lang.String datasetName,
java.lang.String idxName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset where the index will be removed.idxName - The index to be removed.java.io.IOException - An exception can be thrown, if the index could not be removed from the dataset schema.public StrVector getSequenceNames() throws java.io.IOException
Note that each sequence in the data source must have a unique name. For example, in a DBMS the name may contain the schema name before the sequence name separated by a dot notation (".").
This method is thread-safe!
java.io.IOException - An exception can be thrown, if the sequence names could not be retrieved.public boolean sequenceExists(java.lang.String name)
throws java.io.IOException
This method is thread-safe!
name - The sequence name.java.io.IOException - An exception can be thrown, if the index existence could not be determined.public void dropSequence(java.lang.String name)
throws java.io.IOException
This method is thread-safe!
name - The sequence that will be removed.java.io.IOException - An exception can be thrown, if the sequence could not be removed from the data source.public long getNumberOfItems(java.lang.String datasetName)
throws java.io.IOException
This method is thread-safe!
datasetName - The dataset name.java.io.IOException - An exception can be thrown, if the number of items of the dataset could not be retrieved.public boolean hasDataSets()
throws java.io.IOException
This method is thread-safe!
java.io.IOException - An exception can be thrown, if it is not possible to check if the data source has datasets .public boolean dataSetExists(java.lang.String name)
throws java.io.IOException
This method is thread-safe!
name - The dataset name.java.io.IOException - An exception can be thrown, if the existence of a dataset in the data source could not be determined.public java.lang.String getGeometryTypeName(SWIGTYPE_p_te__gm__GeomType type)
public void cloneDataSet(java.lang.String name,
java.lang.String cloneName,
Str2StrMap options)
throws java.io.IOException
This method is thread-safe!
name - The dataset to be cloned.cloneName - The name of the cloned dataset.options - A list of optional modifiers. It is driver specific.java.io.IOException - An exception can be thrown, if the dataset schema could not be cloned.public void dropDataSet(java.lang.String name)
throws java.io.IOException
This method is thread-safe!
name - The dataset name whose schema will be removed from the data source.java.io.IOException - An exception can be thrown, if the dataset could not be removed from the data source.public void renameDataSet(java.lang.String name,
java.lang.String newName)
throws java.io.IOException
This method is thread-safe!
name - The name of the dataset to be renamed.newName - The new dataset name.java.io.IOException - An exception can be thrown, if the dataset could not be renamed.public static void drop(java.lang.String dsType,
java.lang.String connInfo)
throws java.io.IOException
java.io.IOExceptionpublic static boolean exists(java.lang.String dsType,
java.lang.String connInfo)
throws java.io.IOException
java.io.IOExceptionpublic static StrVector getDataSourceNames(java.lang.String dsType, java.lang.String connInfo) throws java.io.IOException
java.io.IOExceptionpublic DataSet newDataSet(java.lang.String name)
name - The name of the dataset.