|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.arcsde.data.ArcSDEDataStore
public class ArcSDEDataStore
DataStore implementation to work upon an ArcSDE spatial database gateway.
Takes ownership of the provided ISessionPool
so make sure to call dispose()
in
order to release resources (ArcSDE connections).
Constructor Summary | |
---|---|
ArcSDEDataStore(ISessionPool connPool)
Creates a new ArcSDE DataStore working over the given connection pool |
|
ArcSDEDataStore(ISessionPool connPool,
java.lang.String namespaceUri,
java.lang.String versionName,
boolean allowNonSpatialTables)
Creates a new ArcSDE DataStore working over the given connection pool |
Method Summary | |
---|---|
void |
createSchema(org.opengis.feature.simple.SimpleFeatureType featureType)
Creates a new ArcSDE FeatureClass if featureType has at least one geometry attribute,
or an ObjectClass (aka, non spatial registered table) if this data store instance allows non
spatial tables and there's no geometry attribute in featureType . |
void |
createSchema(org.opengis.feature.simple.SimpleFeatureType featureType,
java.util.Map<java.lang.String,java.lang.String> hints)
Creates a given FeatureType on the ArcSDE instance this DataStore is running over. |
void |
dispose()
Disposes this ArcSDEDataStore, which means disposing its session pool and hence closing all the SeConnection objects held. |
protected void |
finalize()
|
FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureReader(Query query,
Transaction transaction)
Returns an ArcSDEFeatureReader |
FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureReader(Query query,
Transaction transaction,
org.opengis.feature.simple.SimpleFeatureType featureType)
|
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureSource(org.opengis.feature.type.Name typeName)
Delegates to getFeatureSource(String) with name.getLocalPart() |
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getFeatureSource(java.lang.String typeName)
Access a FeatureSource |
org.geotools.arcsde.data.ArcSdeFeatureWriter |
getFeatureWriter(java.lang.String typeName,
org.opengis.filter.Filter filter,
Transaction transaction)
Access FeatureWriter for modification of existing DataStore contents. |
org.geotools.arcsde.data.ArcSdeFeatureWriter |
getFeatureWriter(java.lang.String typeName,
Transaction transaction)
Delegates to getFeatureWriter(typeName,
Filter.INCLUDE, transaction) |
org.geotools.arcsde.data.ArcSdeFeatureWriter |
getFeatureWriterAppend(java.lang.String typeName,
Transaction transaction)
Delegates to getFeatureWriter(typeName,
Filter.EXCLUDE, transaction) |
ServiceInfo |
getInfo()
Information about this service. |
LockingManager |
getLockingManager()
Retrieve a per featureID based locking service from this DataStore. |
java.util.List<org.opengis.feature.type.Name> |
getNames()
Returns the same list of names than getTypeNames() meaning the returned Names have
no namespace set. |
org.opengis.feature.simple.SimpleFeatureType |
getQueryType(Query query)
|
org.opengis.feature.simple.SimpleFeatureType |
getSchema(org.opengis.feature.type.Name name)
Delegates to getSchema(String) with name.getLocalPart() |
org.opengis.feature.simple.SimpleFeatureType |
getSchema(java.lang.String typeName)
Obtains the schema for the given featuretype name. |
ISession |
getSession(Transaction transaction)
Retrieve the connection for the provided transaction. |
java.lang.String[] |
getTypeNames()
List of type names; should be a list of all feature classes. |
FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> |
getView(Query query)
Access a FeatureSource |
void |
updateSchema(org.opengis.feature.type.Name typeName,
org.opengis.feature.simple.SimpleFeatureType featureType)
Delegates to updateSchema(String, SimpleFeatureType) with name.getLocalPart() |
void |
updateSchema(java.lang.String typeName,
org.opengis.feature.simple.SimpleFeatureType featureType)
This operation is not supported at this version of the GeoTools ArcSDE plugin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArcSDEDataStore(ISessionPool connPool) throws java.io.IOException
connPool
- pool of Session
this datastore works upon.
java.io.IOException
public ArcSDEDataStore(ISessionPool connPool, java.lang.String namespaceUri, java.lang.String versionName, boolean allowNonSpatialTables) throws java.io.IOException
connPool
- pool of Session
this datastore works upon.namespaceUri
- namespace URI for the SimpleFeatureType
s, AttributeType
s, and
AttributeDescriptor
s created by this datastore. May be null
.versionName
- the name of the ArcSDE version to work upon, or null
for the
DEFAULT
versionallowNonSpatialTables
- whether ArcSDE registered, non-spatial tables are to be published
java.io.IOException
Method Detail |
---|
public ISession getSession(Transaction transaction) throws java.io.IOException
The connection is held open until while the transaction is underway. A a Transaction.State is registered for this SessionPool in order to hold the session.
transaction
-
java.io.IOException
public void createSchema(org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
featureType
has at least one geometry attribute,
or an ObjectClass (aka, non spatial registered table) if this data store instance allows non
spatial tables and there's no geometry attribute in featureType
.
The new arcsde table created will have an SDE managed column to be used as primary key.
createSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
featureType
- FetureType to add to DataStore
java.io.IOException
- If featureType cannot be createdDataStore#createSchema(SimpleFeatureType)
,
createSchema(SimpleFeatureType, Map)
public org.opengis.feature.simple.SimpleFeatureType getSchema(java.lang.String typeName) throws java.io.IOException
getSchema
in interface DataStore
typeName
- typeName of requested FeatureType
java.io.IOException
- If typeName cannot be foundDataStore.getSchema(String)
public java.lang.String[] getTypeNames() throws java.io.IOException
getTypeNames
in interface DataStore
java.lang.RuntimeException
- if an exception occurs while retrieving the list of registeres feature classes on
the backend, or while obtaining the full qualified name of one of them
java.io.IOException
public ServiceInfo getInfo()
DataAccess
This method offers access to a summary of header or metadata information describing the service.
Subclasses may return a specific ServiceInfo instance that has additional information (such as FilterCapabilities).
getInfo
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
public void dispose()
dispose
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
DataAccess.dispose()
protected void finalize()
finalize
in class java.lang.Object
public FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureReader(Query query, Transaction transaction) throws java.io.IOException
ArcSDEFeatureReader
Preconditions:
query != null
query.getTypeName() != null
query.getFilter != null
transaction != null
getFeatureReader
in interface DataStore
query
- Requested form of the returned Features and the filter used
to constraints the resultstransaction
- Transaction this query operates against
ArcSDEFeatureReader
aware of the transaction state
java.io.IOException
DataStore.getFeatureReader(Query, Transaction)
public FeatureReader<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureReader(Query query, Transaction transaction, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
java.io.IOException
public org.opengis.feature.simple.SimpleFeatureType getQueryType(Query query) throws java.io.IOException
java.io.IOException
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(java.lang.String typeName) throws java.io.IOException
DataStore
The resulting FeatureSource
FeatureSource fsource = dataStore.getFeatureSource( "roads" );
FeatureStore fstore = null;
if( fsource instanceof FeatureLocking ){
fstore = (FeatureStore) fs;
}
else {
System.out.println("We do not have write access to roads");
}
getFeatureSource
in interface DataStore
FeatureSource
or FeatureStore
depending on if the user has write
permissions over typeName
java.io.IOException
DataStore.getFeatureSource(String)
public org.geotools.arcsde.data.ArcSdeFeatureWriter getFeatureWriter(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriter(typeName,
Filter.INCLUDE, transaction)
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
java.io.IOException
DataStore.getFeatureWriter(String, Transaction)
public org.geotools.arcsde.data.ArcSdeFeatureWriter getFeatureWriter(java.lang.String typeName, org.opengis.filter.Filter filter, Transaction transaction) throws java.io.IOException
DataStore
To limit FeatureWriter to the FeatureTypes defined by this DataStore, typeName is used to indicate FeatureType. The resulting feature writer will allow modifications against the same FeatureType provided by getSchema( typeName )
The FeatureWriter will provide access to the existing contents of the FeatureType referenced by typeName. The provided filter will be used to skip over Features as required.
Notes For Implementing DataStore
The returned FeatureWriter does not support the addition of new
Features to FeatureType (it would need to police your modifications to
agree with filer
). As such it will return
false
for getNext() when it reaches the end of the Query
and NoSuchElementException when next() is called.
Helper classes for implementing a FeatureWriter (in order):
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedfilter
- constraints used to limit the modificationtransaction
- Transaction this query operates against
java.io.IOException
DataStore.getFeatureWriter(String, Filter, Transaction)
public org.geotools.arcsde.data.ArcSdeFeatureWriter getFeatureWriterAppend(java.lang.String typeName, Transaction transaction) throws java.io.IOException
getFeatureWriter(typeName,
Filter.EXCLUDE, transaction)
getFeatureWriterAppend
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
java.io.IOException
DataStore.getFeatureWriterAppend(String, Transaction)
public LockingManager getLockingManager()
DataStore
It is common to return an instanceof InProcessLockingManager for DataStores that do not provide native locking.
AbstractFeatureLocking makes use of this service to provide locking
support. You are not limitied by this implementation and may simply
return null
for this value.
getLockingManager
in interface DataStore
null
, no locking yetDataStore.getLockingManager()
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getView(Query query) throws java.io.IOException, SchemaException
DataStore
The provided Query does not need to completely cover the existing
schema for Query.getTypeName(). The result will mostly likely only be
a FeatureSource
By using Query we allow support for reprojection, in addition to overriding the CoordinateSystem used by the native FeatureType.
We may wish to limit this method to only support Queries using Filter.EXCLUDE.
Update - GeoServer has an elegatent implementation of this functionality that we could steal. GeoServerFeatureSource, GeoServerFeatureStore and GeoServerFeatureLocking serve as a working prototype.
getView
in interface DataStore
query
- Query.getTypeName() locates FeatureType being viewed
java.io.IOException
- If FeatureSourceSchemaException
- If fetureType is not covered by existing schemaDataStore.getView(Query)
public void updateSchema(java.lang.String typeName, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
updateSchema
in interface DataStore
java.io.IOException
DataStore.updateSchema(String, SimpleFeatureType)
public FeatureSource<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureSource(org.opengis.feature.type.Name typeName) throws java.io.IOException
getFeatureSource(String)
with name.getLocalPart()
getFeatureSource
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
DataAccess.getFeatureSource(Name)
public java.util.List<org.opengis.feature.type.Name> getNames() throws java.io.IOException
getTypeNames()
meaning the returned Names have
no namespace set.
getNames
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
DataAccess.getNames()
public org.opengis.feature.simple.SimpleFeatureType getSchema(org.opengis.feature.type.Name name) throws java.io.IOException
getSchema(String)
with name.getLocalPart()
getSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
name
- Type name a the resource from getNames()
java.io.IOException
DataAccess.getSchema(Name)
public void updateSchema(org.opengis.feature.type.Name typeName, org.opengis.feature.simple.SimpleFeatureType featureType) throws java.io.IOException
updateSchema(String, SimpleFeatureType)
with name.getLocalPart()
updateSchema
in interface DataAccess<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature>
java.io.IOException
- if the operation failedDataAccess.getFeatureSource(Name)
public void createSchema(org.opengis.feature.simple.SimpleFeatureType featureType, java.util.Map<java.lang.String,java.lang.String> hints) throws java.io.IOException, java.lang.IllegalArgumentException
This deviation from the DataStore#createSchema(SimpleFeatureType)
API is to allow the
specification of ArcSDE specific hints for the "Feature Class" to create:
"DEFAULTS"
will be used."NONE"
, "USER"
, "SDE"
in order to set up the
row id column name to not be managed at all, to be user managed or to be managed by ArcSDE,
respectively. Refer to the ArcSDE documentation for an explanation of the meanings of those
terms.
featureType
- hints
-
java.io.IOException
java.lang.IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |