Interface FeatureStore

All Superinterfaces:
Cloneable, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.observer.ComplexObservable, org.gvsig.tools.observer.ComplexWeakReferencingObservable, DataFactoryUnit, DataStore, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.dynobject.DynObject, org.gvsig.tools.dynobject.DynObject_v2, Iterable<Feature>, org.gvsig.metadata.Metadata, org.gvsig.tools.observer.Observable, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.util.PropertiesSupport, org.gvsig.tools.service.spi.Services, org.gvsig.tools.util.Size64, org.gvsig.tools.undo.UndoRedoStack, org.gvsig.tools.visitor.Visitable, org.gvsig.tools.observer.WeakReferencingObservable

public interface FeatureStore extends DataStore, org.gvsig.tools.undo.UndoRedoStack, org.gvsig.tools.lang.Cloneable, Iterable<Feature>, org.gvsig.tools.util.PropertiesSupport, org.gvsig.tools.util.Size64

A FeatureStore is a type of store whose data consists on sets of Feature(s). Feature(s) from the same FeatureStore can be of different FeatureType(s) (as in GML format for instance).

FeatureStore allows:

  • Obtaining the default FeatureType. A FeatureStore always has one and only one default FeatureType.
  • Obtaining the list of FeatureType(s) defined in the FeatureStore.
  • Obtaining, filtering and sorting subsets of data (FeatureSet) through FeatureQuery, as well as background loading.
  • Obtaining the total Envelope (AKA bounding box or extent) of the store.
  • Support for editing FeatureType(s).
  • Obtaining information about contained Geometry types.
  • Exporting to another store.
  • Indexing.
  • Selection.
  • Locks management.
  • Field Details

    • METADATA_DEFINITION_NAME

      static final String METADATA_DEFINITION_NAME
      See Also:
    • MODE_UNKNOWN

      static final int MODE_UNKNOWN
      See Also:
    • MODE_QUERY

      static final int MODE_QUERY
      Indicates that this store is in query mode
      See Also:
    • MODE_FULLEDIT

      static final int MODE_FULLEDIT
      Indicates that this store is in full edit mode
      See Also:
    • MODE_APPEND

      static final int MODE_APPEND
      Indicates that this store is in append mode
      See Also:
    • MODE_PASS_THROUGH

      static final int MODE_PASS_THROUGH
      See Also:
    • SUBMODE_NONE

      static final int SUBMODE_NONE
      See Also:
    • SUBMODE_MERGE

      static final int SUBMODE_MERGE
      En este modo hace un merge contra la base de datos, si existe lo actualizada y si no lo inserta
      See Also:
  • Method Details

    • getLabel

      static String getLabel(FeatureStore store)
    • allowWrite

      boolean allowWrite()
      Indicates whether this store allows writing.
      Returns:
      true if this store can be written, false if not.
    • getDefaultFeatureType

      FeatureType getDefaultFeatureType() throws DataException
      Returns this store's default FeatureType.
      Returns:
      this store's default FeatureType.
      Throws:
      DataException
    • getDefaultFeatureTypeQuietly

      FeatureType getDefaultFeatureTypeQuietly()
    • getFeatureType

      FeatureType getFeatureType(String featureTypeId) throws DataException
      Returns this store's featureType FeatureType matches with featureTypeId.
      Parameters:
      featureTypeId -
      Returns:
      this store's default FeatureType.
      Throws:
      DataException
    • getFeatureTypes

      List getFeatureTypes() throws DataException
      Returns this store's FeatureType(s).
      Returns:
      a list with this store's FeatureType(s).
      Throws:
      DataException
    • getParameters

      DataStoreParameters getParameters()
      Returns this store's parameters.
      Specified by:
      getParameters in interface DataStore
      Returns:
      DataStoreParameters containing this store's parameters
    • canWriteGeometry

      boolean canWriteGeometry(int gvSIGgeometryType) throws DataException
      Parameters:
      gvSIGgeometryType -
      Returns:
      Throws:
      DataException
    • getEnvelope

      org.gvsig.fmap.geom.primitive.Envelope getEnvelope() throws DataException
      Returns this store's total envelope (extent).
      Returns:
      this store's total envelope (extent) or null if store not have geometry information
      Throws:
      DataException
    • getSRSDefaultGeometry

      org.gvsig.crs.projection.lib.Projection getSRSDefaultGeometry() throws DataException
      Returns:
      Throws:
      DataException
    • export

      void export(DataServerExplorer explorer, String provider, NewFeatureStoreParameters params, String name) throws DataException
      Exports this store to another store.
      Parameters:
      explorer - DataServerExplorer target
      provider -
      params - New parameters of this store that will be used on the target explorer
      Throws:
      DataException
    • copyTo

      void copyTo(FeatureStore target)
    • createFeatureQuery

      FeatureQuery createFeatureQuery(String filter, String sortBy, boolean asc)
      Create a FeatureQuery with the restrictions indicateds. "filter" will be null or a valid filter expression for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      a FeatureQuery with the restrictions.
    • createFeatureQuery

      FeatureQuery createFeatureQuery(String filter)
    • createFeatureQuery

      FeatureQuery createFeatureQuery(org.gvsig.expressionevaluator.Expression filter)
    • createFeatureQuery

      FeatureQuery createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc)
      Create a FeatureQuery with the restrictions indicateds. "filter" will be null or Expression valid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      a FeatureQuery with the restrictions.
    • createFeatureQuery

      FeatureQuery createFeatureQuery(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc)
      Create a FeatureQuery with the restrictions indicateds. "filter" will be null or Expression valid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - expression used to order the features in the store.
      asc - use order ascending, true, or descending, false.
      Returns:
      a FeatureQuery with the restrictions.
    • createFeatureQuery

      FeatureQuery createFeatureQuery(String filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc)
      Create a FeatureQuery with the restrictions indicateds. "filter" will be null or Expression valid for the store. "sortBy" can be null to use the store's default order. The parameter sortBy can be an attribute name or a comma separated list. Each attribute name can be preceded or followed by "+" or "-" to indicate the order to use to sort by that attribute. If no "+" or "-" is indicated, the "asc" parameter will be used to determine if the order is ascending, "true" or decent, "false".
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - expression used to order the features in the store.
      asc - use order ascending, true, or descending, false.
      Returns:
      a FeatureQuery with the restrictions.
    • getFeatureSet

      FeatureSet getFeatureSet() throws DataException
      Returns all available features in the store. It is a utility method that calls getFeatureSet(FeatureQuery)
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(String filter) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery)
      Parameters:
      filter - an String expression used to filter the features in the store.
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(String filter, String sortBy) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery) The sort order used is ascending.
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(String filter, String sortBy, boolean asc) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery)
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(org.gvsig.expressionevaluator.Expression filter) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery)
      Parameters:
      filter - an Expression used to filter the features in the store.
      Returns:
      the FeatureSet
      Throws:
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery) The sort order used is ascending.
      Parameters:
      filter - an Expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) throws DataException
      Return a subset of features. It is a utility method that calls getFeatureSet(FeatureQuery)
      Parameters:
      filter - an Expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the FeatureSet
      Throws:
      DataException
    • getFeatureSet

      FeatureSet getFeatureSet(FeatureQuery featureQuery) throws DataException
      Returns a subset of features taking into account the properties and restrictions of the FeatureQuery. If FeatureQuery is null, return al features in the store.

      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.

      Parameters:
      featureQuery - defines the characteristics of the features to return.
      Returns:
      the FeatureSet
      Throws:
      ReadException - if there is any error while reading the features.
      DataException
      See Also:
    • getFeatureSet

      void getFeatureSet(FeatureQuery featureQuery, org.gvsig.tools.observer.Observer observer) throws DataException
      Loads a subset of features taking into account the properties and restrictions of the FeatureQuery. When feature loading is finished call the Observer passing the FeatureSet loaded.
      Parameters:
      featureQuery - defines the characteristics of the features to return.
      observer - to be notified when loading is finished.
      Throws:
      DataException - if there is any error while loading the features
    • getFeatureSet

      void getFeatureSet(org.gvsig.tools.observer.Observer observer) throws DataException
      Loads all available feature in the store. The loading of Features is performed by calling the Observer, once each loaded Feature.
      Parameters:
      observer - to be notified of each loaded Feature
      Throws:
      DataException - if there is any error while loading the features
    • getFeatures

      List<Feature> getFeatures(FeatureQuery query, int pageSize)
      Return a paginated list of Features filtered by the query. If the query is null, return all features in the store sorteds by default order. The return value implements List and UnmodifiableBasicList64 to support large list of features. The returned list of Features is paginated, and the page size used is "pageSize". If the page size is less than or equal to 0, the default page size of 100 will be used.
      Parameters:
      query - to filter and sort the returned feature list
      pageSize - the page size of the list
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures(FeatureQuery query)
      Return a paginated list of Features. It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      query - to filter and sort the returned feature list
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures()
      Return a paginated list with al Features in the store. It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures(String filter)
      Return a paginated list of Features It is a utility method that calls getFeatures(FeatureQuery, int)
      Parameters:
      filter - used to filter the features in the store.
      Returns:
      the List of Features
    • getFeatures

      List<Feature> getFeatures(String filter, String sortBy)
      Return a paginated list of Features. It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      filter - used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures(String filter, String sortBy, boolean asc)
      Return a paginated list of Features. It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      filter - an String expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures(org.gvsig.expressionevaluator.Expression filter)
      Return a paginated list of Features It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      filter - an Expression used to filter the features in the store.
      Returns:
      the List of Features
    • getFeatures

      List<Feature> getFeatures(org.gvsig.expressionevaluator.Expression filter, String sortBy)
      Return a paginated list of Features It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      filter - an Expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures

      List<Feature> getFeatures(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc)
      Return a paginated list of Features It is a utility method that calls getFeatures(FeatureQuery, int) using the default page size.
      Parameters:
      filter - an Expression used to filter the features in the store.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the List/UnmodifiableBasicList64 of features
    • getFeatures64

      org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64()
    • getFeatures64

      org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter)
    • getFeatures64

      org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(String filter, String sortBy, boolean asc)
    • getFeatures64

      org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<Feature> getFeatures64(FeatureQuery query, int pageSize)
    • first

      Feature first() throws DataException
      Return the first Feature of the store.
      Returns:
      the first Feature or null if the store is empty.
      Throws:
      DataException
    • findFirst

      Feature findFirst(String filter) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(String filter, String sortBy) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(String filter, String sortBy, boolean asc) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(String filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - Expression
      asc - use order ascending, true, or descending, false.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(org.gvsig.expressionevaluator.Expression filter) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(org.gvsig.expressionevaluator.Expression filter, String sortBy) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - Attribute names separated by commas used to sort the list to return.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(org.gvsig.expressionevaluator.Expression filter, String sortBy, boolean asc) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - Attribute names separated by commas used to sort the list to return.
      asc - use order ascending, true, or descending, false.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(org.gvsig.expressionevaluator.Expression filter, org.gvsig.expressionevaluator.Expression sortBy, boolean asc) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      filter - String expression used to filter the features.
      sortBy - expression used to sort features
      asc - use order ascending, true, or descending, false.
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • findFirst

      Feature findFirst(FeatureQuery query) throws DataException
      Returns the first Feature that meets the criteria indicated. It is a utility method that calls findFirst(FeatureQuery).
      Parameters:
      query - to filter and sort the returned feature list
      Returns:
      the first Feature or null if the filter don't return any feature.
      Throws:
      DataException
    • getFeatureByReference

      Feature getFeatureByReference(FeatureReference reference) throws DataException
      Returns the feature given its reference.
      Parameters:
      reference - a unique FeatureReference
      Returns:
      Throws:
      DataException
    • getFeatureByReference

      Feature getFeatureByReference(FeatureReference reference, FeatureType featureType) throws DataException
      Returns the feature given its reference and feature type.
      Parameters:
      reference - a unique FeatureReference
      featureType - FeatureType to which the requested Feature belongs
      Returns:
      The Feature
      Throws:
      DataException
    • edit

      void edit() throws DataException
      Enters editing state.
      Throws:
      DataException
    • edit

      void edit(int mode) throws DataException
      Enters editing state specifying the editing mode.
      Parameters:
      mode -
      Throws:
      DataException
    • edit

      void edit(int mode, int submode) throws DataException
      Throws:
      DataException
    • getSubmode

      int getSubmode()
    • getMode

      int getMode()
    • cancelEditing

      void cancelEditing() throws DataException
      Cancels all editing since the last edit().
      Throws:
      DataException
    • cancelEditingQuietly

      boolean cancelEditingQuietly()
    • cancelEditingQuietly

      static boolean cancelEditingQuietly(FeatureStore store)
    • finishEditing

      void finishEditing() throws DataException
      Exits editing state.
      Throws:
      DataException
    • finishEditingQuietly

      boolean finishEditingQuietly()
    • finishEditingQuietly

      static boolean finishEditingQuietly(FeatureStore store)
    • commitChanges

      void commitChanges() throws DataException
      Save changes in the provider without leaving the edit mode. Do not call observers to communicate a change of ediding mode. The operation's history is eliminated to prevent inconsistencies in the data.
      Throws:
      DataException
    • canCommitChanges

      boolean canCommitChanges() throws DataException
      Returns true if you can call CommitChanges method. If not in editing or changes have been made in the structure return false.
      Returns:
      true if can call commitChanges
      Throws:
      DataException
    • isEditing

      boolean isEditing()
      Indicates whether this store is in editing state.
      Returns:
      true if this store is in editing state, false if not.
    • isAppending

      boolean isAppending()
      Indicates whether this store is in appending state. In this state the new features are automatically inserted at the end of the FeatureSet.
      Returns:
      true if this store is in appending state.
    • update

      void update(EditableFeatureType featureType) throws DataException
      Updates a FeatureType in the store with the changes in the EditableFeatureType.
      Any FeatureSet from this store that are used will be invalidated.
      Parameters:
      featureType - an EditableFeatureType with the changes.
      Throws:
      DataException
    • update

      void update(EditableFeature feature) throws DataException
      Updates a Feature in the store with the changes in the EditableFeature.
      Any FeatureSet from this store that was still in use will be invalidated. You can override this using FeatureSet.update(EditableFeature).
      Parameters:
      feature - the feature to be updated
      Throws:
      DataException
    • update

      void update(Object... parameters) throws DataException
      Updates Features in the store with the values of the parameters. Examples: update("field1",value1,"field2",value2); update("field1",value1,"field2",value2,filter); filter can be a Expression or a String
      Parameters:
      parameters -
      Throws:
      DataException
    • delete

      void delete(Feature feature) throws DataException
      Deletes a Feature from the store.
      Any FeatureSet from this store that was still in use will be invalidated. You can override this using Iterator.remove() from FeatureSet.
      Parameters:
      feature - The feature to be deleted.
      Throws:
      DataException
    • delete

      void delete(String filter)
    • delete

      void delete(org.gvsig.expressionevaluator.Expression filter)
    • insert

      void insert(EditableFeature feature) throws DataException
      Inserts a Feature in the store.
      Any FeatureSet from this store that was still in use will be invalidated. You can override this using FeatureSet.insert(EditableFeature).
      Parameters:
      feature - The feature to be inserted
      Throws:
      DataException
    • insert

      void insert(FeatureSet set) throws DataException
      Inserts a set of Feature in the store. The attributes of the feature are copied from the features of the set by name, forcing the conversion of types if necessary. Any FeatureSet from this store that was still in use will be invalidated.
      Parameters:
      set - , set with the source features.
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature() throws DataException
      Creates a new feature using the default feature type and returns it as an EditableFeature
      Returns:
      a new feature in editable state
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature(FeatureType type, Feature defaultValues) throws DataException
      Creates a new feature of the given FeatureType and uses the given Feature as default values to initialize it.
      Parameters:
      type - the new feature's feature type
      defaultValues - a feature whose values are used as default values for the new feature.
      Returns:
      the new feature.
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature(FeatureType type, boolean defaultValues) throws DataException
      Creates a new feature of the given FeatureType. The flag defaultValues is used to indicate whether the new feature should be initialized with default values or not.
      Parameters:
      type - the new feature's feature type
      defaultValues - if true the new feature is initialized with each attribute's default value.
      Returns:
      the new feature
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature(boolean defaultValues) throws DataException
      Creates a new feature of default FeatureType. The flag defaultValues is used to indicate whether the new feature should be initialized with default values or not.
      Parameters:
      defaultValues - if true the new feature is initialized with each attribute's default value.
      Returns:
      the new feature
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature(Feature defaultValues) throws DataException
      Creates a new feature of default 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.
      Parameters:
      defaultValues - the values to initialize the new feature.
      Returns:
      the new feature
      Throws:
      DataException
    • createNewFeature

      EditableFeature createNewFeature(javax.json.JsonObject defaultValues) throws DataException
      Throws:
      DataException
    • isAppendModeSupported

      boolean isAppendModeSupported()
      Indicates whether this store supports append mode.
      Returns:
      true if this store supports append mode.
    • beginEditingGroup

      void beginEditingGroup(String description) throws NeedEditingModeException
      Initiates an editing group. This is typically used to group series of store editing operations.
      Parameters:
      description - Description of the editing group.
      Throws:
      NeedEditingModeException
    • endEditingGroup

      void endEditingGroup() throws NeedEditingModeException
      Finishes an editing group.
      Throws:
      NeedEditingModeException
    • createIndex

      FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName) throws DataException
      Creates an index which will be applied to the features of the given type, by using the data of the given attribute.
      Parameters:
      featureType - The FeatureType to which the indexed attribute belongs.
      attributeName - The name of the attributed to be indexed
      indexName - The index name
      Returns:
      the resulting FeatureIndex
      Throws:
      FeatureIndexException - if there is an error creating the index
      DataException
    • createIndex

      FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName) throws DataException
      Creates an index which will be applied to the features of the given type, by using the data of the given attribute.
      Parameters:
      indexTypeName - the type of the index to be created. That name is related to one of the registered index providers
      featureType - The FeatureType to which the indexed attribute belongs.
      attributeName - The name of the attributed to be indexed
      indexName - The index name
      Returns:
      the resulting FeatureIndex
      Throws:
      FeatureIndexException - if there is an error creating the index
      DataException
    • createIndex

      FeatureIndex createIndex(FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) throws DataException
      Creates an index which will be applied to the features of the given type, by using the data of the given attribute. This method will return without waiting for the index to be filled, as that will be performed in background. An optional 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.
      Parameters:
      featureType - The FeatureType to which the indexed attribute belongs.
      attributeName - The name of the attributed to be indexed
      indexName - The index name
      observer - 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.
      Returns:
      the resulting FeatureIndex
      Throws:
      FeatureIndexException - if there is an error creating the index
      DataException
      See Also:
    • createIndex

      FeatureIndex createIndex(String indexTypeName, FeatureType featureType, String attributeName, String indexName, org.gvsig.tools.observer.Observer observer) throws DataException
      Creates an index which will be applied to the features of the given type, by using the data of the given attribute. This method will return without waiting for the index to be filled, as that will be performed in background. An optional 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.
      Parameters:
      indexTypeName - the type of the index to be created. That name is related to one of the registered index providers
      featureType - The FeatureType to which the indexed attribute belongs.
      attributeName - The name of the attributed to be indexed
      indexName - The index name
      observer - 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.
      Returns:
      the resulting FeatureIndex
      Throws:
      FeatureIndexException - if there is an error creating the index
      DataException
      See Also:
    • getIndexes

      FeatureIndexes getIndexes()
      Returns a FeatureIndexes structure containing all available indexes in the store.
      Returns:
    • setSelection

      void setSelection(FeatureSet selection) throws DataException
      Sets the selection to the passed FeatureSet
      Parameters:
      selection - A FeatureSet with the requested selection
      Throws:
      DataException
    • createFeatureSelection

      FeatureSelection createFeatureSelection() throws DataException
      Returns:
      a FeatureSelection
      Throws:
      DataException
    • createLargeFeatureSelection

      FeatureSelection createLargeFeatureSelection() throws DataException
      Throws:
      DataException
    • createMemoryFeatureSelection

      FeatureSelection createMemoryFeatureSelection() throws DataException
      Returns:
      a FeatureSelection
      Throws:
      DataException
    • getFeatureSelection

      FeatureSelection getFeatureSelection() throws DataException
      Returns the current 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.
      Returns:
      current FeatureSelection.
      Throws:
      DataException
    • getFeatureSelectionQuietly

      FeatureSelection getFeatureSelectionQuietly()
    • isLocksSupported

      boolean isLocksSupported()
      Indicates whether this store supports locks.
      Returns:
      true if this store supports locks, false if not.
    • getLocks

      FeatureLocks getLocks() throws DataException
      Returns the set of locked features
      Returns:
      set of locked features
      Throws:
      DataException
    • getTransforms

      FeatureStoreTransforms getTransforms()
      Returns this store transforms
      Returns:
      this store transforms
    • createFeatureQuery

      FeatureQuery createFeatureQuery()
      Returns a new FeatureQuery associated to this store.
      Returns:
      a new FeatureQuery associated to this store.
    • getFeatureCount

      long getFeatureCount() throws DataException
      Returns featue count of this store.
      Returns:
      Throws:
      DataException
    • isKnownEnvelope

      boolean isKnownEnvelope()
      Return if the provider knows the real envelope of a layer. If not, the
      invalid reference
      FeatureStoreProvider#getEnvelope()
      method doesn't return the full envelope.
      Returns:
      true if it knows the real envelope.
    • hasRetrievedFeaturesLimit

      boolean hasRetrievedFeaturesLimit()
      Return if the maximum number of features provided by the provider are limited.
      Returns:
      true if there is a limit of features.
    • getRetrievedFeaturesLimit

      int getRetrievedFeaturesLimit()
      If the
      invalid reference
      FeatureStoreProvider#hasRetrievedFeaturesLimit()
      returns true, it returns the limit of features retrieved from the provider.
      Returns:
      The limit of the retrieved features.
    • getFeature

      Feature getFeature(org.gvsig.tools.dynobject.DynObject dynobject)
      Return the associated feature to the dynobject. If the dynobject isn't associated to a feature of this store, return null.
      Parameters:
      dynobject -
      Returns:
    • createExpressionBuilder

      org.gvsig.expressionevaluator.ExpressionBuilder createExpressionBuilder()
    • createExpression

      org.gvsig.expressionevaluator.ExpressionBuilder createExpression()
      Returns:
    • createCache

      void createCache(String name, org.gvsig.tools.dynobject.DynObject parameters) throws DataException
      Throws:
      DataException
    • getCache

      FeatureCache getCache()
      Specified by:
      getCache in interface DataStore
      Returns:
    • isBroken

      boolean isBroken()
    • getBreakingsCause

      Throwable getBreakingsCause()
    • isTemporary

      boolean isTemporary()
      Indicates if the storage is temporary. There is no guarantee that a temporary store can be recovered from its parameters. In general these will not be persistent.
      Returns:
      true if the store is temporary, otherwise false.
    • setTemporary

      void setTemporary(Boolean temporary)
    • wrapSpatialIndex

      org.gvsig.fmap.geom.SpatialIndex wrapSpatialIndex(org.gvsig.fmap.geom.SpatialIndex index)
      Parameters:
      index -
      Returns:
    • getFeatureReference

      FeatureReference getFeatureReference(String code)
    • getPendingChangesCount

      long getPendingChangesCount()
      Devuelbe el numero de operaciones pendientes de guardar en una sesion de edicion. Es un valor orientativo. Las operaciones pendientes son la suma de operaciones de borrado, insercion o modificacion de las features en una sesion de edicion. Retorna 0 si no esta en edicion.
      Returns:
      numero de operaciones pendientes.
    • getSampleFeature

      Feature getSampleFeature()
    • supportReferences

      boolean supportReferences()
      Return true when the default feature type of the store support references.
      Returns:
      true when support references.
    • getOriginalFeature

      Feature getOriginalFeature(FeatureReference id)
    • getOriginalFeature

      Feature getOriginalFeature(Feature feature)
    • isFeatureModified

      boolean isFeatureModified(FeatureReference id)
    • isFeatureModified

      boolean isFeatureModified(Feature feature)
    • getEditingSession

      String getEditingSession()
    • getEditedFeatures

      List<FeatureReference> getEditedFeatures()
    • getEditedFeaturesNotValidated

      List<FeatureReference> getEditedFeaturesNotValidated()
    • isFeatureSelectionEmpty

      boolean isFeatureSelectionEmpty()
    • isFeatureSelectionAvailable

      boolean isFeatureSelectionAvailable()
    • getFeaturesIterator

      Iterator<Feature> getFeaturesIterator(Iterator<FeatureReference> references)
    • getFeaturesIterable

      Iterable<Feature> getFeaturesIterable(Iterator<FeatureReference> references)
    • canBeEdited

      boolean canBeEdited()
    • getLabel

      String getLabel()
    • setNotificationsFilter

    • allowGeometry

      boolean allowGeometry(String name, org.gvsig.fmap.geom.Geometry geometry)