public class MongoCrawlDataStoreFactory
extends com.norconex.collector.core.data.store.impl.mongo.AbstractMongoCrawlDataStoreFactory
Mongo implementation of ICrawlDataStoreFactory
.
As of 2.7.0, password
can take a password that has been
encrypted using EncryptionUtil
(or command-line encrypt.[bat|sh]).
See for AbstractMongoCrawlDataStoreFactory
details.
<crawlDataStoreFactory class="com.norconex.collector.fs.data.store.impl.mongo.MongoCrawlDataStoreFactory"> <host>(Optional Mongo server hostname. Default to localhost)</host> <port>(Optional Mongo port. Default to 27017)</port> <dbname>(Optional Mongo database name. Default to crawl id)</dbname> <username>(Optional user name)</username> <password>(Optional user password)</password> <cachedCollectionName>(Custom "cached" collection name)</cachedCollectionName> <referencesCollectionName>(Custom "references" collection name)</referencesCollectionName> <mechanism>(Optional authentication mechanism)</mechanism> <sslEnabled>[false|true]</sslEnabled> <sslInvalidHostNameAllowed>[false|true]</sslInvalidHostNameAllowed> <!-- Use the following if password is encrypted. --> <passwordKey>(the encryption key or a reference to it)</passwordKey> <passwordKeySource>[key|file|environment|property]</passwordKeySource> </crawlDataStoreFactory>
If "username" is not provided, no authentication will be attempted. The "username" must be a valid user that has the "readWrite" role over the database (set with "dbname").
As of 2.7.1, it is now possible to specify which MongoDB mechanism to use
for authentication. Refer to AbstractMongoCrawlDataStoreFactory
for available options.
As of 2.7.2, you can define your own collection names with
AbstractMongoCrawlDataStoreFactory.setReferencesCollectionName(String)
and
AbstractMongoCrawlDataStoreFactory.setCachedCollectionName(String)
.
As of 2.8.1, you can enable SSL.
The following points to a Mongo installation with host name "localhost", port 1234, and a Mongo database called "MyCrawl".
<crawlDataStoreFactory class="com.norconex.collector.fs.data.store.impl.mongo.MongoCrawlDataStoreFactory"> <host>localhost</host> <port>1234</port> <dbname>MyCrawl</dbname> </crawlDataStoreFactory>
Constructor and Description |
---|
MongoCrawlDataStoreFactory() |
Modifier and Type | Method and Description |
---|---|
protected com.norconex.collector.core.data.store.impl.mongo.IMongoSerializer |
createMongoSerializer() |
createCrawlDataStore, equals, getCachedCollectionName, getConnectionDetails, getReferencesCollectionName, hashCode, loadFromXML, saveToXML, setCachedCollectionName, setReferencesCollectionName, toString
Copyright © 2014–2023 Norconex Inc.. All rights reserved.