Class MongoDataStore
- Object
-
- ContentDataStore
-
- MongoDataStore
-
- All Implemented Interfaces:
DataAccess<SimpleFeatureType,SimpleFeature>,DataStore
public class MongoDataStore extends ContentDataStore
-
-
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
Constructors Constructor Description MongoDataStore(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanEntries()Cleans 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.protected List<Name>createTypeNames()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.FeatureWriter<SimpleFeatureType,SimpleFeature>getFeatureWriter(String typeName, Filter filter, Transaction tx)Returns a feature writer for the specified query and transaction.FilterCapabilitiesgetFilterCapabilities()Optional<MongoSchemaInitParams>getSchemaInitParams()MongoSchemaStoregetSchemaStore()voidsetSchemaInitParams(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 Detail
-
MongoDataStore
public MongoDataStore(String dataStoreURI)
-
MongoDataStore
public MongoDataStore(String dataStoreURI, String schemaStoreURI, boolean createDatabaseIfNeeded)
-
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 Detail
-
getFilterCapabilities
public FilterCapabilities getFilterCapabilities()
-
createSchema
public void createSchema(SimpleFeatureType incoming) throws IOException
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:
DataAccess.createSchema(FeatureType)
-
createTypeNames
protected List<Name> createTypeNames() throws IOException
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
protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException
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:
DataStore.getFeatureWriterAppend(String, Transaction)
-
createContentState
protected ContentState createContentState(ContentEntry entry)
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
public final MongoSchemaStore 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
public Optional<MongoSchemaInitParams> getSchemaInitParams()
-
setSchemaInitParams
public void setSchemaInitParams(MongoSchemaInitParams schemaInitParams)
-
-