org.geotools.arcsde.data
Class ArcSdeFeatureSource

Object
  extended by ArcSdeFeatureSource
All Implemented Interfaces:
FeatureSource<SimpleFeatureType,SimpleFeature>
Direct Known Subclasses:
ArcSdeFeatureStore

public class ArcSdeFeatureSource
extends Object
implements FeatureSource<SimpleFeatureType,SimpleFeature>


Field Summary
protected  ArcSDEDataStore dataStore
           
protected  Transaction transaction
           
protected  FeatureTypeInfo typeInfo
           
 
Constructor Summary
ArcSdeFeatureSource(FeatureTypeInfo typeInfo, ArcSDEDataStore dataStore)
           
 
Method Summary
 void addFeatureListener(FeatureListener listener)
          Adds a listener to the list that's notified each time a change to the FeatureStore occurs.
 ReferencedEnvelope getBounds()
          Gets the bounding box of this datasource.
 ReferencedEnvelope getBounds(Query query)
          Gets the bounding box of the features that would be returned by this query.
protected  ReferencedEnvelope getBounds(Query namedQuery, ISession session)
           
 int getCount(Query query)
          Gets the number of the features that would be returned by this query.
protected  int getCount(Query namedQuery, ISession session)
           
 ArcSDEDataStore getDataStore()
          Access to the DataStore implementing this FeatureStore.
 FeatureReader<SimpleFeatureType,SimpleFeature> getfeatureReader(SimpleFeatureType targetSchema, Query query)
           
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures()
          Loads all features from the datasource into the return FeatureResults.
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Filter filter)
          Loads features from the datasource into the returned FeatureResults, based on the passed filter.
 FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Query query)
          Loads features from the datasource into the returned FeatureResults, based on the passed query.
 ArcSdeResourceInfo getInfo()
          Information describing the contents of this resoruce.
 Name getName()
          Returns the same name than the feature type (ie, getSchema().getName() to honor the simple feature land common practice of calling the same both the Features produces and their types
 QueryCapabilities getQueryCapabilities()
          Returns and indication of what query capabilities this FeatureSource supports natively.
 SimpleFeatureType getSchema()
          Retrieves the featureType that features extracted from this datasource will be created with.
protected  ISession getSession()
          Returns a session appropriate for the current transaction This is convenient way to get a connection for getBounds() and getCount(Query).
 Set<RenderingHints.Key> getSupportedHints()
          ArcSDE features are always "detached", so we return the FEATURE_DETACHED hint here, as well as the JTS related ones.
 ArcSdeVersionHandler getVersionHandler()
           
 void removeFeatureListener(FeatureListener listener)
          Removes a listener from the list that's notified each time a change to the FeatureStore occurs.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transaction

protected Transaction transaction

typeInfo

protected FeatureTypeInfo typeInfo

dataStore

protected ArcSDEDataStore dataStore
Constructor Detail

ArcSdeFeatureSource

public ArcSdeFeatureSource(FeatureTypeInfo typeInfo,
                           ArcSDEDataStore dataStore)
Method Detail

getName

public Name getName()
Returns the same name than the feature type (ie, getSchema().getName() to honor the simple feature land common practice of calling the same both the Features produces and their types

Specified by:
getName in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
the name of the AttributeDescriptor for the Features served by this FeatureSource
Since:
2.5
See Also:
FeatureSource.getName()

getInfo

public ArcSdeResourceInfo getInfo()
Description copied from interface: FeatureSource
Information describing the contents of this resoruce.

Please note that for FeatureContent:


getQueryCapabilities

public QueryCapabilities getQueryCapabilities()
Description copied from interface: FeatureSource
Returns and indication of what query capabilities this FeatureSource supports natively.

Specified by:
getQueryCapabilities in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
a QueryCapabilities object containing the native query capabilities.

addFeatureListener

public final void addFeatureListener(FeatureListener listener)
Description copied from interface: FeatureSource
Adds a listener to the list that's notified each time a change to the FeatureStore occurs.

Specified by:
addFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
listener - FeatureListener
See Also:
FeatureSource.addFeatureListener(FeatureListener)

removeFeatureListener

public final void removeFeatureListener(FeatureListener listener)
Description copied from interface: FeatureSource
Removes a listener from the list that's notified each time a change to the FeatureStore occurs.

Specified by:
removeFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
listener - FeatureListener
See Also:
FeatureSource.removeFeatureListener(FeatureListener)

getBounds

public final ReferencedEnvelope getBounds()
                                   throws IOException
Description copied from interface: FeatureSource
Gets the bounding box of this datasource.

With getBounds(Query) this becomes a convenience method for getBounds(Query.ALL), that is the bounds for all features contained here.

If getBounds() returns null due to expense consider using getFeatures().getBounds() as a an alternative.

Specified by:
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
The bounding box of the datasource or null if unknown and too expensive for the method to calculate.
Throws:
IOException - if there are errors getting the bounding box.
See Also:
FeatureSource.getBounds()

getBounds

public final ReferencedEnvelope getBounds(Query query)
                                   throws IOException
Description copied from interface: FeatureSource
Gets the bounding box of the features that would be returned by this query.

To retrieve the bounds of the DataSource please use getBounds( Query.ALL ).

This method is needed if we are to stream features to a gml out, since a FeatureCollection must have a boundedBy element.

If getBounds(Query) returns null due to expense consider using getFeatures(Query).getBounds() as a an alternative.

Specified by:
getBounds in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
query - Contains the Filter, and optionally MaxFeatures and StartIndex to find the bounds for.
Returns:
The bounding box of the query or null if unknown and too expensive for the method to calculate or any errors occur.
Throws:
IOException - DOCUMENT ME!
See Also:
FeatureSource.getBounds(Query)

getBounds

protected ReferencedEnvelope getBounds(Query namedQuery,
                                       ISession session)
                                throws DataSourceException,
                                       IOException
Parameters:
namedQuery -
session -
Returns:
The bounding box of the query or null if unknown and too expensive for the method to calculate or any errors occur.
Throws:
DataSourceException
IOException

getCount

public final int getCount(Query query)
                   throws IOException
Description copied from interface: FeatureSource
Gets the number of the features that would be returned by this query.

If getBounds(Query) returns -1 due to expense consider using getFeatures(Query).getCount() as a an alternative.

This method should take into account the Query's maxFeatures and startIndex, if present, in order to consistently return the number of features the query would return.

Specified by:
getCount in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
query - Contains the Filter, and optionally MaxFeatures and StartIndex to find the count for.
Returns:
The number of Features provided by the Query or -1 if count is too expensive to calculate or any errors or occur.
Throws:
IOException - if there are errors getting the count
See Also:
FeatureSource.getCount(Query)

getCount

protected int getCount(Query namedQuery,
                       ISession session)
                throws IOException
Throws:
IOException
See Also:
FeatureSource.getCount(Query)

getSession

protected final ISession getSession()
                             throws IOException
Returns a session appropriate for the current transaction

This is convenient way to get a connection for getBounds() and getCount(Query). ArcSdeFeatureStore overrides to get the connection from the transaction instead of the pool.

Returns:
Throws:
IOException

getDataStore

public final ArcSDEDataStore getDataStore()
Description copied from interface: FeatureSource
Access to the DataStore implementing this FeatureStore.

Specified by:
getDataStore in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
DataStore implementing this FeatureStore
See Also:
FeatureSource.getDataStore()

getFeatures

public final FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Query query)
                                                                     throws IOException
Description copied from interface: FeatureSource
Loads features from the datasource into the returned FeatureResults, based on the passed query.

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
query - a datasource query object. It encapsulates requested information, such as typeName, maxFeatures and filter.
Returns:
Collection The collection to put the features into.
Throws:
IOException - For all data source errors.
See Also:
FeatureSource.getFeatures(Query)

getFeatures

public final FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures(Filter filter)
                                                                     throws IOException
Description copied from interface: FeatureSource
Loads features from the datasource into the returned FeatureResults, based on the passed filter.

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Parameters:
filter - An OpenGIS filter; specifies which features to retrieve. null is not allowed, use Filter.INCLUDE instead.
Returns:
Collection The collection to put the features into.
Throws:
IOException - For all data source errors.
See Also:
FeatureSource.getFeatures(Filter)

getFeatures

public final FeatureCollection<SimpleFeatureType,SimpleFeature> getFeatures()
                                                                     throws IOException
Description copied from interface: FeatureSource
Loads all features from the datasource into the return FeatureResults.

Filter.INCLUDE can also be used to get all features. Calling this function is equivalent to using Query.ALL

Specified by:
getFeatures in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
Collection The collection to put the features into.
Throws:
IOException - For all data source errors.
See Also:
FeatureSource.getFeatures()

getSchema

public final SimpleFeatureType getSchema()
Description copied from interface: FeatureSource
Retrieves the featureType that features extracted from this datasource will be created with.

The schema returned is the LCD supported by all available Features. In the common case of shapfiles and database table this schema will match that of every feature available. In the degenerate GML case this will simply reflect the gml:AbstractFeatureType.

Specified by:
getSchema in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
the schema of features created by this datasource.
See Also:
FeatureSource.getSchema();

getSupportedHints

public final Set<RenderingHints.Key> getSupportedHints()
ArcSDE features are always "detached", so we return the FEATURE_DETACHED hint here, as well as the JTS related ones.

The JTS related hints supported are:

Note, however, that if a GeometryFactory is provided through the JTS_GEOMETRY_FACTORY hint, that very factory is used and takes precedence over all the other ones.

Specified by:
getSupportedHints in interface FeatureSource<SimpleFeatureType,SimpleFeature>
Returns:
a set of RenderingHints#Key objects (eventually empty, never null).
See Also:
FeatureSource.getSupportedHints(), Hints.FEATURE_DETACHED, Hints.JTS_GEOMETRY_FACTORY, Hints.JTS_COORDINATE_SEQUENCE_FACTORY, Hints.JTS_PRECISION_MODEL, Hints.JTS_SRID

getVersionHandler

public ArcSdeVersionHandler getVersionHandler()
                                       throws IOException
Throws:
IOException

getfeatureReader

public FeatureReader<SimpleFeatureType,SimpleFeature> getfeatureReader(SimpleFeatureType targetSchema,
                                                                       Query query)
                                                                throws IOException
Throws:
IOException


Copyright © 1996-2010 Geotools. All Rights Reserved.