예제 #1
0
 /// <inheritdoc />
 public virtual Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync(
     IClientSessionHandle session,
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
예제 #2
0
 private ListDatabasesOperation CreateListDatabaseOperation(
     ListDatabasesOptions options,
     MessageEncoderSettings messageEncoderSettings)
 {
     return(new ListDatabasesOperation(messageEncoderSettings)
     {
         Filter = options.Filter?.Render(BsonDocumentSerializer.Instance, BsonSerializer.SerializerRegistry),
         NameOnly = options.NameOnly
     });
 }
예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #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
     });
 }
예제 #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);
        }
예제 #8
0
 /// <inheritdoc/>
 public sealed override Task <IAsyncCursor <BsonDocument> > ListDatabasesAsync(
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     return(UsingImplicitSessionAsync(session => ListDatabasesAsync(session, options, cancellationToken), cancellationToken));
 }
예제 #9
0
 /// <inheritdoc />
 public virtual IAsyncCursor <BsonDocument> ListDatabases(
     ListDatabasesOptions options,
     CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }