Skip to content

Commit 0a450d5

Browse files
authored
CSHARP-5317: Mark API as obsolete: Connection + Cluster (#1488)
1 parent 18bce25 commit 0a450d5

File tree

12 files changed

+25
-0
lines changed

12 files changed

+25
-0
lines changed

src/MongoDB.Driver.Core/Core/Bindings/ICoreServerSessionPool.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
17+
1618
namespace MongoDB.Driver
1719
{
1820
/// <summary>

src/MongoDB.Driver.Core/Core/Clusters/ICluster.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public interface ICluster : IDisposable
3333
/// <summary>
3434
/// Occurs when the cluster description has changed.
3535
/// </summary>
36+
[Obsolete("This event will be removed in a later release.")]
3637
event EventHandler<ClusterDescriptionChangedEventArgs> DescriptionChanged;
3738

3839
// properties
@@ -65,19 +66,22 @@ public interface ICluster : IDisposable
6566
/// Acquires a core server session.
6667
/// </summary>
6768
/// <returns>A core server session.</returns>
69+
[Obsolete("This method will be removed in a later release.")]
6870
ICoreServerSession AcquireServerSession();
6971

7072
/// <summary>
7173
/// Gets the crypt client.
7274
/// </summary>
7375
/// <returns>A crypt client.</returns>
7476
#pragma warning disable CS3003
77+
[Obsolete("This property will be removed in a later release.")]
7578
CryptClient CryptClient { get; }
7679
#pragma warning restore
7780

7881
/// <summary>
7982
/// Initializes the cluster.
8083
/// </summary>
84+
[Obsolete("This method will be removed in a later release.")]
8185
void Initialize();
8286

8387
/// <summary>
@@ -86,6 +90,7 @@ public interface ICluster : IDisposable
8690
/// <param name="selector">The server selector.</param>
8791
/// <param name="cancellationToken">The cancellation token.</param>
8892
/// <returns>The selected server.</returns>
93+
[Obsolete("This method will be removed in a later release.")]
8994
IServer SelectServer(IServerSelector selector, CancellationToken cancellationToken);
9095

9196
/// <summary>
@@ -94,6 +99,7 @@ public interface ICluster : IDisposable
9499
/// <param name="selector">The server selector.</param>
95100
/// <param name="cancellationToken">The cancellation token.</param>
96101
/// <returns>A Task representing the operation. The result of the Task is the selected server.</returns>
102+
[Obsolete("This method will be removed in a later release.")]
97103
Task<IServer> SelectServerAsync(IServerSelector selector, CancellationToken cancellationToken);
98104

99105
/// <summary>
@@ -103,6 +109,7 @@ public interface ICluster : IDisposable
103109
/// <returns>
104110
/// A session.
105111
/// </returns>
112+
[Obsolete("This method will be removed in a later release.")]
106113
ICoreSessionHandle StartSession(CoreSessionOptions options = null);
107114
}
108115
}

src/MongoDB.Driver.Core/Core/Clusters/IClusterClock.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
1617
using MongoDB.Bson;
1718

1819
namespace MongoDB.Driver.Core.Clusters
1920
{
2021
/// <summary>
2122
/// A cluster clock.
2223
/// </summary>
24+
[Obsolete("This interface will be made internal in a later release.")]
2325
public interface IClusterClock
2426
{
2527
// properties

src/MongoDB.Driver.Core/Core/Compression/ICompressor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
1617
using System.IO;
1718

1819
namespace MongoDB.Driver.Core.Compression

src/MongoDB.Driver.Core/Core/Configuration/ClusterBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public ClusterBuilder ConfigureTcp(Func<TcpStreamSettings, TcpStreamSettings> co
196196
/// </summary>
197197
/// <param name="wrapper">The stream factory wrapper.</param>
198198
/// <returns>A reconfigured cluster builder.</returns>
199+
[Obsolete("This method will be made internal in a later release.")]
199200
public ClusterBuilder RegisterStreamFactory(Func<IStreamFactory, IStreamFactory> wrapper)
200201
{
201202
Ensure.IsNotNull(wrapper, nameof(wrapper));

src/MongoDB.Driver.Core/Core/ConnectionPools/IConnectionPool.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.ConnectionPools
2525
/// <summary>
2626
/// Represents a connection pool.
2727
/// </summary>
28+
[Obsolete("This interface will be made internal in a later release.")]
2829
public interface IConnectionPool : IDisposable
2930
{
3031
// properties

src/MongoDB.Driver.Core/Core/ConnectionPools/IConnectionPoolFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ namespace MongoDB.Driver.Core.ConnectionPools
2222
/// <summary>
2323
/// Handler for connections related exceptions raised in <see cref="IConnectionPool"/>.
2424
/// </summary>
25+
[Obsolete("This interface will be made internal in a later release.")]
2526
public interface IConnectionExceptionHandler
2627
{
2728
/// <summary>
@@ -34,6 +35,7 @@ public interface IConnectionExceptionHandler
3435
/// <summary>
3536
/// Represents a connection pool factory.
3637
/// </summary>
38+
[Obsolete("This interface will be made internal in a later release.")]
3739
public interface IConnectionPoolFactory
3840
{
3941
// methods

src/MongoDB.Driver.Core/Core/Connections/IConnection.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace MongoDB.Driver.Core.Connections
2727
/// <summary>
2828
/// Represents a connection.
2929
/// </summary>
30+
[Obsolete("This interface will be made internal in a later release.")]
3031
public interface IConnection : IDisposable
3132
{
3233
// properties
@@ -156,6 +157,7 @@ public interface IConnection : IDisposable
156157
/// <summary>
157158
/// Represents a handle to a connection.
158159
/// </summary>
160+
[Obsolete("This interface will be made internal in a later release.")]
159161
public interface IConnectionHandle : IConnection
160162
{
161163
// methods

src/MongoDB.Driver.Core/Core/Connections/IConnectionFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* limitations under the License.
1414
*/
1515

16+
using System;
1617
using System.Net;
1718
using MongoDB.Driver.Core.Configuration;
1819
using MongoDB.Driver.Core.Servers;
@@ -22,6 +23,7 @@ namespace MongoDB.Driver.Core.Connections
2223
/// <summary>
2324
/// Represents a connection factory.
2425
/// </summary>
26+
[Obsolete("This class will be made internal in a later release.")]
2527
public interface IConnectionFactory
2628
{
2729
// properties

src/MongoDB.Driver.Core/Core/Operations/AsyncCursor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace MongoDB.Driver.Core.Operations
3535
/// Represents an async cursor.
3636
/// </summary>
3737
/// <typeparam name="TDocument">The type of the documents.</typeparam>
38+
[Obsolete("This class will be made internal in a later release.")]
3839
public class AsyncCursor<TDocument> : IAsyncCursor<TDocument>, ICursorBatchInfo
3940
{
4041
#region static

0 commit comments

Comments
 (0)