@SuppressWarnings("deprecation") Mongo(final Cluster cluster, final MongoClientOptions options, final List<MongoCredential> credentialsList) { this.options = options; this.readPreference = options.getReadPreference(); this.writeConcern = options.getWriteConcern(); this.readConcern = options.getReadConcern(); this.optionHolder = new Bytes.OptionHolder(null); this.credentialsList = unmodifiableList(credentialsList); this.delegate = new MongoClientDelegate(cluster, credentialsList, this); cursorCleaningService = options.isCursorFinalizerEnabled() ? createCursorCleaningService() : null; }
private <TResult> ChangeStreamIterable<TResult> createChangeStreamIterable(@Nullable final ClientSession clientSession, final List<? extends Bson> pipeline, final Class<TResult> resultClass) { MongoClientOptions clientOptions = getMongoClientOptions(); return MongoIterables.changeStreamOf(clientSession, "admin", clientOptions.getCodecRegistry(), clientOptions.getReadPreference(), clientOptions.getReadConcern(), createOperationExecutor(), pipeline, resultClass, ChangeStreamLevel.CLIENT); }
/** * @param databaseName the name of the database to retrieve * @return a {@code MongoDatabase} representing the specified database * @throws IllegalArgumentException if databaseName is invalid * @see MongoNamespace#checkDatabaseNameValidity(String) */ public MongoDatabase getDatabase(final String databaseName) { MongoClientOptions clientOptions = getMongoClientOptions(); return new MongoDatabaseImpl(databaseName, clientOptions.getCodecRegistry(), clientOptions.getReadPreference(), clientOptions.getWriteConcern(), clientOptions.getRetryWrites(), clientOptions.getReadConcern(), createOperationExecutor()); }
writeConcern = options.getWriteConcern(); retryWrites = options.getRetryWrites(); readConcern = options.getReadConcern(); codecRegistry = options.getCodecRegistry(); serverSelector = options.getServerSelector();
/** * Returns {@code true} if the given {@code uri} has a read concern set. * @param uri the URI to check. * @return {@code true} if the URI has a read concern set, {@code false} * otherwise. */ public static boolean hasReadConcern(@NotNull String uri) { ReadConcern rc = new MongoClientURI(checkNotNull(uri)) .getOptions().getReadConcern(); return readConcernLevel(rc) != null; }
/** * Returns {@code true} if the given {@code uri} has a read concern set. * @param uri the URI to check. * @return {@code true} if the URI has a read concern set, {@code false} * otherwise. */ public static boolean hasReadConcern(@NotNull String uri) { ReadConcern rc = new MongoClientURI(checkNotNull(uri)) .getOptions().getReadConcern(); return readConcernLevel(rc) != null; }
@SuppressWarnings("deprecation") Mongo(final Cluster cluster, final MongoClientOptions options, final List<MongoCredential> credentialsList) { this.options = options; this.readPreference = options.getReadPreference(); this.writeConcern = options.getWriteConcern(); this.readConcern = options.getReadConcern(); this.optionHolder = new Bytes.OptionHolder(null); this.credentialsList = unmodifiableList(credentialsList); this.delegate = new MongoClientDelegate(cluster, credentialsList, this); cursorCleaningService = options.isCursorFinalizerEnabled() ? createCursorCleaningService() : null; }
private <TResult> ChangeStreamIterable<TResult> createChangeStreamIterable(@Nullable final ClientSession clientSession, final List<? extends Bson> pipeline, final Class<TResult> resultClass) { MongoClientOptions clientOptions = getMongoClientOptions(); return MongoIterables.changeStreamOf(clientSession, "admin", clientOptions.getCodecRegistry(), clientOptions.getReadPreference(), clientOptions.getReadConcern(), createOperationExecutor(), pipeline, resultClass, ChangeStreamLevel.CLIENT); }
/** * @param databaseName the name of the database to retrieve * @return a {@code MongoDatabase} representing the specified database * @throws IllegalArgumentException if databaseName is invalid * @see MongoNamespace#checkDatabaseNameValidity(String) */ public MongoDatabase getDatabase(final String databaseName) { MongoClientOptions clientOptions = getMongoClientOptions(); return new MongoDatabaseImpl(databaseName, clientOptions.getCodecRegistry(), clientOptions.getReadPreference(), clientOptions.getWriteConcern(), clientOptions.getRetryWrites(), clientOptions.getReadConcern(), createOperationExecutor()); }
writeConcern = options.getWriteConcern(); retryWrites = options.getRetryWrites(); readConcern = options.getReadConcern(); codecRegistry = options.getCodecRegistry(); serverSelector = options.getServerSelector();