Class MongoClients.Builder

java.lang.Object
io.debezium.connector.mongodb.MongoClients.Builder
Enclosing class:
MongoClients

public static class MongoClients.Builder extends Object
Configures and builds a ConnectionPool.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final com.mongodb.MongoClientSettings.Builder
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Build the client pool that will use the credentials and options already configured on this builder.
    com.mongodb.MongoClientSettings.Builder
    Obtain the options builder for client connections.
    withCredential(com.mongodb.MongoCredential credential)
    Add the given MongoCredential for use when creating clients.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • settingsBuilder

      private final com.mongodb.MongoClientSettings.Builder settingsBuilder
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withCredential

      public MongoClients.Builder withCredential(com.mongodb.MongoCredential credential)
      Add the given MongoCredential for use when creating clients.
      Parameters:
      credential - the credential; may be null, though this method does nothing if null
      Returns:
      this builder object so methods can be chained; never null
    • settings

      public com.mongodb.MongoClientSettings.Builder settings()
      Obtain the options builder for client connections.
      Returns:
      the option builder; never null
    • build

      public MongoClients build()
      Build the client pool that will use the credentials and options already configured on this builder.
      Returns:
      the new client pool; never null