Interface DataStore

All Superinterfaces:
org.gvsig.tools.observer.ComplexObservable, org.gvsig.tools.observer.ComplexWeakReferencingObservable, DataFactoryUnit, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.dynobject.DynObject, org.gvsig.tools.dynobject.DynObject_v2, org.gvsig.metadata.Metadata, org.gvsig.tools.observer.Observable, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.service.spi.Services, org.gvsig.tools.visitor.Visitable, org.gvsig.tools.observer.WeakReferencingObservable
All Known Subinterfaces:
CoverageStore, FeatureStore, RasterStore

public interface DataStore extends org.gvsig.tools.observer.ComplexWeakReferencingObservable, org.gvsig.tools.persistence.Persistent, org.gvsig.metadata.Metadata, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.visitor.Visitable, DataFactoryUnit, org.gvsig.tools.service.spi.Services, org.gvsig.tools.dynobject.DynObject_v2

This is the basic interface for all data stores. Depending on the context, it can represent a geographic layer, an alphanumeric database table or any data file. DataStore offers generic services like:

  • Open and close data stores
  • Access to data sets, with the possibility of loading data in background.
  • Use of selection and locks, as well as data sets
  • Editing
  • Register event observers through the Observable interface
  • Access to embedded data stores (like GML)
  • Information about the Spatial Reference Systems used by the data store


  • Field Details

    • SHAPE_PROVIDER_NAME

      static final String SHAPE_PROVIDER_NAME
      See Also:
    • DBASE_PROVIDER_NAME

      static final String DBASE_PROVIDER_NAME
      See Also:
    • CSV_PROVIDER_NAME

      static final String CSV_PROVIDER_NAME
      See Also:
    • H2SPATIAL_PROVIDER_NAME

      static final String H2SPATIAL_PROVIDER_NAME
      See Also:
    • GEOPACKAGE_PROVIDER_NAME

      static final String GEOPACKAGE_PROVIDER_NAME
      See Also:
    • MDB_PROVIDER_NAME

      static final String MDB_PROVIDER_NAME
      See Also:
    • TIFF_PROVIDER_NAME

      static final String TIFF_PROVIDER_NAME
      See Also:
    • METADATA_DEFINITION_NAME

      static final String METADATA_DEFINITION_NAME
      See Also:
    • FEATURE_METADATA_DEFINITION_NAME

      static final String FEATURE_METADATA_DEFINITION_NAME
      See Also:
    • SPATIAL_METADATA_DEFINITION_NAME

      static final String SPATIAL_METADATA_DEFINITION_NAME
      See Also:
    • METADATA_PROVIDER

      static final String METADATA_PROVIDER
      Metadata property name for the provider name provided by the data provider. This metadata is provided by all data providers.
      See Also:
    • METADATA_CONTAINERNAME

      static final String METADATA_CONTAINERNAME
      Metadata property name for Container name provided by the data provider. By explample, in a dbf file, this is the name of dbf. This metadata is provided by all data providers.
      See Also:
    • METADATA_FEATURETYPE

      static final String METADATA_FEATURETYPE
      Metadata property name for the feature type provided by the data provider. This metadata is provided by all tabular data providers.
      See Also:
    • METADATA_CRS

      static final String METADATA_CRS
      Metadata property name for CRS provided by the data provider. This metadata is only provided by data provider with spatial information.
      See Also:
    • METADATA_ENVELOPE

      static final String METADATA_ENVELOPE
      Metadata property name for Envelope provided by the data provider This metadata is only provided by data provider with spatial information.
      See Also:
  • Method Details

    • getFullNameQuietly

      static String getFullNameQuietly(DataStore store)
    • getNameQuietly

      static String getNameQuietly(DataStore store)
    • getName

      String getName()
      Returns the name associated to the store. This name is provided for informational purposes only. Explamples: In a dbf the filename without the path In a DDBB table the name of the table In a WFS layer the name of the layer.
      Returns:
      String containing this store's name.
    • getFullName

      String getFullName()
      Returns a more descriptive name for the store that getName. This name is provided for informational purposes only. Explamples: In a file based store may return the full name of the filename, path and filename. In a data base based store may return "server:dbname:tablename" In a WFS layer based store may return "server:layername"
      Returns:
      String Containing the full name of the store
    • getParameters

      DataStoreParameters getParameters()
      Return the of parameters of this store
      Returns:
      parameters of this store
    • getProviderName

      String getProviderName()
      Return the provider name that use this store.
      Returns:
      provider name of this store
    • refresh

      void refresh() throws DataException
      Refreshes this store state.
      Throws:
      DataException
    • getDataSet

      DataSet getDataSet() throws DataException
      Returns all available data.
      Returns:
      a set of data
      Throws:
      DataException - if there is any error while loading the data
    • getDataSet

      DataSet getDataSet(DataQuery dataQuery) throws DataException
      Returns a subset of data taking into account the properties and restrictions of the DataQuery.
      Parameters:
      dataQuery - defines the properties of the requested data
      Returns:
      a set of data
      Throws:
      DataException - if there is any error while loading the data
    • accept

      void accept(org.gvsig.tools.visitor.Visitor visitor) throws org.gvsig.tools.exception.BaseException
      Provides each value of this Store to the provided Visitor. The values received through the Visitor.visit(Object) method may be transient, reused or externally modifiable, so they can't be used to be stored in any external form out of the visit method. If you need to store any of the values out of the Visitor.visit(Object) method execution, create a copy or clone the received value in order to be stored.
      Specified by:
      accept in interface org.gvsig.tools.visitor.Visitable
      Parameters:
      visitor - the visitor to apply to each value.
      Throws:
      org.gvsig.tools.exception.BaseException - if there is an error while performing the visit
    • accept

      void accept(org.gvsig.tools.visitor.Visitor visitor, DataQuery dataQuery) throws org.gvsig.tools.exception.BaseException
      Provides each value of this Store to the provided Visitor. The values received through the Visitor.visit(Object) method may be transient, reused or externally modifiable, so they can't be used to be stored in any external form out of the visit method. If you need to store any of the values out of the Visitor.visit(Object) method execution, create a copy or clone the received value in order to be stored.
      Parameters:
      visitor - the visitor to apply to each value.
      dataQuery - defines the properties of the data to visit
      Throws:
      org.gvsig.tools.exception.BaseException - if there is an error while performing the visit
    • getDataSet

      void getDataSet(org.gvsig.tools.observer.Observer observer) throws DataException
      Loads all available data and notifies the observer for each loaded block of data.
      Parameters:
      observer - to be notified for each block of data loaded
      Throws:
      DataException - if there is any error while loading the data
    • getDataSet

      void getDataSet(DataQuery dataQuery, org.gvsig.tools.observer.Observer observer) throws DataException
      Loads a subset of data taking into account the properties and restrictions of the DataQuery. Data loading is performed by calling the Observer, once each data block is loaded.
      Parameters:
      dataQuery - defines the properties of the requested data
      observer - to be notified for each block of data loaded
      Throws:
      DataException - if there is any error while loading the data
    • getSelection

      DataSet getSelection() throws DataException
      Returns the selected set of data
      Returns:
      DataSet
      Throws:
      DataException
    • setSelection

      void setSelection(DataSet selection) throws DataException
      Sets the current data selection with the given data set.
      Parameters:
      selection -
      Throws:
      DataException
    • createSelection

      DataSet createSelection() throws DataException
      Creates a new selection.
      Returns:
      DataSet that contains the selection
      Throws:
      DataException
    • getChildren

      org.gvsig.tools.util.UnmodifiableBasicMap<String,DataStore> getChildren()
      Returns an UnmodifiableBasicMap with this store children. If do not have children, return an empty map. Never returns null.
      Returns:
      an UnmodifiableBasicMap with this DataStore children
    • getExplorer

      Returns the DataServerExplorer to which this DataStore belongs, if there is any. This server explorer can be disposed.
      Returns:
      DataServerExplorer to which this DataStore belongs, or null if this was not accessed through any DataServerExplorer.
      Throws:
      DataException
      ValidateDataParametersException
    • createQuery

      DataQuery createQuery()
      Returns a new instance of a DataQuery.
      Returns:
      new DataQuery instance.
    • getInterval

      org.gvsig.timesupport.Interval getInterval()
      Gets the Interval of the store, that means the temporal interval where the store has valid data.
      Returns:
      a time interval or null if there is not time support
    • getTimes

      Collection getTimes()
      Gets all the possible values of time for which the store has data.
      Returns:
      a collection of Time objects.
    • getTimes

      Collection getTimes(org.gvsig.timesupport.Interval interval)
      Gets all the possible values of time for which the store has data and intersects with an interval.
      Parameters:
      interval - the interval of time
      Returns:
      a collection of Time objects.
    • useCache

      void useCache(String providerName, org.gvsig.tools.dynobject.DynObject parameters) throws DataException
      Parameters:
      providerName -
      parameters -
      Throws:
      DataException
    • getProviderFactory

      DataStoreProviderFactory getProviderFactory()
    • getCache

      DataCache getCache()
      Returns:
    • getResourcesStorage

      org.gvsig.tools.resourcesstorage.ResourcesStorage getResourcesStorage()
    • getStoresRepository

      StoresRepository getStoresRepository()