Package org.geotools

Class RepositoryResolvingDataAccess<T extends FeatureType,​F extends Feature>

  • Type Parameters:
    T - feature type
    F - 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 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: DataAccess
        Creates storage for a new featureType.

        The provided featureType we be accessable by the typeName provided by featureType.getTypeName().

        Specified by:
        createSchema in interface DataAccess<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: DataAccess
        Information 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:
        getInfo in interface DataAccess<T extends FeatureType,​F extends Feature>
        Returns:
        SeviceInfo
      • getSchema

        public T getSchema​(Name name)
                    throws IOException
        Description copied from interface: DataAccess
        Description of the named resource.

        The FeatureType returned describes the contents being published. For additional metadata please review getInfo( Name ).

        Specified by:
        getSchema in interface DataAccess<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: DataAccess
        Access 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:
        getFeatureSource in interface DataAccess<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: DataAccess
        Used 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:
        updateSchema in interface DataAccess<T extends FeatureType,​F extends Feature>
        Throws:
        IOException - if the operation failed
      • removeSchema

        public void removeSchema​(Name typeName)
                          throws IOException
        Description copied from interface: DataAccess
        Used to permanently remove a schema from the underlying storage

        This 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:
        removeSchema in interface DataAccess<T extends FeatureType,​F extends Feature>
        Throws:
        IOException - if the operation failed
      • dispose

        public void dispose()
        Description copied from interface: DataAccess
        Disposes of this data store and releases any resource that it is using.

        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.

        Specified by:
        dispose in interface DataAccess<T extends FeatureType,​F extends Feature>