org.springframework.data.mongodb.core

Class MongoDbFactorySupport<C>

  • java.lang.Object
    • org.springframework.data.mongodb.core.MongoDbFactorySupport<C>
    • Method Detail

      • setWriteConcern

        public void setWriteConcern(com.mongodb.WriteConcern writeConcern)
        Configures the WriteConcern to be used on the MongoDatabase instance being created.
        Parameters:
        writeConcern - the writeConcern to set
      • doGetMongoDatabase

        protected abstract com.mongodb.client.MongoDatabase doGetMongoDatabase(String dbName)
        Get the actual MongoDatabase from the client.
        Parameters:
        dbName - must not be null or empty.
        Returns:
      • withSession

        public MongoDbFactory withSession(com.mongodb.client.ClientSession session)
        Description copied from interface: MongoDbFactory
        Obtain a ClientSession bound instance of MongoDbFactory returning MongoDatabase instances that are aware and bound to the given session.
        Specified by:
        withSession in interface MongoDbFactory
        Parameters:
        session - must not be null.
        Returns:
        never null.
      • closeClient

        protected abstract void closeClient()
        Close the client instance.
      • getMongoClient

        protected C getMongoClient()
        Returns:
        the Mongo client object.
      • getDefaultDatabaseName

        protected String getDefaultDatabaseName()
        Returns:
        the database name.