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();
}
Aggregations