|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectArcSDEDataStore
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,
String namespaceUri,
String versionName,
boolean allowNonSpatialTables)
Creates a new ArcSDE DataStore working over the given connection pool |
Method Summary | |
---|---|
void |
createSchema(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(SimpleFeatureType featureType,
Map<String,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<SimpleFeatureType,SimpleFeature> |
getFeatureReader(Query query,
Transaction transaction)
Returns an ArcSDEFeatureReader
Preconditions:
query ! |
FeatureReader<SimpleFeatureType,SimpleFeature> |
getFeatureReader(Query query,
Transaction transaction,
SimpleFeatureType featureType)
|
FeatureSource<SimpleFeatureType,SimpleFeature> |
getFeatureSource(Name typeName)
Delegates to getFeatureSource(String) with name.getLocalPart() |
FeatureSource<SimpleFeatureType,SimpleFeature> |
getFeatureSource(String typeName)
Access a FeatureSource |
ArcSdeFeatureWriter |
getFeatureWriter(String typeName,
Filter filter,
Transaction transaction)
Access FeatureWriter for modification of existing DataStore contents. |
ArcSdeFeatureWriter |
getFeatureWriter(String typeName,
Transaction transaction)
Delegates to getFeatureWriter(typeName,
Filter.INCLUDE, transaction) |
ArcSdeFeatureWriter |
getFeatureWriterAppend(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. |
List<Name> |
getNames()
Returns the same list of names than getTypeNames() meaning the returned Names have
no namespace set. |
SimpleFeatureType |
getQueryType(Query query)
|
SimpleFeatureType |
getSchema(Name name)
Delegates to getSchema(String) with name.getLocalPart() |
SimpleFeatureType |
getSchema(String typeName)
Obtains the schema for the given featuretype name. |
ISession |
getSession(Transaction transaction)
Retrieve the connection for the provided transaction. |
String[] |
getTypeNames()
List of type names; should be a list of all feature classes. |
FeatureSource<SimpleFeatureType,SimpleFeature> |
getView(Query query)
Access a FeatureSource |
void |
updateSchema(Name typeName,
SimpleFeatureType featureType)
Delegates to updateSchema(String, SimpleFeatureType) with name.getLocalPart() |
void |
updateSchema(String typeName,
SimpleFeatureType featureType)
This operation is not supported at this version of the GeoTools ArcSDE plugin. |
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArcSDEDataStore(ISessionPool connPool) throws IOException
connPool
- pool of Session
this datastore works upon.
IOException
public ArcSDEDataStore(ISessionPool connPool, String namespaceUri, String versionName, boolean allowNonSpatialTables) throws 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
IOException
Method Detail |
---|
public ISession getSession(Transaction transaction) throws 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
-
IOException
public void createSchema(SimpleFeatureType featureType) throws 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<SimpleFeatureType,SimpleFeature>
featureType
- FetureType to add to DataStore
IOException
- If featureType cannot be createdDataStore#createSchema(SimpleFeatureType)
,
createSchema(SimpleFeatureType, Map)
public SimpleFeatureType getSchema(String typeName) throws IOException
getSchema
in interface DataStore
typeName
- typeName of requested FeatureType
IOException
- If typeName cannot be foundDataStore.getSchema(String)
public String[] getTypeNames() throws IOException
getTypeNames
in interface DataStore
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
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<SimpleFeatureType,SimpleFeature>
public void dispose()
dispose
in interface DataAccess<SimpleFeatureType,SimpleFeature>
DataAccess.dispose()
protected void finalize()
finalize
in class Object
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(Query query, Transaction transaction) throws 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
IOException
DataStore.getFeatureReader(Query, Transaction)
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(Query query, Transaction transaction, SimpleFeatureType featureType) throws IOException
IOException
public SimpleFeatureType getQueryType(Query query) throws IOException
IOException
public FeatureSource<SimpleFeatureType,SimpleFeature> getFeatureSource(String typeName) throws 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
IOException
DataStore.getFeatureSource(String)
public ArcSdeFeatureWriter getFeatureWriter(String typeName, Transaction transaction) throws IOException
getFeatureWriter(typeName,
Filter.INCLUDE, transaction)
getFeatureWriter
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
IOException
DataStore.getFeatureWriter(String, Transaction)
public ArcSdeFeatureWriter getFeatureWriter(String typeName, Filter filter, Transaction transaction) throws 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
IOException
DataStore.getFeatureWriter(String, Filter, Transaction)
public ArcSdeFeatureWriter getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException
getFeatureWriter(typeName,
Filter.EXCLUDE, transaction)
getFeatureWriterAppend
in interface DataStore
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
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<SimpleFeatureType,SimpleFeature> getView(Query query) throws 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
IOException
- If FeatureSourceSchemaException
- If fetureType is not covered by existing schemaDataStore.getView(Query)
public void updateSchema(String typeName, SimpleFeatureType featureType) throws IOException
updateSchema
in interface DataStore
IOException
DataStore.updateSchema(String, SimpleFeatureType)
public FeatureSource<SimpleFeatureType,SimpleFeature> getFeatureSource(Name typeName) throws IOException
getFeatureSource(String)
with name.getLocalPart()
getFeatureSource
in interface DataAccess<SimpleFeatureType,SimpleFeature>
IOException
DataAccess.getFeatureSource(Name)
public List<Name> getNames() throws IOException
getTypeNames()
meaning the returned Names have
no namespace set.
getNames
in interface DataAccess<SimpleFeatureType,SimpleFeature>
IOException
DataAccess.getNames()
public SimpleFeatureType getSchema(Name name) throws IOException
getSchema(String)
with name.getLocalPart()
getSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
name
- Type name a the resource from getNames()
IOException
DataAccess.getSchema(Name)
public void updateSchema(Name typeName, SimpleFeatureType featureType) throws IOException
updateSchema(String, SimpleFeatureType)
with name.getLocalPart()
updateSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
IOException
- if the operation failedDataAccess.getFeatureSource(Name)
public void createSchema(SimpleFeatureType featureType, Map<String,String> hints) throws IOException, 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
-
IOException
IllegalArgumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |