T
- Type of Feature Content, may be SimpleFeatureTypeF
- Feature Content, may be SimpleFetaurepublic interface DataAccess<T extends FeatureType,F extends Feature>
FeatureData
.
DataAccess.getInfo()
- information about the file or server itself
DataAccess.getNames()
- list of the available contents (each is an individual
resource)
DataAccess.getSchema( Name )
- FeatureType describing the information available in
the named resource
FeatureSource
: read-only api similar to the WFS getFeature operations. Please note
the reutrned FeatureCollection may be *lazy*; for many implementations no actual access
will occur until you use the FetaureCollection for the first time.
FeatureStore
: read/write api similar to the WFS Transaction operation. Batch
changes such as addFeatures, modifyFeatures and removeFeatures are supported.
FeatureLocking
: concurrency control; the Data Access API is thread safe; one
consequence of this is modifications being held up while other threads read the contents.
You may wish to Lock a selection of features for your exclusive use. Locks are timed; and
will expire after the indicated period.
Please note that all interaction occurs within the context of a Transaction, this facility provides session management and is strongly advised. Please note that your application is responsible for managing its own Transactions; as an example they are often associated with a single Map in a desktop application; or a single session in a J2EE web app.
The use of Transaction.AUTO_COMMIT is suitable for read-only access when you wish to minimize the number of connections in use, when used for writing performance will often be terrible.
Applications are responsible for holding a single instance to the service or file, The DataAccess implementations will hold onto database connections, internal caches and so on - and as such should not be duplicated.
Modifier and Type | Method and Description |
---|---|
void |
createSchema(T featureType)
Creates storage for a new
featureType . |
void |
dispose()
Disposes of this data store and releases any resource that it is using.
|
FeatureSource<T,F> |
getFeatureSource(Name typeName)
Access to the named resource.
|
ServiceInfo |
getInfo()
Information about this service.
|
List<Name> |
getNames()
Names of the available Resources.
|
T |
getSchema(Name name)
Description of the named resource.
|
void |
removeSchema(Name typeName)
Used to permanently remove a schema from the underlying storage
This functionality is similar to an "drop table" statement in SQL.
|
void |
updateSchema(Name typeName,
T featureType)
Used to update a schema in place.
|
ServiceInfo getInfo()
This method offers access to a summary of header or metadata information describing the service. Subclasses may return a specific ServiceInfo instance that has additional information (such as FilterCapabilities).
void createSchema(T featureType) throws IOException
featureType
.
The provided featureType
we be accessable by the typeName provided by
featureType.getTypeName().
featureType
- FetureType to add to DataStoreIOException
- If featureType cannot be createdvoid updateSchema(Name typeName, T featureType) throws IOException
This functionality is similar to an "alter table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
typeName
- featureType
- IOException
- if the operation failedUnsupportedOperation
- if functionality is not availablevoid removeSchema(Name typeName) throws IOException
This functionality is similar to an "drop table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
typeName
- IOException
- if the operation failedUnsupportedOperation
- if functionality is not availableList<Name> getNames() throws IOException
For additional information please see getInfo( Name ) and getSchema( Name ).
IOException
T getSchema(Name name) throws IOException
The FeatureType returned describes the contents being published. For additional metadata please review getInfo( Name ).
name
- Type name a the resource from getNames()IOException
FeatureSource<T,F> getFeatureSource(Name typeName) throws IOException
The level of access is represented by the instance of the FeatureSource being returned.
Formally:
typeName
- IOException
void dispose()
A DataStore
cannot be used after dispose
has been called,
neither can any data access object it helped create, such as FeatureReader
, FeatureSource
or FeatureCollection
.
This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
Copyright © 1996–2019 Geotools. All rights reserved.