Example #1
0
 /// <inheritdoc />
 public virtual Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync(
     IClientSessionHandle session,
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
Example #2
0
 private ListDatabasesOperation CreateListDatabaseOperation(
     ListDatabasesOptions options,
     MessageEncoderSettings messageEncoderSettings)
 {
     return(new ListDatabasesOperation(messageEncoderSettings)
     {
         Filter = options.Filter?.Render(BsonDocumentSerializer.Instance, BsonSerializer.SerializerRegistry),
         NameOnly = options.NameOnly
     });
 }
Example #3
0
        /// <inheritdoc />
        public sealed override async Task <IAsyncCursor <string> > ListDatabaseNamesAsync(
            IClientSessionHandle session,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new ListDatabasesOptions {
                NameOnly = true
            };
            var databases = await ListDatabasesAsync(session, options, cancellationToken).ConfigureAwait(false);

            return(CreateDatabaseNamesCursor(databases));
        }
Example #4
0
        /// <inheritdoc />
        public sealed override IAsyncCursor <string> ListDatabaseNames(
            IClientSessionHandle session,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new ListDatabasesOptions {
                NameOnly = true
            };
            var databases = ListDatabases(session, options, cancellationToken);

            return(CreateDatabaseNamesCursor(databases));
        }
Example #5
0
        /// <inheritdoc/>
        public sealed override Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync(
            IClientSessionHandle session,
            ListDatabasesOptions options,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            Ensure.IsNotNull(session, nameof(session));
            options = options ?? new ListDatabasesOptions();
            var messageEncoderSettings = GetMessageEncoderSettings();
            var operation = CreateListDatabaseOperation(options, messageEncoderSettings);

            return(ExecuteReadOperationAsync(session, operation, cancellationToken));
        }
Example #6
0
 private ListDatabasesOperation CreateListDatabaseOperation(
     ListDatabasesOptions options,
     MessageEncoderSettings messageEncoderSettings)
 {
     return(new ListDatabasesOperation(messageEncoderSettings)
     {
         AuthorizedDatabases = options.AuthorizedDatabases,
         Filter = options.Filter?.Render(BsonDocumentSerializer.Instance, BsonSerializer.SerializerRegistry),
         NameOnly = options.NameOnly,
         RetryRequested = _settings.RetryReads
     });
 }
Example #7
0
        private ListDatabasesOptions CreateListDatabasesOptionsFromListDatabaseNamesOptions(ListDatabaseNamesOptions options)
        {
            var listDatabasesOptions = new ListDatabasesOptions {
                NameOnly = true
            };

            if (options != null)
            {
                listDatabasesOptions.AuthorizedDatabases = options.AuthorizedDatabases;
                listDatabasesOptions.Filter = options.Filter;
            }

            return(listDatabasesOptions);
        }
Example #8
0
 /// <inheritdoc/>
 public sealed override Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync(
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(UsingImplicitSessionAsync(session => ListDatabasesAsync(session, options, cancellationToken), cancellationToken));
 }
Example #9
0
 /// <inheritdoc />
 public virtual IAsyncCursor <BsonDocument> ListDatabases(
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }