Class RepositoryResolvingDataAccess<T extends FeatureType,F extends Feature>
- Object
-
- RepositoryResolvingDataAccess<T,F>
-
- Type Parameters:
T- feature typeF- feature
- All Implemented Interfaces:
DataAccess<T,F>
public final class RepositoryResolvingDataAccess<T extends FeatureType,F extends Feature> extends Object implements DataAccess<T,F>
A DataAccess wrapper that does not keep a hard reference to the delegate. Instead, it resolves the delegate from a Repository and store Name on demand.
-
-
Constructor Summary
Constructors Constructor Description RepositoryResolvingDataAccess(Repository repository, Name storeName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSchema(T featureType)Creates storage for a newfeatureType.voiddispose()Disposes of this data store and releases any resource that it is using.FeatureSource<T,F>getFeatureSource(Name typeName)Access to the named resource.ServiceInfogetInfo()Information about this service.List<Name>getNames()Names of the available Resources.RepositorygetRepository()TgetSchema(Name name)Description of the named resource.NamegetStoreName()voidremoveSchema(Name typeName)Used to permanently remove a schema from the underlying storagevoidupdateSchema(Name typeName, T featureType)Used to update a schema in place.
-
-
-
Constructor Detail
-
RepositoryResolvingDataAccess
public RepositoryResolvingDataAccess(Repository repository, Name storeName)
-
-
Method Detail
-
getRepository
public Repository getRepository()
-
getStoreName
public Name getStoreName()
-
createSchema
public void createSchema(T featureType) throws IOException
Description copied from interface:DataAccessCreates storage for a newfeatureType.The provided
featureTypewe be accessable by the typeName provided by featureType.getTypeName().- Specified by:
createSchemain interfaceDataAccess<T extends FeatureType,F extends Feature>- Parameters:
featureType- FetureType to add to DataStore- Throws:
IOException- If featureType cannot be created
-
getInfo
public ServiceInfo getInfo()
Description copied from interface:DataAccessInformation about this service.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).
- Specified by:
getInfoin interfaceDataAccess<T extends FeatureType,F extends Feature>- Returns:
- SeviceInfo
-
getNames
public List<Name> getNames() throws IOException
Description copied from interface:DataAccessNames of the available Resources.For additional information please see getInfo( Name ) and getSchema( Name ).
- Specified by:
getNamesin interfaceDataAccess<T extends FeatureType,F extends Feature>- Returns:
- Names of the available contents.
- Throws:
IOException
-
getSchema
public T getSchema(Name name) throws IOException
Description copied from interface:DataAccessDescription of the named resource.The FeatureType returned describes the contents being published. For additional metadata please review getInfo( Name ).
- Specified by:
getSchemain interfaceDataAccess<T extends FeatureType,F extends Feature>- Parameters:
name- Type name a the resource from getNames()- Returns:
- Description of the FeatureType being made avaialble
- Throws:
IOException
-
getFeatureSource
public FeatureSource<T,F> getFeatureSource(Name typeName) throws IOException
Description copied from interface:DataAccessAccess to the named resource.The level of access is represented by the instance of the FeatureSource being returned.
Formally:
- FeatureSource - read-only access
- FeatureStore - read-write access
- FetureLocking - concurrency control
-
Additional interfaces may be supported by the implementation you are using.
- Specified by:
getFeatureSourcein interfaceDataAccess<T extends FeatureType,F extends Feature>- Returns:
- Access to the named resource being made available
- Throws:
IOException
-
updateSchema
public void updateSchema(Name typeName, T featureType) throws IOException
Description copied from interface:DataAccessUsed to update a schema in place.This functionality is similar to an "alter table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
- Specified by:
updateSchemain interfaceDataAccess<T extends FeatureType,F extends Feature>- Throws:
IOException- if the operation failed
-
removeSchema
public void removeSchema(Name typeName) throws IOException
Description copied from interface:DataAccessUsed to permanently remove a schema from the underlying storageThis functionality is similar to an "drop table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
- Specified by:
removeSchemain interfaceDataAccess<T extends FeatureType,F extends Feature>- Throws:
IOException- if the operation failed
-
dispose
public void dispose()
Description copied from interface:DataAccessDisposes of this data store and releases any resource that it is using.A
DataStorecannot be used afterdisposehas been called, neither can any data access object it helped create, such asFeatureReader,FeatureSourceorFeatureCollection.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.
- Specified by:
disposein interfaceDataAccess<T extends FeatureType,F extends Feature>
-
-