org.gvsig.fmap.dal
Interface DataStore

All Superinterfaces:
ComplexObservable, ComplexWeakReferencingObservable, Disposable, DynObject, Metadata, Observable, Persistent, Visitable, WeakReferencingObservable
All Known Subinterfaces:
CoverageStore, FeatureStore

public interface DataStore
extends ComplexWeakReferencingObservable, Persistent, Metadata, Disposable, Visitable

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:



Field Summary
static String FEATURE_METADATA_DEFINITION_NAME
           
static String METADATA_CONTAINERNAME
          Metadata property name for Container name provided by the data provider.
static String METADATA_CRS
          Metadata property name for CRS provided by the data provider.
static String METADATA_DEFINITION_NAME
           
static String METADATA_ENVELOPE
          Metadata property name for Envelope provided by the data provider This metadata is only provided by data provider with spatial information.
static String METADATA_FEATURETYPE
          Metadata property name for the feature type provided by the data provider.
static String METADATA_PROVIDER
          Metadata property name for the provider name provided by the data provider.
static String SPATIAL_METADATA_DEFINITION_NAME
           
 
Method Summary
 void accept(Visitor visitor)
          Provides each value of this Store to the provided Visitor.
 void accept(Visitor visitor, DataQuery dataQuery)
          Provides each value of this Store to the provided Visitor.
 DataQuery createQuery()
          Returns a new instance of a DataQuery.
 DataSet createSelection()
          Creates a new selection.
 Iterator getChildren()
          Returns an iterator over this store children
 DataSet getDataSet()
          Returns all available data.
 DataSet getDataSet(DataQuery dataQuery)
          Returns a subset of data taking into account the properties and restrictions of the DataQuery.
 void getDataSet(DataQuery dataQuery, Observer observer)
          Loads a subset of data taking into account the properties and restrictions of the DataQuery.
 void getDataSet(Observer observer)
          Loads all available data and notifies the observer for each loaded block of data.
 DataServerExplorer getExplorer()
          Returns the DataServerExplorer to which this DataStore belongs, if there is any.
 String getFullName()
          Returns a more descriptive name for the store that getName.
 org.gvsig.timesupport.Interval getInterval()
          Gets the Interval of the store, that means the temporal interval where the store has valid data.
 String getName()
          Returns the name associated to the store.
 DataStoreParameters getParameters()
          Return the of parameters of this store
 String getProviderName()
          Return the provider name that use this store.
 DataSet getSelection()
          Returns the selected set of data
 Collection getTimes()
          Gets all the possible values of time for which the store has data.
 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.
 void refresh()
          Refreshes this store state.
 void setSelection(DataSet selection)
          Sets the current data selection with the given data set.
 
Methods inherited from interface org.gvsig.tools.observer.ComplexObservable
beginComplexNotification, disableNotifications, enableNotifications, endComplexNotification
 
Methods inherited from interface org.gvsig.tools.observer.Observable
addObserver, deleteObserver, deleteObservers
 
Methods inherited from interface org.gvsig.tools.persistence.Persistent
loadFromState, saveToState
 
Methods inherited from interface org.gvsig.metadata.Metadata
getMetadataChildren, getMetadataID, getMetadataName
 
Methods inherited from interface org.gvsig.tools.dynobject.DynObject
clear, delegate, getDynClass, getDynValue, hasDynValue, implement, invokeDynMethod, invokeDynMethod, setDynValue
 
Methods inherited from interface org.gvsig.tools.dispose.Disposable
dispose
 

Field Detail

METADATA_DEFINITION_NAME

static final String METADATA_DEFINITION_NAME
See Also:
Constant Field Values

FEATURE_METADATA_DEFINITION_NAME

static final String FEATURE_METADATA_DEFINITION_NAME
See Also:
Constant Field Values

SPATIAL_METADATA_DEFINITION_NAME

static final String SPATIAL_METADATA_DEFINITION_NAME
See Also:
Constant Field Values

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:
Constant Field Values

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:
Constant Field Values

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:
Constant Field Values

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:
Constant Field Values

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:
Constant Field Values
Method Detail

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(Visitor visitor)
            throws 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 Visitable
Parameters:
visitor - the visitor to apply to each value.
Throws:
BaseException - if there is an error while performing the visit

accept

void accept(Visitor visitor,
            DataQuery dataQuery)
            throws 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:
BaseException - if there is an error while performing the visit

getDataSet

void getDataSet(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,
                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:
DataSet - selection
Throws:
DataException

createSelection

DataSet createSelection()
                        throws DataException
Creates a new selection.

Returns:
DataSet that contains the selection
Throws:
DataException

getChildren

Iterator getChildren()
Returns an iterator over this store children

Returns:
Iterator over this DataStore children

getExplorer

DataServerExplorer getExplorer()
                               throws DataException,
                                      ValidateDataParametersException
Returns the DataServerExplorer to which this DataStore belongs, if there is any.

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.
Throws:
DataException

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.


Copyright © 2004-2012 gvSIG. All Rights Reserved.