|
||||||||||
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)
|
SimpleFeatureSource |
getFeatureSource(Name typeName)
Delegates to getFeatureSource(String) with name.getLocalPart() |
SimpleFeatureSource |
getFeatureSource(String typeName)
Gets a SimpleFeatureSource for features of the specified
type. |
ArcSdeFeatureWriter |
getFeatureWriter(String typeName,
Filter filter,
Transaction transaction)
Gets a FeatureWriter to modify features in this DataStore . |
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. |
void |
removeSchema(Name typeName)
Used to permanently remove a schema from the underlying storage This functionality is similar to an "drop table" statement in SQL. |
void |
removeSchema(String typeName)
Used to permanently remove a schema from the underlying storage This functionality is similar to an "drop table" statement in SQL. |
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
- the feature type name
IOException
- if typeName
is not availableDataStore.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
- if data access errors occurpublic 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
- a query providing the schema and constraints for
features that the reader will returntransaction
- a transaction that this reader will operate against
ArcSDEFeatureReader
aware of the transaction state
IOException
- if data access errors occurDataStore.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 SimpleFeatureSource getFeatureSource(String typeName) throws IOException
DataStore
SimpleFeatureSource
for features of the specified
type. SimpleFeatureSource
provides a high-level API for
feature operations.
The resulting SimpleFeatureSource
may implment more functionality
as in this example:
SimpleFeatureSource fsource = dataStore.getFeatureSource("roads");
if (fsource instanceof SimpleFeatureStore) {
// we have write access to the feature data
SimpleFeatureStore fstore = (SimpleFeatureStore) fs;
}
else {
System.out.println("We do not have write access to roads");
}
getFeatureSource
in interface DataStore
typeName
- the feature type
FeatureSource
or FeatureStore
depending on if the user has write
permissions over typeName
IOException
- if data access errors occurDataStore.getFeatureSource(String)
public ArcSdeFeatureWriter getFeatureWriter(String typeName, Transaction transaction) throws IOException
getFeatureWriter(typeName,
Filter.INCLUDE, transaction)
getFeatureWriter
in interface DataStore
typeName
- the type name for features that will be accessibletransaction
- the transation that the returned writer operates
against
FeatureWriter
IOException
- if data access errors occurDataStore.getFeatureWriter(String, Transaction)
public ArcSdeFeatureWriter getFeatureWriter(String typeName, Filter filter, Transaction transaction) throws IOException
DataStore
FeatureWriter
to modify features in this DataStore
.
FeatureWriter
provides an iterator style API to features.
The returned writer does not allow features to be added.
getFeatureWriter
in interface DataStore
typeName
- the type name for features that will be accessiblefilter
- defines additional constraints on the features that will
be accessibletransaction
- the transation that the returned writer operates
against
FeatureWriter
IOException
- if data access errors occurDataStore.getFeatureWriter(String, Filter, Transaction)
public ArcSdeFeatureWriter getFeatureWriterAppend(String typeName, Transaction transaction) throws IOException
getFeatureWriter(typeName,
Filter.EXCLUDE, transaction)
getFeatureWriterAppend
in interface DataStore
typeName
- name of the feature type for which features will be addedtransaction
- the transaction to operate against
FeatureWriter
that can only be used to
append new features
IOException
- if data access errors occurDataStore.getFeatureWriterAppend(String, Transaction)
public LockingManager getLockingManager()
DataStore
DataStore
.
getLockingManager
in interface DataStore
null
, no locking yetDataStore.getLockingManager()
public void updateSchema(String typeName, SimpleFeatureType featureType) throws IOException
updateSchema
in interface DataStore
typeName
- name of the feature type to updatefeatureType
- the new schema to apply
IOException
- on errorDataStore.updateSchema(String, SimpleFeatureType)
public SimpleFeatureSource getFeatureSource(Name typeName) throws IOException
getFeatureSource(String)
with name.getLocalPart()
getFeatureSource
in interface DataAccess<SimpleFeatureType,SimpleFeature>
getFeatureSource
in interface DataStore
typeName
- the qualified name of the feature type
SimpleFeatureSource
(or possibly a subclass) providing
operations for features of the specified type
IOException
- if data access errors occurDataAccess.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
public void removeSchema(Name typeName) throws IOException
DataAccess
This functionality is similar to an "drop table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
removeSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
IOException
- if the operation failedpublic void removeSchema(String typeName) throws IOException
DataStore
This functionality is similar to an "drop table" statement in SQL. Implementation is optional; it may not be supported by all servers or files.
removeSchema
in interface DataStore
IOException
- if the operation failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |