Package org.gvsig.fmap.dal
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringMetadata property name for Container name provided by the data provider.static final StringMetadata property name for CRS provided by the data provider.static final Stringstatic final StringMetadata property name for Envelope provided by the data provider This metadata is only provided by data provider with spatial information.static final StringMetadata property name for the feature type provided by the data provider.static final StringMetadata property name for the provider name provided by the data provider.static final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.gvsig.tools.visitor.Visitor visitor) Provides each value of this Store to the providedVisitor.voidProvides each value of this Store to the providedVisitor.Returns a new instance of aDataQuery.Creates a new selection.getCache()Returns an UnmodifiableBasicMap with this store children.Returns all available data.getDataSet(DataQuery dataQuery) Returns a subset of data taking into account the properties and restrictions of the DataQuery.voidgetDataSet(DataQuery dataQuery, org.gvsig.tools.observer.Observer observer) Loads a subset of data taking into account the properties and restrictions of the DataQuery.voidgetDataSet(org.gvsig.tools.observer.Observer observer) Loads all available data and notifies the observer for each loaded block of data.Returns the DataServerExplorer to which this DataStore belongs, if there is any.Returns a more descriptive name for the store that getName.static StringgetFullNameQuietly(DataStore store) org.gvsig.timesupport.IntervalGets theIntervalof the store, that means the temporal interval where the store has valid data.getName()Returns the name associated to the store.static StringgetNameQuietly(DataStore store) Return the of parameters of this storeReturn the provider name that use this store.org.gvsig.tools.resourcesstorage.ResourcesStorageReturns the selected set of datagetTimes()Gets all the possible values of time for which the store has data.getTimes(org.gvsig.timesupport.Interval interval) Gets all the possible values of time for which the store has data and intersects with an interval.voidrefresh()Refreshes this store state.voidsetSelection(DataSet selection) Sets the current data selection with the given data set.voidMethods inherited from interface org.gvsig.tools.observer.ComplexObservable
beginComplexNotification, disableNotifications, enableNotifications, endComplexNotificationMethods inherited from interface org.gvsig.tools.dispose.Disposable
disposeMethods inherited from interface org.gvsig.tools.dynobject.DynObject
clear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValueMethods inherited from interface org.gvsig.tools.dynobject.DynObject_v2
hasDynMethodMethods inherited from interface org.gvsig.metadata.Metadata
getMetadataChildren, getMetadataID, getMetadataNameMethods inherited from interface org.gvsig.tools.observer.Observable
addObserver, deleteObserver, deleteObserversMethods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToState
-
Field Details
-
SHAPE_PROVIDER_NAME
- See Also:
-
DBASE_PROVIDER_NAME
- See Also:
-
CSV_PROVIDER_NAME
- See Also:
-
H2SPATIAL_PROVIDER_NAME
- See Also:
-
GEOPACKAGE_PROVIDER_NAME
- See Also:
-
MDB_PROVIDER_NAME
- See Also:
-
TIFF_PROVIDER_NAME
- See Also:
-
METADATA_DEFINITION_NAME
- See Also:
-
FEATURE_METADATA_DEFINITION_NAME
- See Also:
-
SPATIAL_METADATA_DEFINITION_NAME
- See Also:
-
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
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
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
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
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
-
getNameQuietly
-
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
Refreshes this store state.- Throws:
DataException
-
getDataSet
Returns all available data.- Returns:
- a set of data
- Throws:
DataException- if there is any error while loading the data
-
getDataSet
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 providedVisitor. The values received through theVisitor.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 theVisitor.visit(Object)method execution, create a copy or clone the received value in order to be stored.- Specified by:
acceptin interfaceorg.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 providedVisitor. The values received through theVisitor.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 theVisitor.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
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 dataobserver- to be notified for each block of data loaded- Throws:
DataException- if there is any error while loading the data
-
getSelection
Returns the selected set of data- Returns:
- DataSet
- Throws:
DataException
-
setSelection
Sets the current data selection with the given data set.- Parameters:
selection-- Throws:
DataException
-
createSelection
Creates a new selection.- Returns:
- DataSet that contains the selection
- Throws:
DataException
-
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
nullif this was not accessed through any DataServerExplorer. - Throws:
DataExceptionValidateDataParametersException
-
createQuery
DataQuery createQuery()Returns a new instance of aDataQuery.- Returns:
- new
DataQueryinstance.
-
getInterval
org.gvsig.timesupport.Interval getInterval()Gets theIntervalof 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
Timeobjects.
-
getTimes
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
Timeobjects.
-
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()
-