use of org.jnosql.diana.api.Settings in project jnosql-diana-driver by eclipse.
the class MongoDBDocumentConfigurationTest method shouldCreateSettings.
@Test
public void shouldCreateSettings() {
Settings settings = Settings.builder().put("mongodb-server-host-1", "172.17.0.2:27017").build();
MongoDBDocumentConfiguration configuration = new MongoDBDocumentConfiguration();
DocumentCollectionManagerFactory managerFactory = configuration.get(settings);
assertNotNull(managerFactory);
assertNotNull(configuration.getAsync(settings));
}
use of org.jnosql.diana.api.Settings in project jnosql-diana-driver by eclipse.
the class RiakKeyValueConfiguration method get.
@Override
public RiakBucketManagerFactory get(Settings settings) {
requireNonNull(settings, "settings is required");
List<RiakNode> nodes = new ArrayList<>();
settings.keySet().stream().filter(k -> k.startsWith(SERVER_PREFIX)).sorted().map(settings::get).map(a -> new RiakNode.Builder().withRemoteAddress(a.toString()).build()).forEach(nodes::add);
if (nodes.isEmpty()) {
nodes.add(DEFAULT_NODE);
}
RiakCluster cluster = new RiakCluster.Builder(nodes).build();
return new RiakBucketManagerFactory(cluster);
}
use of org.jnosql.diana.api.Settings in project jnosql-diana-driver by eclipse.
the class CassandraConfigurationTest method shoudlCreateDocumentEntityManagerFactoryFromSettings.
@Test
public void shoudlCreateDocumentEntityManagerFactoryFromSettings() {
Settings settings = Settings.builder().put("cassandra-hoster-1", "localhost").put("cassandra-port", "9142").build();
CassandraConfiguration cassandraConfiguration = new CassandraConfiguration();
ColumnFamilyManagerFactory entityManagerFactory = cassandraConfiguration.get(settings);
assertNotNull(entityManagerFactory);
}
Aggregations