Class AbstractFeatureStoreProvider

java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.fmap.dal.spi.AbstractDataStoreProvider
org.gvsig.fmap.dal.feature.spi.AbstractFeatureStoreProvider
All Implemented Interfaces:
org.gvsig.fmap.dal.DataFactoryUnit, org.gvsig.fmap.dal.DataStoreProvider, FeatureStoreProvider, FeatureStoreProvider_v2, DataStoreProvider, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.dynobject.DynObject, org.gvsig.tools.dynobject.DynObject_v2
Direct Known Subclasses:
AbstractMemoryStoreProvider

public abstract class AbstractFeatureStoreProvider extends AbstractDataStoreProvider implements FeatureStoreProvider_v2
Abstract implementation of FeatureStoreProvider
  • Field Details

  • Constructor Details

    • AbstractFeatureStoreProvider

      protected AbstractFeatureStoreProvider(org.gvsig.fmap.dal.DataStoreParameters params, org.gvsig.fmap.dal.spi.DataStoreProviderServices storeServices, org.gvsig.tools.dynobject.DynObject metadata)
      Default Constructor.
      Parameters:
      params -
      storeServices -
      metadata -
    • AbstractFeatureStoreProvider

      protected AbstractFeatureStoreProvider(org.gvsig.fmap.dal.DataStoreParameters params, org.gvsig.fmap.dal.spi.DataStoreProviderServices storeServices)
      Constructor when cannot create metada in constrution time.

      Note: Don't use it if not is necesary. Set metada as soon as posible by setMetadata(DynObject)
      Parameters:
      params -
      storeServices -
  • Method Details

    • getFeatureProviderByReference

      public final FeatureProvider getFeatureProviderByReference(FeatureReferenceProviderServices reference) throws org.gvsig.fmap.dal.exception.DataException
      Description copied from interface: FeatureStoreProvider
      Return FeatureProvider from a FeatureReferenceProviderServices using FeatureStore.getDefaultFeatureType() as FeatureType
      Specified by:
      getFeatureProviderByReference in interface FeatureStoreProvider
      Parameters:
      reference -
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • getFeatureProviderByReference

      public final FeatureProvider getFeatureProviderByReference(FeatureReferenceProviderServices reference, org.gvsig.fmap.dal.feature.FeatureType featureType) throws org.gvsig.fmap.dal.exception.DataException
      Description copied from interface: FeatureStoreProvider
      Return FeatureProvider from a FeatureReferenceProviderServices using featureType as FeatureType
      Specified by:
      getFeatureProviderByReference in interface FeatureStoreProvider
      Parameters:
      reference -
      featureType -
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • internalGetFeatureProviderByReference

      protected FeatureProvider internalGetFeatureProviderByReference(FeatureReferenceProviderServices reference) throws org.gvsig.fmap.dal.exception.DataException
      Returns a FeatureProvider by reference, using the default FeatureType. This method may be rewritten by the child classes as an implementation of the getFeatureProviderByReference(FeatureReferenceProviderServices) method.
      Parameters:
      reference - the reference to the FeatureProvider
      Returns:
      the FeatureProvider being referenced
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error loading the FeatureProvider
    • setMetadata

      protected void setMetadata(org.gvsig.tools.dynobject.DynObject metadata)
      Set metada container if this not set at construction time and only in one time. In other case an Exception will be throw
      Parameters:
      metadata -
    • getParameters

      public org.gvsig.fmap.dal.DataStoreParameters getParameters()
      Specified by:
      getParameters in interface FeatureStoreProvider
      Returns:
      the parameters
    • createResource

      protected org.gvsig.fmap.dal.resource.spi.ResourceProvider createResource(String type, Object[] params) throws org.gvsig.fmap.dal.exception.InitializeException
      Create or get a resource of type for params in ResourceManager
      Parameters:
      type -
      params -
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.InitializeException
    • getStoreServices

      public FeatureStoreProviderServices getStoreServices()
      Description copied from interface: FeatureStoreProvider
      Return FeatureStoreProviderServices for this store
      Specified by:
      getStoreServices in interface FeatureStoreProvider
      Returns:
    • setStoreServices

      protected void setStoreServices(FeatureStoreProviderServices store)
    • getFeatureStore

      public org.gvsig.fmap.dal.feature.FeatureStore getFeatureStore()
      Specified by:
      getFeatureStore in interface FeatureStoreProvider
    • allowWrite

      public boolean allowWrite()
      Description copied from interface: FeatureStoreProvider
      Informs that store supports write.
      Specified by:
      allowWrite in interface FeatureStoreProvider
      Returns:
      true if write is supported
    • performChanges

      public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator featureTypesChanged) throws org.gvsig.fmap.dal.exception.DataException
      unsupported by default, override this otherwise
      Specified by:
      performChanges in interface FeatureStoreProvider
      Parameters:
      deleteds - iterator of FeatureReferenceProviderServices
      inserteds - iterator of FeatureProvider
      updateds - iterator of FeatureProvider
      featureTypesChanged - iterator of FeatureType.FeatureTypeChanged
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • isLocksSupported

      public boolean isLocksSupported()
      unsupported by default, override this otherwise
      Specified by:
      isLocksSupported in interface FeatureStoreProvider
      Returns:
      See Also:
    • createFeatureProvider

      public FeatureProvider createFeatureProvider(org.gvsig.fmap.dal.feature.FeatureType type) throws org.gvsig.fmap.dal.exception.DataException
      Default Factory of FeatureProvider. Create a new default FeatureProvider instance.
      Override this if you need an special implemtation of FeatureProvider.
      Specified by:
      createFeatureProvider in interface FeatureStoreProvider
      Parameters:
      type - , FeatureType of the FeatureProvider
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • createFeatureLocks

      public org.gvsig.fmap.dal.feature.FeatureLocks createFeatureLocks() throws org.gvsig.fmap.dal.exception.DataException
      unsupported by default (return null), override this otherwise
      Specified by:
      createFeatureLocks in interface FeatureStoreProvider
      Returns:
      FeatureLocks or null if not FeatureStoreProvider.isLocksSupported()
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • createFeatureSelection

      public org.gvsig.fmap.dal.feature.FeatureSelection createFeatureSelection() throws org.gvsig.fmap.dal.exception.DataException
      Default Factory of FeatureSelection. Create a new default FeatureSelection instance.
      Override this if you need an special implemtation of FeatureSelection.
      Specified by:
      createFeatureSelection in interface FeatureStoreProvider
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • refresh

      public void refresh() throws org.gvsig.fmap.dal.exception.OpenException
      do nothing by default, override this otherwise
      Specified by:
      refresh in interface DataStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.OpenException
      See Also:
    • close

      public void close() throws org.gvsig.fmap.dal.exception.CloseException
      do nothing by default, override this otherwise
      Specified by:
      close in interface DataStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.CloseException
      See Also:
    • doDispose

      protected void doDispose() throws org.gvsig.tools.exception.BaseException
      Specified by:
      doDispose in class org.gvsig.tools.dispose.impl.AbstractDisposable
      Throws:
      org.gvsig.tools.exception.BaseException
    • getEnvelope

      public org.gvsig.fmap.geom.primitive.Envelope getEnvelope() throws org.gvsig.fmap.dal.exception.DataException
      unsupported geometry by default (return null), override this otherwise
      Specified by:
      getEnvelope in interface FeatureStoreProvider
      Returns:
      this store's total envelope (extent) or null if store not have geometry information
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • getEnvelope

      public org.gvsig.fmap.geom.primitive.Envelope getEnvelope(String geomname) throws org.gvsig.fmap.dal.exception.DataException
      Override on providers that allow more than one geometry
      Specified by:
      getEnvelope in interface FeatureStoreProvider
      Parameters:
      geomname -
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • canWriteGeometry

      public boolean canWriteGeometry(int geometryType, int geometrySubType) throws org.gvsig.fmap.dal.exception.DataException
      unsupported geometry write by default (return false), override this otherwise
      Specified by:
      canWriteGeometry in interface FeatureStoreProvider
      Parameters:
      geometryType -
      geometrySubType -
      Returns:
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • delegate

      public void delegate(org.gvsig.tools.dynobject.DynObject dynObject)
      Specified by:
      delegate in interface org.gvsig.tools.dynobject.DynObject
    • getDynClass

      public org.gvsig.tools.dynobject.DynClass getDynClass()
      Specified by:
      getDynClass in interface org.gvsig.tools.dynobject.DynObject
    • getDynValue

      public Object getDynValue(String name) throws org.gvsig.tools.dynobject.exception.DynFieldNotFoundException
      Specified by:
      getDynValue in interface org.gvsig.tools.dynobject.DynObject
      Throws:
      org.gvsig.tools.dynobject.exception.DynFieldNotFoundException
    • hasDynValue

      public boolean hasDynValue(String name)
      Specified by:
      hasDynValue in interface org.gvsig.tools.dynobject.DynObject
    • hasDynMethod

      public boolean hasDynMethod(String name)
      Specified by:
      hasDynMethod in interface org.gvsig.tools.dynobject.DynObject_v2
    • implement

      public void implement(org.gvsig.tools.dynobject.DynClass dynClass)
      Specified by:
      implement in interface org.gvsig.tools.dynobject.DynObject
    • invokeDynMethod

      public Object invokeDynMethod(int code, Object[] args) throws org.gvsig.tools.dynobject.exception.DynMethodException
      Specified by:
      invokeDynMethod in interface org.gvsig.tools.dynobject.DynObject
      Throws:
      org.gvsig.tools.dynobject.exception.DynMethodException
    • invokeDynMethod

      public Object invokeDynMethod(String name, Object[] args) throws org.gvsig.tools.dynobject.exception.DynMethodException
      Specified by:
      invokeDynMethod in interface org.gvsig.tools.dynobject.DynObject
      Throws:
      org.gvsig.tools.dynobject.exception.DynMethodException
    • setDynValue

      public void setDynValue(String name, Object value) throws org.gvsig.tools.dynobject.exception.DynFieldNotFoundException
      Specified by:
      setDynValue in interface org.gvsig.tools.dynobject.DynObject
      Throws:
      org.gvsig.tools.dynobject.exception.DynFieldNotFoundException
    • allowAutomaticValues

      public boolean allowAutomaticValues()
      unsupported by default, override this otherwise
      Specified by:
      allowAutomaticValues in interface FeatureStoreProvider
      Returns:
      true if supported
      See Also:
    • append

      public void append(FeatureProvider featureProvider) throws org.gvsig.fmap.dal.exception.DataException
      unsupported by default, override this otherwise
      Specified by:
      append in interface FeatureStoreProvider
      Parameters:
      featureProvider -
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • beginAppend

      public void beginAppend() throws org.gvsig.fmap.dal.exception.DataException
      unsupported by default, override this otherwise
      Specified by:
      beginAppend in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • beginAppend

      public void beginAppend(int submode) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      beginAppend in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • endAppend

      public void endAppend() throws org.gvsig.fmap.dal.exception.DataException
      unsupported by default, override this otherwise
      Specified by:
      endAppend in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
      See Also:
    • abortAppend

      public void abortAppend() throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      abortAppend in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • supportsAppendMode

      public boolean supportsAppendMode()
      Specified by:
      supportsAppendMode in interface FeatureStoreProvider
    • getChildren

      public org.gvsig.tools.util.UnmodifiableBasicMap<String,org.gvsig.fmap.dal.DataStore> getChildren()
      Description copied from interface: DataStoreProvider
      Returns an UnmodifiableBasicMap with subStores from this store. If do not have children, return an empty UnmodifiableBasicMap. Never returns null.
      Specified by:
      getChildren in interface DataStoreProvider
      Overrides:
      getChildren in class AbstractDataStoreProvider
      Returns:
      SubStores UnmodifiableBasicMap
    • getStoresRepository

      public org.gvsig.fmap.dal.StoresRepository getStoresRepository()
      Specified by:
      getStoresRepository in interface DataStoreProvider
      Overrides:
      getStoresRepository in class AbstractDataStoreProvider
    • getResourcesStorage

      public org.gvsig.tools.resourcesstorage.ResourcesStorage getResourcesStorage()
      Description copied from interface: DataStoreProvider
      Returns the resource store associated with this provider. If one does not exist, it will return null.
      Specified by:
      getResourcesStorage in interface DataStoreProvider
      Overrides:
      getResourcesStorage in class AbstractDataStoreProvider
      Returns:
      the ResourcesStorage or null.
    • getExplorer

      public org.gvsig.fmap.dal.DataServerExplorer getExplorer() throws org.gvsig.fmap.dal.exception.ReadException, org.gvsig.fmap.dal.exception.ValidateDataParametersException
      unsupported by default (return null), override this otherwise
      Specified by:
      getExplorer in interface DataStoreProvider
      Returns:
      ServerExplorer
      Throws:
      org.gvsig.fmap.dal.exception.ReadException
      org.gvsig.fmap.dal.exception.ValidateDataParametersException
      See Also:
    • clear

      public void clear()
      Specified by:
      clear in interface org.gvsig.tools.dynobject.DynObject
    • internalGetFeatureProviderByReference

      protected abstract FeatureProvider internalGetFeatureProviderByReference(FeatureReferenceProviderServices reference, org.gvsig.fmap.dal.feature.FeatureType featureType) throws org.gvsig.fmap.dal.exception.DataException
      Returns a FeatureProvider by reference, using the provided FeatureType. This is the child classes implementation of the getFeatureProviderByReference(FeatureReferenceProviderServices) method.
      Parameters:
      reference - the reference to the FeatureProvider
      featureType - the type of feature to load
      Returns:
      the FeatureProvider being referenced
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error loading the FeatureProvider
    • isKnownEnvelope

      public boolean isKnownEnvelope()
      Description copied from interface: FeatureStoreProvider
      Return if the provider knows the real envelope of a layer. If not, the FeatureStoreProvider.getEnvelope() method doesn't return the full envelope.
      Specified by:
      isKnownEnvelope in interface FeatureStoreProvider
      Returns:
      true if it knows the real envelope.
    • hasRetrievedFeaturesLimit

      public boolean hasRetrievedFeaturesLimit()
      Description copied from interface: FeatureStoreProvider
      Return if the maximum number of features provided by the provider are limited.
      Specified by:
      hasRetrievedFeaturesLimit in interface FeatureStoreProvider
      Returns:
      true if there is a limit of features.
    • getRetrievedFeaturesLimit

      public int getRetrievedFeaturesLimit()
      Description copied from interface: FeatureStoreProvider
      If the FeatureStoreProvider.hasRetrievedFeaturesLimit() returns true, it returns the limit of features retrieved from the provider.
      Specified by:
      getRetrievedFeaturesLimit in interface FeatureStoreProvider
      Returns:
      The limit of the retrieved features.
    • getInterval

      public org.gvsig.timesupport.Interval getInterval()
      Description copied from interface: DataStoreProvider
      Gets the Interval of the store, that means the temporal interval where the store has valid data.
      Specified by:
      getInterval in interface DataStoreProvider
      Returns:
      a time interval or null if there is not time support
    • getTimes

      public Collection getTimes()
      Description copied from interface: DataStoreProvider
      Gets all the possible values of time for which the store has data.
      Specified by:
      getTimes in interface DataStoreProvider
      Returns:
      a collection of Time objects.
    • getTimes

      public Collection getTimes(org.gvsig.timesupport.Interval interval)
      Description copied from interface: DataStoreProvider
      Gets all the possible values of time for which the store has data and intersects with an interval.
      Specified by:
      getTimes in interface DataStoreProvider
      Parameters:
      interval - the interval of time
      Returns:
      a collection of Time objects.
    • createExpression

      public org.gvsig.expressionevaluator.ExpressionBuilder createExpression()
      Specified by:
      createExpression in interface FeatureStoreProvider_v2
    • savePrjFile

      protected void savePrjFile(File dataFile, org.gvsig.crs.projection.lib.Projection proj)
    • isTemporary

      public boolean isTemporary()
      Description copied from interface: FeatureStoreProvider
      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.
      Specified by:
      isTemporary in interface FeatureStoreProvider
      Returns:
      true if the store is temporary, otherwise false.
    • fixFeatureTypeFromParameters

      public void fixFeatureTypeFromParameters()
      Specified by:
      fixFeatureTypeFromParameters in interface FeatureStoreProvider
    • supportsPassThroughMode

      public boolean supportsPassThroughMode()
      Specified by:
      supportsPassThroughMode in interface FeatureStoreProvider
    • passThroughInsert

      public void passThroughInsert(FeatureProvider featureProvider) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      passThroughInsert in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • passThroughInsertOrUpdate

      public void passThroughInsertOrUpdate(FeatureProvider featureProvider) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      passThroughInsertOrUpdate in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • passThroughUpdate

      public void passThroughUpdate(FeatureProvider featureProvider) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      passThroughUpdate in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • passThroughDelete

      public void passThroughDelete(FeatureReferenceProviderServices featureReference) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      passThroughDelete in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • passThroughDelete

      public void passThroughDelete(org.gvsig.expressionevaluator.Expression filter) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      passThroughDelete in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • passThroughUpdate

      public void passThroughUpdate(Object[] parameters, org.gvsig.expressionevaluator.Expression filter)
      Specified by:
      passThroughUpdate in interface FeatureStoreProvider
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createSet

      public FeatureSetProvider createSet(org.gvsig.fmap.dal.feature.FeatureQuery query, org.gvsig.fmap.dal.feature.FeatureType providerFeatureType, org.gvsig.fmap.dal.feature.FeatureType storeFeatureType) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      createSet in interface FeatureStoreProvider
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • allowGeometry

      public int allowGeometry(String name, org.gvsig.fmap.geom.Geometry geometry)
      Specified by:
      allowGeometry in interface FeatureStoreProvider