Search in sources :

Example 1 with IMongoConfig

use of de.flapdoodle.embed.mongo.config.IMongoConfig in project incubator-rya by apache.

the class MongoRyaDirectExample method getConf.

private static Configuration getConf() throws IOException {
    MongoDBIndexingConfigBuilder builder = MongoIndexingConfiguration.builder().setUseMockMongo(USE_MOCK).setUseInference(USE_INFER).setAuths("U");
    if (USE_MOCK) {
        final EmbeddedMongoFactory factory = EmbeddedMongoFactory.newFactory();
        final IMongoConfig connectionConfig = factory.getMongoServerDetails();
        final Net net = connectionConfig.net();
        builder.setMongoHost(net.getBindIp() == null ? "127.0.0.1" : net.getBindIp()).setMongoPort(net.getPort() + "");
    } else {
        // User name and password must be filled in:
        builder = builder.setMongoUser(MONGO_USER).setMongoPassword(MONGO_PASSWORD).setMongoHost(MONGO_INSTANCE_URL).setMongoPort(MONGO_INSTANCE_PORT);
    }
    return builder.setMongoDBName(MONGO_DB).setMongoCollectionPrefix(MONGO_COLL_PREFIX).setUseMongoFreetextIndex(true).setMongoFreeTextPredicates(RDFS.LABEL.stringValue()).build();
}
Also used : MongoDBIndexingConfigBuilder(org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder) EmbeddedMongoFactory(org.apache.rya.mongodb.EmbeddedMongoFactory) Net(de.flapdoodle.embed.mongo.config.Net) IMongoConfig(de.flapdoodle.embed.mongo.config.IMongoConfig)

Aggregations

IMongoConfig (de.flapdoodle.embed.mongo.config.IMongoConfig)1 Net (de.flapdoodle.embed.mongo.config.Net)1 MongoDBIndexingConfigBuilder (org.apache.rya.indexing.mongodb.MongoIndexingConfiguration.MongoDBIndexingConfigBuilder)1 EmbeddedMongoFactory (org.apache.rya.mongodb.EmbeddedMongoFactory)1