Class ConnectionContext

java.lang.Object
io.debezium.connector.mongodb.connection.ConnectionContext

public class ConnectionContext extends Object
Author:
Randall Hauch
  • Field Details

  • Constructor Details

    • ConnectionContext

      public ConnectionContext(Configuration config)
      Parameters:
      config - the configuration
  • Method Details

    • loadKeyStore

      static KeyStore loadKeyStore(String type, Path path, char[] password)
      Creates keystore
      Parameters:
      type - keyfile type
      path - keyfile path
      password - keyfile password
      Returns:
      keystore with loaded keys
    • createSSLContext

      static SSLContext createSSLContext(MongoDbConnectorConfig connectorConfig)
      Creates SSL context initialized with custom
      Parameters:
      connectorConfig - connector configuration
      Returns:
      ssl context
    • getConnectorConfig

      public MongoDbConnectorConfig getConnectorConfig()
    • connectionSeed

      public String connectionSeed()
      Initial connection string which is either a host specification or connection string
      Returns:
      hosts or connection string
    • connectionString

      public com.mongodb.ConnectionString connectionString()
    • maskedConnectionSeed

      public String maskedConnectionSeed()
      Same as connectionSeed() but masks sensitive information
      Returns:
      masked connection seed
    • pollInterval

      public Duration pollInterval()
    • connect

      public com.mongodb.client.MongoClient connect()
    • connect

      public MongoDbConnection connect(ReplicaSet replicaSet, Filters filters, MongoDbConnection.ErrorHandler errorHandler)
      Obtain a client scoped to specific replica set.
      Parameters:
      replicaSet - the replica set information; may not be null
      filters - the filter configuration
      errorHandler - the function to be called whenever the node is unable to MongoDbConnection.execute(String, BlockingConsumer) execute} an operation to completion; may be null
      Returns:
      the client, or null if no primary could be found for the replica set