Class MongoDataStore
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,,SimpleFeature> DataStore
-
Field Summary
Fields inherited from class ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE -
Constructor Summary
ConstructorsConstructorDescriptionMongoDataStore(String dataStoreURI) MongoDataStore(String dataStoreURI, String schemaStoreURI) MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded) MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded, MongoSchemaInitParams schemaInitParams, HTTPClient httpClient) MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded, HTTPClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionvoidCleans current memory cached entries.protected ContentStatecreateContentState(ContentEntry entry) Instantiates a new content state for the entry.protected ContentFeatureSourcecreateFeatureSource(ContentEntry entry) Instantiates new feature source for the entry.voidcreateSchema(SimpleFeatureType incoming) Creates a new schema in the datastore.Creates a set of qualified names corresponding to the types that the datastore provides.voiddispose()Disposes of this data store and releases any resource that it is using.getFeatureWriter(String typeName, Filter filter, Transaction tx) Returns a feature writer for the specified query and transaction.final MongoSchemaStorevoidsetSchemaInitParams(MongoSchemaInitParams schemaInitParams) Methods inherited from class ContentDataStore
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
-
Constructor Details
-
MongoDataStore
-
MongoDataStore
-
MongoDataStore
-
MongoDataStore
public MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded, HTTPClient httpClient) -
MongoDataStore
public MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded, MongoSchemaInitParams schemaInitParams, HTTPClient httpClient)
-
-
Method Details
-
getFilterCapabilities
-
createSchema
Description copied from class:ContentDataStoreCreates a new schema in the datastore.This implementation throws a
UnsupportedOperationException. Subclasses should override to support schema creation.- Specified by:
createSchemain interfaceDataAccess<SimpleFeatureType,SimpleFeature> - Overrides:
createSchemain classContentDataStore- Parameters:
incoming- FetureType to add to DataStore- Throws:
IOException- If featureType cannot be created- See Also:
-
createTypeNames
Description copied from class:ContentDataStoreCreates a set of qualified names corresponding to the types that the datastore provides.Namespaces may be left
nullfor data stores which do not support namespace qualified type names.- Specified by:
createTypeNamesin classContentDataStore- Returns:
- A list of
Name. - Throws:
IOException- Any errors occuring connecting to data.
-
createFeatureSource
Description copied from class:ContentDataStoreInstantiates new feature source for the entry.Subclasses should override this method to return a specific subclass of
ContentFeatureSource.- Specified by:
createFeatureSourcein classContentDataStore- Parameters:
entry- The entry.- Returns:
- An new instance of
ContentFeatureSourcefor the entry. - Throws:
IOException
-
getFeatureWriter
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(String typeName, Filter filter, Transaction tx) throws IOException Description copied from class:ContentDataStoreReturns a feature writer for the specified query and transaction.This method is not intended to be overridden and is marked final. This implementation delegates to
FeatureCollectionand wraps an iterator in aFeatureWriter.- Specified by:
getFeatureWriterin interfaceDataStore- Overrides:
getFeatureWriterin classContentDataStore- Parameters:
typeName- the type name for features that will be accessiblefilter- defines additional constraints on the features that will be accessibletx- the transaction that the returned writer operates against- Returns:
- an instance of
FeatureWriter - Throws:
IOException- if data access errors occur- See Also:
-
createContentState
Description copied from class:ContentDataStoreInstantiates a new content state for the entry.Subclasses may override this method to return a specific subclass of
ContentState.- Overrides:
createContentStatein classContentDataStore- Parameters:
entry- The entry.- Returns:
- A new instance of
ContentStatefor the entry.
-
getSchemaStore
-
dispose
public void dispose()Description copied from interface:DataAccessDisposes of this data store and releases any resource that it is using.A
DataStorecannot be used afterdisposehas been called, neither can any data access object it helped create, such asFeatureReader,FeatureSourceorFeatureCollection.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.
- Specified by:
disposein interfaceDataAccess<SimpleFeatureType,SimpleFeature> - Overrides:
disposein classContentDataStore
-
cleanEntries
public void cleanEntries()Cleans current memory cached entries. -
getSchemaInitParams
-
setSchemaInitParams
-