Class DocDBConnectionFactory


  • public class DocDBConnectionFactory
    extends Object
    Creates and Caches HBase Connection Instances, using the connection string as the cache key.
    • Constructor Detail

      • DocDBConnectionFactory

        public DocDBConnectionFactory()
    • Method Detail

      • getOrCreateConn

        public com.mongodb.client.MongoClient getOrCreateConn​(String connStr)
        Used to get an existing, pooled, connection or to create a new connection for the given connection string.
        Parameters:
        connStr - MongoClient connection details, format is expected to be: mongodb://:@:/?ssl=true&ssl_ca_certs=&replicaSet=
        Returns:
        A MongoClient connection if the connection succeeded, else the function will throw.
      • addConnection

        protected void addConnection​(String conStr,
                                     com.mongodb.client.MongoClient conn)
        Injects a connection into the client cache.
        Parameters:
        conStr - The connection string (aka the cache key)
        conn - The connection to inject into the client cache, most often a Mock used in testing.