public class DefaultFeatureStore extends AbstractDisposable implements DataStoreInitializer2, FeatureStoreProviderServices, FeatureStore, Observer
BASE_NEWPARAMETERS_PROVIDER_DEFINITION_FULLNAME, BASE_NEWPARAMETERS_PROVIDER_DEFINITION_NAME, BASE_PARAMETERS_PROVIDER_DEFINITION_FULLNAME, BASE_PARAMETERS_PROVIDER_DEFINITION_NAME, PROVIDER_PARAMTER_FULLNAME, PROVIDER_PARAMTER_NAME
METADATA_DEFINITION_NAME, MODE_APPEND, MODE_FULLEDIT, MODE_QUERY
FEATURE_METADATA_DEFINITION_NAME, METADATA_CONTAINERNAME, METADATA_CRS, METADATA_ENVELOPE, METADATA_FEATURETYPE, METADATA_PROVIDER, SPATIAL_METADATA_DEFINITION_NAME
Constructor and Description |
---|
DefaultFeatureStore() |
Modifier and Type | Method and Description |
---|---|
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 . |
void |
addObserver(Observer observer) |
boolean |
allowWrite()
Indicates whether this store allows writing.
|
void |
beginComplexNotification()
Sets the Observable in complex notification mode.
|
void |
beginEditingGroup(String description)
Initiates an editing group.
|
void |
cancelEditing()
Cancels all editing since the last edit().
|
boolean |
canCommitChanges()
Returns true if you can call CommitChanges method.
|
boolean |
canRedo()
If a redo can be performed on the stack.
|
boolean |
canUndo()
If an undo can be performed on the stack.
|
boolean |
canWriteGeometry(int geometryType) |
void |
clear() |
Object |
clone()
Creates a copy of the object.
|
void |
close() |
void |
commitChanges()
Save changes in the provider without leaving the edit mode.
|
void |
createCache(String name,
DynObject parameters) |
FeatureProvider |
createDefaultFeatureProvider(FeatureType type)
Create a new instance of default implementation of a
FeatureProvider |
FeatureSelection |
createDefaultFeatureSelection()
Create a new instance of default implementation of a
FeatureSelection |
ExpressionBuilder |
createExpression() |
ExpressionBuilder |
createExpressionBuilder() |
Feature |
createFeature(FeatureProvider data)
Create a
Feature instance for FeatureProvider
data
NOTE: Normaly Providers must use FeatureProvider instances instead Feature |
Feature |
createFeature(FeatureProvider data,
FeatureType type) |
FeatureQuery |
createFeatureQuery()
Returns a new
FeatureQuery associated to this store. |
FeatureSelection |
createFeatureSelection()
Creates a
FeatureSelection |
EditableFeatureType |
createFeatureType()
Creates a new instance of EditableFeatureType.
|
EditableFeatureType |
createFeatureType(String id)
Creates a new instance of EditableFeatureType.
|
FeatureIndex |
createIndex(FeatureType featureType,
String attributeName,
String indexName)
Creates an index which will be applied to the features of the given type,
by using the data of the given attribute.
|
FeatureIndex |
createIndex(FeatureType featureType,
String attributeName,
String indexName,
Observer observer)
Creates an index which will be applied to the features of the given type,
by using the data of the given attribute.
|
FeatureIndex |
createIndex(String indexTypeName,
FeatureType featureType,
String attributeName,
String indexName)
Creates an index which will be applied to the features of the given type,
by using the data of the given attribute.
|
FeatureIndex |
createIndex(String indexTypeName,
FeatureType featureType,
String attributeName,
String indexName,
Observer observer)
Creates an index which will be applied to the features of the given type,
by using the data of the given attribute.
|
EditableFeature |
createNewFeature()
Creates a new feature using the default feature type and returns it as an
EditableFeature |
EditableFeature |
createNewFeature(boolean defaultValues)
Creates a new feature of default
FeatureType . |
EditableFeature |
createNewFeature(Feature defaultValues)
Creates a new feature of default
FeatureType . |
EditableFeature |
createNewFeature(FeatureType type,
boolean defaultValues)
Creates a new feature of the given
FeatureType . |
EditableFeature |
createNewFeature(FeatureType type,
Feature defaultValues)
Creates a new feature of the given
FeatureType and uses the given
Feature as default values to initialize it. |
DataQuery |
createQuery()
Returns a new instance of a
DataQuery . |
DataSet |
createSelection()
Creates a new selection.
|
void |
delegate(DynObject dynObject) |
void |
delete(Feature feature)
Deletes a
Feature from the store. |
void |
deleteObserver(Observer observer) |
void |
deleteObservers() |
void |
disableNotifications()
Disable the notification of events to registered Observers.
|
void |
doDelete(Feature feature) |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
doInsert(EditableFeature feature) |
void |
doUpdate(EditableFeature feature,
Feature oldFeature) |
void |
edit()
Enters editing state.
|
void |
edit(int mode)
Enters editing state specifying the editing mode.
|
void |
enableNotifications()
Enable (default) the notification of events to registered Observers.
|
void |
endComplexNotification()
Ends the complex notification mode.
|
void |
endEditingGroup()
Finishes an editing group.
|
void |
export(DataServerExplorer explorer,
String provider,
NewFeatureStoreParameters params)
Exports this store to another store.
|
FeatureSet |
features() |
void |
finishEditing()
Exits editing state.
|
Throwable |
getBreakingsCause() |
FeatureCache |
getCache() |
Iterator |
getChildren()
Returns an iterator over this store children
|
FeatureCommandsStack |
getCommandsStack() |
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.
|
FeatureType |
getDefaultFeatureType()
Return default
FeatureType of the store |
DynClass |
getDynClass() |
Object |
getDynValue(String name) |
Envelope |
getEnvelope()
Returns this store's total envelope (extent).
|
DataServerExplorer |
getExplorer()
Returns the DataServerExplorer to which this DataStore belongs, if there
is any.
|
Feature |
getFeature(DynObject dynobject)
Return the associated feature to the dynobject.
|
Feature |
getFeatureByReference(FeatureReference reference)
Returns the feature given its reference.
|
Feature |
getFeatureByReference(FeatureReference reference,
FeatureType featureType)
Returns the feature given its reference and feature type.
|
long |
getFeatureCount()
Returns featue count of this store.
|
FeatureManager |
getFeatureManager() |
FeatureProvider |
getFeatureProviderFromFeature(Feature feature)
Extract
FeatureProvider from a Feature instance. |
List<Feature> |
getFeatures() |
List<Feature> |
getFeatures(FeatureQuery query) |
List<Feature> |
getFeatures(FeatureQuery query,
int pageSize)
Return a paginated list of Features filtered by the query.
|
FeatureSelection |
getFeatureSelection()
Returns the current
FeatureSelection . |
FeatureSet |
getFeatureSet()
Returns all available features in the store.
|
FeatureSet |
getFeatureSet(FeatureQuery featureQuery)
Returns a subset of features taking into account the properties and
restrictions of the FeatureQuery.
|
void |
getFeatureSet(FeatureQuery query,
Observer observer)
Loads a subset of features taking into account the properties and
restrictions of the FeatureQuery.
|
void |
getFeatureSet(Observer observer)
Loads all available feature in the store.
|
FeatureSet |
getFeatureSet(String filter) |
FeatureSet |
getFeatureSet(String filter,
String sortBy) |
FeatureSet |
getFeatureSet(String filter,
String sortBy,
boolean asc) |
FeatureStore |
getFeatureStore()
Return current FeatureStore
|
FeatureType |
getFeatureType(FeatureQuery featureQuery) |
FeatureType |
getFeatureType(String featureTypeId)
Returns this store's featureType
FeatureType matches with
featureTypeId. |
FeatureTypeManager |
getFeatureTypeManager() |
List |
getFeatureTypes()
Returns this store's
FeatureType (s). |
String |
getFullName()
Returns a more descriptive name for the store that getName.
|
FeatureIndexes |
getIndexes()
Returns a FeatureIndexes structure containing all available indexes in
the store.
|
Interval |
getInterval()
Gets the
Interval of the store, that means the temporal
interval where the store has valid data. |
FeatureLocks |
getLocks()
Returns the set of locked features
|
DataManager |
getManager()
Reaturn
DataManager instance. |
Set |
getMetadataChildren()
Returns an unsorted set of child Metadata objects.
|
Object |
getMetadataID()
Returns the unique identifier of the Metadata.
|
String |
getMetadataName()
Returns the name of the Metadata, which allows to identify the type in
the Metadata registry.
|
int |
getMode() |
String |
getName()
Returns the name associated to the store.
|
DataStoreParameters |
getParameters()
Return the of parameters of this store
|
FeatureStoreProvider |
getProvider()
Return the instance of
FeatureStoreProvider for this store. |
FeatureType |
getProviderDefaultFeatureType() |
DataStoreProviderFactory |
getProviderFactory() |
FeatureType |
getProviderFeatureType(String featureTypeId)
Return original
FeatureType of FeatureStoreProvider . |
List |
getProviderFeatureTypes() |
String |
getProviderName()
Return the provider name that use this store.
|
List |
getRedoInfos()
Returns the list of UndoRedoInfo in the REDO stack
|
int |
getRetrievedFeaturesLimit()
If the
FeatureStoreProvider#hasRetrievedFeaturesLimit() returns
true,
it returns the limit of features retrieved from the provider. |
DataSet |
getSelection()
Returns the selected set of data
|
IProjection |
getSRSDefaultGeometry()
Deprecated.
use getDefaultFeatureType().getDefaultSRS()
|
DataStore |
getStore()
Return the Store instance
|
DataStoreProviderServices |
getStoreProviderServices() |
Collection |
getTimes()
Gets all the possible values of time for which the store has data.
|
Collection |
getTimes(Interval interval)
Gets all the possible values of time for which the store has data
and intersects with an interval.
|
FeatureStoreTransforms |
getTransforms()
Returns this store transforms
|
List |
getUndoInfos()
Returns the list of UndoRedoInfo in the UNDO stack
|
boolean |
hasDynMethod(String name) |
boolean |
hasDynValue(String name) |
boolean |
hasRetrievedFeaturesLimit()
Return if the maximum number of features provided by the
provider are limited.
|
void |
implement(DynClass dynClass) |
void |
insert(EditableFeature feature)
Inserts a
Feature in the store. |
void |
intialize(DataManager dataManager,
DataStoreParameters parameters) |
Object |
invokeDynMethod(int code,
Object[] args) |
Object |
invokeDynMethod(String name,
Object[] args) |
boolean |
isAppending()
Indicates whether this store is in appending state.
|
boolean |
isAppendModeSupported()
Indicates whether this store supports append mode.
|
boolean |
isBroken() |
boolean |
isEditing()
Indicates whether this store is in editing state.
|
boolean |
isKnownEnvelope()
Return if the provider knows the real envelope of a layer.
|
boolean |
isLocksSupported()
Indicates whether this store supports locks.
|
Iterator |
iterator() |
void |
loadFromState(PersistentState persistentState)
Set the state of the object from the state passed as parameter.
|
void |
notifyChange(FeatureStoreNotification storeNotification)
Call this to send a notification to observers of this store
|
void |
notifyChange(String notification)
Call this to send a notification to observers of this store
|
void |
notifyChange(String notification,
Command command) |
void |
notifyChange(String notification,
EditableFeatureType type) |
void |
notifyChange(String notification,
Feature feature) |
void |
notifyChange(String notification,
FeatureProvider data)
Call this to send a notification to observers of this store
|
void |
notifyChange(String notification,
Resource resource)
Call this to send a notification to observers of this store relative to
Resources
|
void |
open() |
void |
redo()
Re-does the following redoable elements.
|
void |
redo(int num)
Re-does a number of the following redoable element.
|
void |
refresh()
Refreshes this store state.
|
static void |
registerMetadataDefinition() |
static void |
registerPersistenceDefinition() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setDynValue(String name,
Object value) |
void |
setFeatureTypes(List types,
FeatureType defaultType)
Sets
FeatureType available from this store. |
void |
setProvider(DataStoreProvider provider) |
void |
setSelection(DataSet selection)
Sets the current data selection with the given data set.
|
void |
setSelection(FeatureSet selection)
Sets the selection to the passed
FeatureSet |
void |
setSelection(FeatureSet selection,
boolean undoable) |
void |
setTimeSupport(FeatureStoreTimeSupport timeSupport) |
void |
undo()
Undoes the following undoable elements.
|
void |
undo(int num)
Undoes a number of the following undoable elements.
|
void |
update(EditableFeature feature)
Updates a
Feature in the store with the changes in the
EditableFeature . |
void |
update(EditableFeatureType type)
Updates a
FeatureType in the store with the changes in the
EditableFeatureType . |
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
void |
useCache(String providerName,
DynObject parameters) |
void |
validateFeatures(int mode)
Applies the validation rules associated to the given mode to the active
FeatureSet . |
SpatialIndex |
wrapSpatialIndex(SpatialIndex index) |
dispose, dispose
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
public void intialize(DataManager dataManager, DataStoreParameters parameters) throws InitializeException
intialize
in interface DataStoreInitializer2
InitializeException
public void setProvider(DataStoreProvider provider)
setProvider
in interface DataStoreInitializer2
public DataStoreParameters getParameters()
DataStore
getParameters
in interface DataStore
getParameters
in interface FeatureStore
public int getMode()
public DataManager getManager()
FeatureStoreProviderServices
DataManager
instance.getManager
in interface FeatureStoreProviderServices
public Iterator getChildren()
DataStore
getChildren
in interface DataStore
public FeatureStoreProvider getProvider()
FeatureStoreProviderServices
FeatureStoreProvider
for this store.getProvider
in interface FeatureStoreProviderServices
public FeatureManager getFeatureManager()
public void setFeatureTypes(List types, FeatureType defaultType)
FeatureStoreProviderServices
setFeatureTypes
in interface FeatureStoreProviderServices
public void open() throws OpenException
OpenException
public void refresh() throws OpenException, InitializeException
DataStore
refresh
in interface DataStore
OpenException
InitializeException
public void close() throws CloseException
CloseException
protected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public boolean allowWrite()
FeatureStore
allowWrite
in interface FeatureStore
public boolean canWriteGeometry(int geometryType) throws DataException
canWriteGeometry
in interface FeatureStore
DataException
public DataServerExplorer getExplorer() throws ReadException, ValidateDataParametersException
DataStore
getExplorer
in interface DataStore
null
if this was not accessed through any
DataServerExplorer.ValidateDataParametersException
ReadException
public Envelope getEnvelope() throws DataException
FeatureStore
getEnvelope
in interface FeatureStore
null
if
store not have geometry informationDataException
public IProjection getSRSDefaultGeometry() throws DataException
getSRSDefaultGeometry
in interface FeatureStore
DataException
public FeatureSelection createDefaultFeatureSelection() throws DataException
FeatureStoreProviderServices
FeatureSelection
createDefaultFeatureSelection
in interface FeatureStoreProviderServices
FeatureSelection
DataException
public FeatureProvider createDefaultFeatureProvider(FeatureType type) throws DataException
FeatureStoreProviderServices
FeatureProvider
createDefaultFeatureProvider
in interface FeatureStoreProviderServices
FeatureProvider
DataException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState persistentState) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public DataStoreProviderServices getStoreProviderServices()
public static void registerPersistenceDefinition()
public static void registerMetadataDefinition() throws MetadataException
MetadataException
public void setSelection(DataSet selection) throws DataException
DataStore
setSelection
in interface DataStore
DataException
public DataSet createSelection() throws DataException
DataStore
createSelection
in interface DataStore
DataException
public DataSet getSelection() throws DataException
DataStore
getSelection
in interface DataStore
DataException
public void setSelection(FeatureSet selection) throws DataException
FeatureStore
FeatureSet
setSelection
in interface FeatureStore
selection
- A FeatureSet
with the requested selectionDataException
public void setSelection(FeatureSet selection, boolean undoable) throws DataException
DataException
public FeatureSelection createFeatureSelection() throws DataException
FeatureStore
FeatureSelection
createFeatureSelection
in interface FeatureStore
FeatureSelection
DataException
public FeatureSelection getFeatureSelection() throws DataException
FeatureStore
FeatureSelection
.
Create a empty selection if not exits.
Manage of the selection can be slow on some data sources.
Use with care.
In data sources that do not support position access to records,
it may be slow to retrieve items from the selection. In some data
sources it may be necessary to access to this to retrieve each
item in the selection.getFeatureSelection
in interface FeatureStore
FeatureSelection
.DataException
public void notifyChange(FeatureStoreNotification storeNotification)
FeatureStoreProviderServices
notifyChange
in interface FeatureStoreProviderServices
public void notifyChange(String notification)
FeatureStoreProviderServices
notifyChange
in interface FeatureStoreProviderServices
public void notifyChange(String notification, FeatureProvider data)
FeatureStoreProviderServices
notifyChange
in interface FeatureStoreProviderServices
public void notifyChange(String notification, EditableFeatureType type)
public void notifyChange(String notification, Resource resource)
FeatureStoreProviderServices
notifyChange
in interface FeatureStoreProviderServices
public boolean isLocksSupported()
FeatureStore
isLocksSupported
in interface FeatureStore
public FeatureLocks getLocks() throws DataException
FeatureStore
getLocks
in interface FeatureStore
DataException
public void disableNotifications()
ComplexObservable
disableNotifications
in interface ComplexObservable
public void enableNotifications()
ComplexObservable
enableNotifications
in interface ComplexObservable
public void beginComplexNotification()
ComplexObservable
beginComplexNotification
in interface ComplexObservable
public void endComplexNotification()
ComplexObservable
If a observer is a ComplexObserver
, it will be notified with a
single DefaultComplexNotification
instead of each of the notifications.
Some important notes to take into account when calling this method.
Observer
is processing a notification another Observer
is
registered to the source Observable
, it won't get any of the
notifications currently being notified, but future ones.endComplexNotification
in interface ComplexObservable
public void addObserver(Observer observer)
addObserver
in interface Observable
public void deleteObserver(Observer observer)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void update(Observable observable, Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
public void edit() throws DataException
FeatureStore
edit
in interface FeatureStore
DataException
public void edit(int mode) throws DataException
FeatureStore
edit
in interface FeatureStore
DataException
public boolean isEditing()
FeatureStore
isEditing
in interface FeatureStore
public boolean isAppending()
FeatureStore
FeatureSet
.isAppending
in interface FeatureStore
public void update(EditableFeatureType type) throws DataException
FeatureStore
FeatureType
in the store with the changes in the
EditableFeatureType
.FeatureSet
from this store that are used will be invalidated.update
in interface FeatureStore
type
- an EditableFeatureType
with the changes.DataException
public void delete(Feature feature) throws DataException
FeatureStore
Feature
from the store.FeatureSet
from this store that was still in use will be
invalidated. You can override this using Iterator.remove()
from
FeatureSet
.delete
in interface FeatureStore
feature
- The feature to be deleted.DataException
public void doDelete(Feature feature) throws DataException
DataException
public void insert(EditableFeature feature) throws DataException
FeatureStore
Feature
in the store.FeatureSet
from this store that was still in use will be
invalidated. You can override this using
FeatureSet.insert(EditableFeature)
.insert
in interface FeatureStore
feature
- The feature to be insertedDataException
public void doInsert(EditableFeature feature) throws DataException
DataException
public void update(EditableFeature feature) throws DataException
FeatureStore
Feature
in the store with the changes in the
EditableFeature
.FeatureSet
from this store that was still in use will be
invalidated. You can override this using
FeatureSet.update(EditableFeature)
.update
in interface FeatureStore
feature
- the feature to be updatedDataException
public void doUpdate(EditableFeature feature, Feature oldFeature) throws DataException
DataException
public void redo() throws RedoException
UndoRedoStack
redo
in interface UndoRedoStack
RedoException
- if there is an error performing de redo elementpublic void undo() throws UndoException
UndoRedoStack
undo
in interface UndoRedoStack
UndoException
- if there is an error performing de undo elementpublic List getRedoInfos()
UndoRedoStack
getRedoInfos
in interface UndoRedoStack
public List getUndoInfos()
UndoRedoStack
getUndoInfos
in interface UndoRedoStack
public FeatureCommandsStack getCommandsStack() throws DataException
DataException
public void cancelEditing() throws DataException
FeatureStore
cancelEditing
in interface FeatureStore
DataException
public void finishEditing() throws DataException
FeatureStore
finishEditing
in interface FeatureStore
DataException
public void commitChanges() throws DataException
commitChanges
in interface FeatureStore
DataException
public boolean canCommitChanges() throws DataException
FeatureStore
canCommitChanges
in interface FeatureStore
DataException
public void beginEditingGroup(String description) throws NeedEditingModeException
FeatureStore
beginEditingGroup
in interface FeatureStore
description
- Description of the editing group.NeedEditingModeException
public void endEditingGroup() throws NeedEditingModeException
FeatureStore
endEditingGroup
in interface FeatureStore
NeedEditingModeException
public boolean isAppendModeSupported()
FeatureStore
isAppendModeSupported
in interface FeatureStore
public void export(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params) throws DataException
FeatureStore
export
in interface FeatureStore
explorer
- DataServerExplorer
targetparams
- New parameters of this store that will be used on the target
explorerDataException
public DataSet getDataSet() throws DataException
DataStore
getDataSet
in interface DataStore
DataException
- if there is any error while loading the datapublic DataSet getDataSet(DataQuery dataQuery) throws DataException
DataStore
getDataSet
in interface DataStore
dataQuery
- defines the properties of the requested dataDataException
- if there is any error while loading the datapublic void getDataSet(Observer observer) throws DataException
DataStore
getDataSet
in interface DataStore
observer
- to be notified for each block of data loadedDataException
- if there is any error while loading the datapublic void getDataSet(DataQuery dataQuery, Observer observer) throws DataException
DataStore
getDataSet
in interface DataStore
dataQuery
- defines the properties of the requested dataobserver
- to be notified for each block of data loadedDataException
- if there is any error while loading the datapublic FeatureSet getFeatureSet() throws DataException
FeatureStore
NOTE: if you use this method to get a
FeatureSet
, you must get sure it is disposed
(@see Disposable.dispose()
) in any case, even if an
error occurs while getting the data. It is recommended to use the
accept
methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to
get the features.
getFeatureSet
in interface FeatureStore
ReadException
- if there is any error while reading the featuresDataException
DataStore.accept(org.gvsig.tools.visitor.Visitor)
public FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException
FeatureStore
NOTE: if you use this method to get a
FeatureSet
, you must get sure it is disposed
(@see Disposable.dispose()
) in any case, even if an
error occurs while getting the data. It is recommended to use the
accept
methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to
get the features.
getFeatureSet
in interface FeatureStore
featureQuery
- defines the characteristics of the features to returnReadException
- if there is any error while reading the featuresDataException
DataStore.accept(org.gvsig.tools.visitor.Visitor,
org.gvsig.fmap.dal.DataQuery)
public FeatureSet getFeatureSet(String filter) throws DataException
getFeatureSet
in interface FeatureStore
DataException
public FeatureSet getFeatureSet(String filter, String sortBy) throws DataException
getFeatureSet
in interface FeatureStore
DataException
public FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException
getFeatureSet
in interface FeatureStore
DataException
public List<Feature> getFeatures(FeatureQuery query)
getFeatures
in interface FeatureStore
public List<Feature> getFeatures(FeatureQuery query, int pageSize)
FeatureStore
getFeatures
in interface FeatureStore
query
- to filter the returned feature listpageSize
- the page size of the listpublic List<Feature> getFeatures()
getFeatures
in interface FeatureStore
public void accept(Visitor visitor) throws BaseException
DataStore
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.accept
in interface DataStore
accept
in interface Visitable
visitor
- the visitor to apply to each value.BaseException
- if there is an error while performing the visitpublic void accept(Visitor visitor, DataQuery dataQuery) throws BaseException
DataStore
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.accept
in interface DataStore
visitor
- the visitor to apply to each value.dataQuery
- defines the properties of the data to visitBaseException
- if there is an error while performing the visitpublic FeatureType getFeatureType(FeatureQuery featureQuery) throws DataException
DataException
public void getFeatureSet(Observer observer) throws DataException
FeatureStore
getFeatureSet
in interface FeatureStore
observer
- to be notified of each loaded FeatureDataException
- if there is any error while loading the featurespublic void getFeatureSet(FeatureQuery query, Observer observer) throws DataException
FeatureStore
getFeatureSet
in interface FeatureStore
query
- defines the characteristics of the features to returnobserver
- to be notified of each loaded FeatureDataException
- if there is any error while loading the featurespublic Feature getFeatureByReference(FeatureReference reference) throws DataException
FeatureStore
getFeatureByReference
in interface FeatureStore
reference
- a unique FeatureReferenceDataException
public Feature getFeatureByReference(FeatureReference reference, FeatureType featureType) throws DataException
FeatureStore
getFeatureByReference
in interface FeatureStore
reference
- a unique FeatureReferencefeatureType
- FeatureType to which the requested Feature belongsDataException
public void validateFeatures(int mode) throws DataException
FeatureStore
FeatureSet
.validateFeatures
in interface FeatureStore
mode
- can be one of {MODE_QUERY, MODE_FULLEDIT, MODE_APPEND}DataException
public FeatureType getDefaultFeatureType() throws DataException
FeatureStoreProviderServices
FeatureType
of the storegetDefaultFeatureType
in interface FeatureStore
getDefaultFeatureType
in interface FeatureStoreProviderServices
FeatureType
.DataException
public FeatureType getFeatureType(String featureTypeId) throws DataException
FeatureStore
FeatureType
matches with
featureTypeId.getFeatureType
in interface FeatureStore
FeatureType
.DataException
public FeatureType getProviderDefaultFeatureType()
public List getFeatureTypes() throws DataException
FeatureStore
FeatureType
(s).getFeatureTypes
in interface FeatureStore
FeatureType
(s).DataException
public List getProviderFeatureTypes() throws DataException
DataException
public Feature createFeature(FeatureProvider data) throws DataException
FeatureStoreProviderServices
Feature
instance for FeatureProvider
data
FeatureProvider
instances instead FeaturecreateFeature
in interface FeatureStoreProviderServices
Feature
DataException
public Feature createFeature(FeatureProvider data, FeatureType type) throws DataException
DataException
public EditableFeature createNewFeature(FeatureType type, Feature defaultValues) throws DataException
FeatureStore
FeatureType
and uses the given
Feature
as default values to initialize it.createNewFeature
in interface FeatureStore
type
- the new feature's feature typedefaultValues
- a feature whose values are used as default values for the new
feature.DataException
public EditableFeature createNewFeature(FeatureType type, boolean defaultValues) throws DataException
FeatureStore
FeatureType
. The flag
defaultValues is used to indicate whether the new feature should be
initialized with default values or not.createNewFeature
in interface FeatureStore
type
- the new feature's feature typedefaultValues
- if true the new feature is initialized with each attribute's
default value.DataException
public EditableFeature createNewFeature(boolean defaultValues) throws DataException
FeatureStore
FeatureType
. The flag
defaultValues is used to indicate whether the new feature should be
initialized with default values or not.createNewFeature
in interface FeatureStore
defaultValues
- if true the new feature is initialized with each attribute's
default value.DataException
public EditableFeature createNewFeature() throws DataException
FeatureStore
EditableFeature
createNewFeature
in interface FeatureStore
DataException
public EditableFeature createNewFeature(Feature defaultValues) throws DataException
FeatureStore
FeatureType
.
The new feature should be initialized with the values of the feature
passed as parameter.
Values are inicialiced by name from the feature specified. Error in
value assignement are ignoreds.createNewFeature
in interface FeatureStore
defaultValues
- the values to initialize the new feature.DataException
public EditableFeatureType createFeatureType()
FeatureStoreProviderServices
createFeatureType
in interface FeatureStoreProviderServices
public EditableFeatureType createFeatureType(String id)
FeatureStoreProviderServices
createFeatureType
in interface FeatureStoreProviderServices
public FeatureIndexes getIndexes()
FeatureStore
getIndexes
in interface FeatureStore
public FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName) throws DataException
FeatureStore
createIndex
in interface FeatureStore
featureType
- The FeatureType to which the indexed attribute belongs.attributeName
- The name of the attributed to be indexedindexName
- The index nameFeatureIndex
FeatureIndexException
- if there is an error creating the indexDataException
public FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName) throws DataException
FeatureStore
createIndex
in interface FeatureStore
indexTypeName
- the type of the index to be created. That name is
related to one of the registered index providersfeatureType
- The FeatureType to which the indexed attribute belongs.attributeName
- The name of the attributed to be indexedindexName
- The index nameFeatureIndex
FeatureIndexException
- if there is an error creating the indexDataException
public FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName, Observer observer) throws DataException
FeatureStore
Observer
parameter is provided to be
notified ( FeatureStoreNotification.INDEX_FILLING_SUCCESS
)
when the index has finished filling with data and is available to be
used.createIndex
in interface FeatureStore
featureType
- The FeatureType to which the indexed attribute belongs.attributeName
- The name of the attributed to be indexedindexName
- The index nameobserver
- to notify to when the created index has finished filling
with data and is available to be used. The observer will
receive then a
FeatureStoreNotification.INDEX_FILLING_SUCCESS
notification, with the index object if it has finished
successfully, or a
FeatureStoreNotification.INDEX_FILLING_ERROR
notification with the exception object if there has been
any error in the process. Optional.FeatureIndex
FeatureIndexException
- if there is an error creating the indexDataException
FeatureStoreNotification.INDEX_FILLING_STARTED
,
FeatureStoreNotification.INDEX_FILLING_SUCCESS
,
FeatureStoreNotification.INDEX_FILLING_CANCELLED
,
FeatureStoreNotification.INDEX_FILLING_ERROR
public FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName, Observer observer) throws DataException
FeatureStore
Observer
parameter is provided to be
notified ( FeatureStoreNotification.INDEX_FILLING_SUCCESS
)
when the index has finished filling with data and is available to be
used.createIndex
in interface FeatureStore
indexTypeName
- the type of the index to be created. That name is
related to one of the registered index providersfeatureType
- The FeatureType to which the indexed attribute belongs.attributeName
- The name of the attributed to be indexedindexName
- The index nameobserver
- to notify to when the created index has finished filling
with data and is available to be used. The observer will
receive then a
FeatureStoreNotification.INDEX_FILLING_SUCCESS
notification, with the index object if it has finished
successfully, or a
FeatureStoreNotification.INDEX_FILLING_ERROR
notification with the exception object if there has been
any error in the process. Optional.FeatureIndex
FeatureIndexException
- if there is an error creating the indexDataException
FeatureStoreNotification.INDEX_FILLING_STARTED
,
FeatureStoreNotification.INDEX_FILLING_SUCCESS
,
FeatureStoreNotification.INDEX_FILLING_CANCELLED
,
FeatureStoreNotification.INDEX_FILLING_ERROR
public FeatureStoreTransforms getTransforms()
FeatureStore
getTransforms
in interface FeatureStore
public FeatureQuery createFeatureQuery()
FeatureStore
FeatureQuery
associated to this store.createFeatureQuery
in interface FeatureStore
FeatureQuery
associated to this store.public DataQuery createQuery()
DataStore
DataQuery
.createQuery
in interface DataStore
DataQuery
instance.public boolean canRedo()
UndoRedoStack
canRedo
in interface UndoRedoStack
public boolean canUndo()
UndoRedoStack
canUndo
in interface UndoRedoStack
public void redo(int num) throws RedoException
UndoRedoStack
redo
in interface UndoRedoStack
num
- the number of elements to redoRedoException
- if there is an error performing de redo elementpublic void undo(int num) throws UndoException
UndoRedoStack
undo
in interface UndoRedoStack
num
- the number of elements to undoUndoException
- if there is an error performing de undo elementpublic Object getMetadataID()
Metadata
getMetadataID
in interface Metadata
public DynClass getDynClass()
getDynClass
in interface DynObject
public Object getDynValue(String name) throws DynFieldNotFoundException
getDynValue
in interface DynObject
DynFieldNotFoundException
public boolean hasDynValue(String name)
hasDynValue
in interface DynObject
public boolean hasDynMethod(String name)
hasDynMethod
in interface DynObject_v2
public Object invokeDynMethod(String name, Object[] args) throws DynMethodException
invokeDynMethod
in interface DynObject
DynMethodException
public Object invokeDynMethod(int code, Object[] args) throws DynMethodException
invokeDynMethod
in interface DynObject
DynMethodException
public void setDynValue(String name, Object value) throws DynFieldNotFoundException
setDynValue
in interface DynObject
DynFieldNotFoundException
public Set getMetadataChildren()
Metadata
getMetadataChildren
in interface Metadata
public String getMetadataName()
Metadata
getMetadataName
in interface Metadata
public FeatureTypeManager getFeatureTypeManager()
public long getFeatureCount() throws DataException
FeatureStore
getFeatureCount
in interface FeatureStore
DataException
public FeatureType getProviderFeatureType(String featureTypeId)
FeatureStoreProviderServices
FeatureType
of FeatureStoreProvider
.getProviderFeatureType
in interface FeatureStoreProviderServices
public FeatureProvider getFeatureProviderFromFeature(Feature feature)
FeatureStoreProviderServices
FeatureProvider
from a Feature
instance.getFeatureProviderFromFeature
in interface FeatureStoreProviderServices
public DataStore getStore()
DataStoreProviderServices
getStore
in interface DataStoreProviderServices
public FeatureStore getFeatureStore()
FeatureStoreProviderServices
getFeatureStore
in interface FeatureStoreProviderServices
public void createCache(String name, DynObject parameters) throws DataException
createCache
in interface FeatureStore
DataException
public FeatureCache getCache()
getCache
in interface FeatureStore
public String getName()
DataStore
getName
in interface DataStore
getName
in interface FeatureStoreProviderServices
public String getFullName()
DataStore
getFullName
in interface DataStore
public String getProviderName()
DataStore
getProviderName
in interface DataStore
public boolean isKnownEnvelope()
FeatureStore
FeatureStoreProvider#getEnvelope()
method doesn't return
the full envelope.isKnownEnvelope
in interface FeatureStore
public boolean hasRetrievedFeaturesLimit()
FeatureStore
hasRetrievedFeaturesLimit
in interface FeatureStore
public int getRetrievedFeaturesLimit()
FeatureStore
FeatureStoreProvider#hasRetrievedFeaturesLimit()
returns
true,
it returns the limit of features retrieved from the provider.getRetrievedFeaturesLimit
in interface FeatureStore
public Interval getInterval()
DataStore
Interval
of the store, that means the temporal
interval where the store has valid data.getInterval
in interface DataStore
public Collection getTimes()
DataStore
public Collection getTimes(Interval interval)
DataStore
public void setTimeSupport(FeatureStoreTimeSupport timeSupport)
public Object clone() throws CloneNotSupportedException
Cloneable
clone
in class Object
CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.
public Feature getFeature(DynObject dynobject)
FeatureStore
getFeature
in interface FeatureStore
public Iterator iterator()
iterator
in interface FeatureStore
public ExpressionBuilder createExpressionBuilder()
createExpressionBuilder
in interface FeatureStore
public ExpressionBuilder createExpression()
createExpression
in interface FeatureStore
public FeatureSet features() throws DataException
DataException
public DataStoreProviderFactory getProviderFactory()
getProviderFactory
in interface DataStore
public void useCache(String providerName, DynObject parameters) throws DataException
useCache
in interface DataStore
DataException
public boolean isBroken()
isBroken
in interface FeatureStore
public Throwable getBreakingsCause()
getBreakingsCause
in interface FeatureStore
public SpatialIndex wrapSpatialIndex(SpatialIndex index)
wrapSpatialIndex
in interface FeatureStore