Example usage for com.mongodb MongoClientSettings builder

List of usage examples for com.mongodb MongoClientSettings builder

Introduction

In this page you can find the example usage for com.mongodb MongoClientSettings builder.

Prototype

public static Builder builder(final MongoClientSettings settings) 

Source Link

Document

Convenience method to create a from an existing MongoClientSettings .

Usage

From source file:io.opentracing.contrib.mongo.TracingAsyncMongoClient.java

License:Apache License

public TracingAsyncMongoClient(final Tracer tracer, final MongoClientSettings settings,
        final MongoDriverInformation mongoDriverInformation) {
    TracingCommandListener tracingCommandListener = new TracingCommandListener(tracer);
    this.mongoClient = MongoClients.create(
            MongoClientSettings.builder(settings).addCommandListener(tracingCommandListener).build(),
            mongoDriverInformation);//  w w w.  ja  v a  2 s . co m
}