public MongoDataStore get(String database) { return get(database, builder().init().build()); }
public MongoCredentials(List<DataStoreServerAddress> dataStoreServerAddresses, String dbName, String mongoUser, String mongoPassword, Map<? extends String, ?> inputOptions, boolean checkConnection) throws IllegalOpenCGACredentialsException { this.mongoDbName = dbName; mongoDBConfiguration = MongoDBConfiguration.builder() .setUserPassword(mongoUser, mongoPassword) .setServerAddress(dataStoreServerAddresses) .load(inputOptions == null ? Collections.emptyMap() : inputOptions) .build(); if (checkConnection) { check(); } }
public MongoCredentials(String mongoHost, int mongoPort, String mongoDbName, String mongoUser, String mongoPassword, boolean checkConnection) throws IllegalOpenCGACredentialsException { this.mongoDbName = mongoDbName; mongoDBConfiguration = MongoDBConfiguration.builder() .setUserPassword(mongoUser, mongoPassword) .addServerAddress(new DataStoreServerAddress(mongoHost, mongoPort)) .build(); if (checkConnection) { check(); } }
private MongoDataStore createMongoDBDatastore(String database) { DatabaseCredentials mongodbCredentials = cellBaseConfiguration.getDatabases().getMongodb(); MongoDBConfiguration mongoDBConfiguration; MongoDBConfiguration.Builder builder = MongoDBConfiguration.builder();
private MongoDataStore createMongoDBDatastore(String database) { DatabaseCredentials mongodbCredentials = cellBaseConfiguration.getDatabases().getMongodb(); MongoDBConfiguration mongoDBConfiguration; MongoDBConfiguration.Builder builder = MongoDBConfiguration.builder();
public MongoDBAdaptorFactory(Configuration catalogConfiguration) throws CatalogDBException { MongoDBConfiguration mongoDBConfiguration = MongoDBConfiguration.builder() .setUserPassword( catalogConfiguration.getCatalog().getDatabase().getUser(), catalogConfiguration.getCatalog().getDatabase().getPassword()) .load(catalogConfiguration.getCatalog().getDatabase().getOptions()) .build(); List<DataStoreServerAddress> dataStoreServerAddresses = new LinkedList<>(); for (String hostPort : catalogConfiguration.getCatalog().getDatabase().getHosts()) { if (hostPort.contains(":")) { String[] split = hostPort.split(":"); int port = Integer.valueOf(split[1]); dataStoreServerAddresses.add(new DataStoreServerAddress(split[0], port)); } else { dataStoreServerAddresses.add(new DataStoreServerAddress(hostPort, 27017)); } } this.mongoManager = new MongoDataStoreManager(dataStoreServerAddresses); this.configuration = mongoDBConfiguration; this.database = getCatalogDatabase(catalogConfiguration.getDatabasePrefix()); logger = LoggerFactory.getLogger(this.getClass()); connect(); }
&& mongodbCredentials.getOptions().get("authenticationDatabase") != null && !mongodbCredentials.getOptions().get("authenticationDatabase").isEmpty()) { mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", mongodbCredentials.getUser()) .add("password", mongodbCredentials.getPassword()) mongodbCredentials.getOptions().get("authenticationDatabase")); } else { mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", mongodbCredentials.getUser()) .add("password", mongodbCredentials.getPassword()).build();
&& mongodbCredentials.getOptions().get("authenticationDatabase") != null && !mongodbCredentials.getOptions().get("authenticationDatabase").isEmpty()) { mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", mongodbCredentials.getUser()) .add("password", mongodbCredentials.getPassword()) mongodbCredentials.getOptions().get("authenticationDatabase")); } else { mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", mongodbCredentials.getUser()) .add("password", mongodbCredentials.getPassword()).build();
configuration.getCatalog().getDatabase().getHosts().get(0).split(":")[0], 27017); MongoDBConfiguration mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", configuration.getCatalog().getDatabase().getUser()) .add("password", configuration.getCatalog().getDatabase().getPassword())
.openStream()); configuration.getAdmin().setAlgorithm("HS256"); MongoDBConfiguration mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", configuration.getCatalog().getDatabase().getUser()) .add("password", configuration.getCatalog().getDatabase().getPassword())
configuration.getCatalog().getDatabase().getHosts().get(0).split(":")[0], 27017); MongoDBConfiguration mongoDBConfiguration = MongoDBConfiguration.builder() .add("username", configuration.getCatalog().getDatabase().getUser()) .add("password", configuration.getCatalog().getDatabase().getPassword())