public class MongoDataStore extends ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, LOGGER, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
Constructor and Description |
---|
MongoDataStore(String dataStoreURI) |
MongoDataStore(String dataStoreURI,
String schemaStoreURI) |
MongoDataStore(String dataStoreURI,
String schemaStoreURI,
boolean createDatabaseIfNeeded) |
Modifier and Type | Method and Description |
---|---|
protected ContentState |
createContentState(ContentEntry entry)
Instantiates a new content state for the entry.
|
protected ContentFeatureSource |
createFeatureSource(ContentEntry entry)
Instantiates new feature source for the entry.
|
void |
createSchema(SimpleFeatureType incoming)
Creates a new schema in the datastore.
|
protected List<Name> |
createTypeNames()
Creates a set of qualified names corresponding to the types that the datastore provides.
|
void |
dispose()
Disposes of this data store and releases any resource that it is using.
|
FeatureWriter<SimpleFeatureType,SimpleFeature> |
getFeatureWriter(String typeName,
Filter filter,
Transaction tx)
Returns a feature writer for the specified query and transaction.
|
FilterCapabilities |
getFilterCapabilities() |
ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getInfo, getLockingManager, getLogger, getNames, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, removeSchema, removeSchema, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, setNamespaceURI, updateSchema, updateSchema
public MongoDataStore(String dataStoreURI)
public FilterCapabilities getFilterCapabilities()
public void createSchema(SimpleFeatureType incoming) throws IOException
ContentDataStore
This implementation throws aUnsupportedOperationException
. Subclasses should
override to support schema creation.
createSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
createSchema
in class ContentDataStore
incoming
- FetureType to add to DataStoreIOException
- If featureType cannot be createdDataAccess.createSchema(FeatureType)
protected List<Name> createTypeNames() throws IOException
ContentDataStore
Namespaces may be left null
for data stores which do not support namespace
qualified type names.
createTypeNames
in class ContentDataStore
Name
.IOException
- Any errors occuring connecting to data.protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException
ContentDataStore
Subclasses should override this method to return a specific subclass of ContentFeatureSource
.
createFeatureSource
in class ContentDataStore
entry
- The entry.ContentFeatureSource
for the entry.IOException
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Filter filter, Transaction tx) throws IOException
ContentDataStore
This method is not intended to be overridden and is marked final. This implementation
delegates to FeatureCollection
and wraps an iterator in a FeatureWriter
.
getFeatureWriter
in interface DataStore
getFeatureWriter
in class ContentDataStore
typeName
- the type name for features that will be accessiblefilter
- defines additional constraints on the features that will be accessibletx
- the transation that the returned writer operates againstFeatureWriter
IOException
- if data access errors occurDataStore.getFeatureWriterAppend(String, Transaction)
protected ContentState createContentState(ContentEntry entry)
ContentDataStore
Subclasses may override this method to return a specific subclass of ContentState
.
createContentState
in class ContentDataStore
entry
- The entry.ContentState
for the entry.public void dispose()
DataAccess
A DataStore
cannot be used after dispose
has been called,
neither can any data access object it helped create, such as FeatureReader
, FeatureSource
or FeatureCollection
.
This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
dispose
in interface DataAccess<SimpleFeatureType,SimpleFeature>
dispose
in class ContentDataStore
Copyright © 1996–2019 Geotools. All rights reserved.