MongoClientBase.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright 2010-2016 MongoDB Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. using System;
  16. using System.Threading;
  17. using System.Threading.Tasks;
  18. using MongoDB.Bson;
  19. using MongoDB.Driver.Core.Clusters;
  20. namespace MongoDB.Driver
  21. {
  22. /// <summary>
  23. /// Base class for implementors of <see cref="IMongoClient"/>.
  24. /// </summary>
  25. public abstract class MongoClientBase : IMongoClient
  26. {
  27. /// <inheritdoc />
  28. public abstract ICluster Cluster { get; }
  29. /// <inheritdoc />
  30. public abstract MongoClientSettings Settings { get; }
  31. /// <inheritdoc />
  32. public virtual void DropDatabase(string name, CancellationToken cancellationToken = default(CancellationToken))
  33. {
  34. throw new NotImplementedException();
  35. }
  36. /// <inheritdoc />
  37. public abstract Task DropDatabaseAsync(string name, CancellationToken cancellationToken = default(CancellationToken));
  38. /// <inheritdoc />
  39. public abstract IMongoDatabase GetDatabase(string name, MongoDatabaseSettings settings = null);
  40. /// <inheritdoc />
  41. public virtual IAsyncCursor<BsonDocument> ListDatabases(CancellationToken cancellationToken = default(CancellationToken))
  42. {
  43. throw new NotImplementedException();
  44. }
  45. /// <inheritdoc />
  46. public abstract Task<IAsyncCursor<BsonDocument>> ListDatabasesAsync(CancellationToken cancellationToken = default(CancellationToken));
  47. /// <inheritdoc />
  48. public virtual IMongoClient WithReadConcern(ReadConcern readConcern)
  49. {
  50. throw new NotImplementedException();
  51. }
  52. /// <inheritdoc />
  53. public virtual IMongoClient WithReadPreference(ReadPreference readPreference)
  54. {
  55. throw new NotImplementedException();
  56. }
  57. /// <inheritdoc />
  58. public virtual IMongoClient WithWriteConcern(WriteConcern writeConcern)
  59. {
  60. throw new NotImplementedException();
  61. }
  62. }
  63. }