Skip to content

Commit

Permalink
CSHARP-5316: Mark API as obsolete: Command + Channel (#1487)
Browse files Browse the repository at this point in the history
papafe authored Oct 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8aec7ab commit ca12a03
Showing 43 changed files with 72 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.Bindings
/// <summary>
/// Represents a handle to a channel source.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public sealed class ChannelSourceHandle : IChannelSourceHandle
{
// fields
2 changes: 2 additions & 0 deletions src/MongoDB.Driver.Core/Core/Bindings/IChannel.cs
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ namespace MongoDB.Driver.Core.Bindings
/// <summary>
/// Represents a channel (similar to a connection but operates at the level of protocols rather than messages).
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IChannel : IDisposable
{
/// <summary>
@@ -264,6 +265,7 @@ Task<CursorBatch<TDocument>> QueryAsync<TDocument>(
/// <summary>
/// Represents a handle to a channel.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IChannelHandle : IChannel
{
/// <summary>
2 changes: 2 additions & 0 deletions src/MongoDB.Driver.Core/Core/Bindings/IChannelSource.cs
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.Bindings
/// <summary>
/// Represents a channel source.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IChannelSource : IDisposable
{
/// <summary>
@@ -68,6 +69,7 @@ public interface IChannelSource : IDisposable
/// <summary>
/// Represents a handle to a channel source.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IChannelSourceHandle : IChannelSource
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.Bindings
/// <summary>
/// Represents a channel source that is bound to a server.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public sealed class ServerChannelSource : IChannelSource
{
// fields
2 changes: 2 additions & 0 deletions src/MongoDB.Driver.Core/Core/ChannelPinningHelper.cs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using System.Threading;
using MongoDB.Driver.Core.Bindings;
using MongoDB.Driver.Core.Clusters;
@@ -25,6 +26,7 @@ namespace MongoDB.Driver.Core
/// <summary>
/// Connection pinning helper.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public static class ChannelPinningHelper
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.WireProtocol
/// <summary>
/// Instructions for handling the response from a command.
/// </summary>
[Obsolete("This enum will be made internal in a later release.")]
public enum CommandResponseHandling
{
/// <summary>
2 changes: 2 additions & 0 deletions src/MongoDB.Driver.Core/Core/WireProtocol/CursorBatch.cs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using System.Collections.Generic;
using MongoDB.Bson;
using MongoDB.Driver.Core.Misc;
@@ -23,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol
/// Represents one result batch (returned from either a Query or a GetMore message)
/// </summary>
/// <typeparam name="TDocument">The type of the document.</typeparam>
[Obsolete("This struct will be made internal in a later release.")]
public struct CursorBatch<TDocument>
{
// fields
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// Represents a command message.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.MongoDBMessage" />
[Obsolete("This class will be made internal in a later release.")]
public sealed class CommandMessage : MongoDBMessage
{
// static
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// <summary>
/// Represents the payload type.
/// </summary>
[Obsolete("This enum will be made internal in a later release.")]
public enum PayloadType
{
/// <summary>
@@ -38,6 +39,7 @@ public enum PayloadType
/// <summary>
/// Represents a CommandMessage section.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class CommandMessageSection
{
/// <summary>
@@ -53,6 +55,7 @@ public abstract class CommandMessageSection
/// Represents a Type 0 CommandMessage section.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.CommandMessageSection" />
[Obsolete("This class will be made internal in a later release.")]
public abstract class Type0CommandMessageSection : CommandMessageSection
{
// private fields
@@ -98,6 +101,7 @@ public Type0CommandMessageSection(object document, IBsonSerializer documentSeria
/// </summary>
/// <typeparam name="TDocument">The type of the document.</typeparam>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Type0CommandMessageSection" />
[Obsolete("This class will be made internal in a later release.")]
public sealed class Type0CommandMessageSection<TDocument> : Type0CommandMessageSection
{
// private fields
@@ -139,6 +143,7 @@ public Type0CommandMessageSection(TDocument document, IBsonSerializer<TDocument>
/// <summary>
/// Represents a Type 1 CommandMessage section.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class Type1CommandMessageSection : CommandMessageSection
{
// private fields
@@ -241,6 +246,7 @@ public Type1CommandMessageSection(
/// </summary>
/// <typeparam name="TDocument">The type of the document.</typeparam>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.CommandMessageSection" />
[Obsolete("This class will be made internal in a later release.")]
public class Type1CommandMessageSection<TDocument> : Type1CommandMessageSection where TDocument : class
{
// private fields
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// Represents a command request message.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.RequestMessage" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandRequestMessage : RequestMessage
{
// private fields
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// Represents a command response message.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.RequestMessage" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandResponseMessage : ResponseMessage
{
// private fields
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using MongoDB.Bson.IO;
using MongoDB.Driver.Core.Compression;
using MongoDB.Driver.Core.Misc;
@@ -23,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// <summary>
/// Represents a compressed message.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class CompressedMessage : MongoDBMessage
{
private readonly CompressorType _compressorType;
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using System.IO;
using MongoDB.Bson.Serialization;
using MongoDB.Driver.Core.Compression;
@@ -23,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// <summary>
/// Represents a factory for binary message encoders.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class BinaryMessageEncoderFactory : IMessageEncoderFactory
{
// fields
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.MessageBinaryEncoderBase" />
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandMessageBinaryEncoder : MessageBinaryEncoderBase, IMessageEncoder
{
// constructors
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// Represents a binary encoder for a CommandRequestMessage.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandRequestMessageBinaryEncoder : IMessageEncoder
{
// private fields
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using MongoDB.Driver.Core.Misc;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
@@ -21,6 +22,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// Represents a binary encoder for a CommandResponseMessage.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandResponseMessageBinaryEncoder : IMessageEncoder
{
// private fields
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// <summary>
/// Represents a binary encoder for a compressed message.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public sealed class CompressedMessageBinaryEncoder : MessageBinaryEncoderBase, IMessageEncoder
{
private readonly ICompressorSource _compressorSource;
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// <summary>
/// Represents a base class for binary message encoders.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class MessageBinaryEncoderBase
{
// fields
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// <summary>
/// Represents a binary encoder for a Query message.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class QueryMessageBinaryEncoder : MessageBinaryEncoderBase, IMessageEncoder
{
// constructors
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders
/// Represents a binary encoder for a Reply message.
/// </summary>
/// <typeparam name="TDocument">The type of the documents.</typeparam>
[Obsolete("This class will be made internal in a later release.")]
public class ReplyMessageBinaryEncoder<TDocument> : MessageBinaryEncoderBase, IMessageEncoder
{
// fields
Original file line number Diff line number Diff line change
@@ -13,11 +13,14 @@
* limitations under the License.
*/

using System;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
{
/// <summary>
/// Represents a message encoder selector for CommandResponseMessages.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class CommandResponseMessageEncoderSelector : IMessageEncoderSelector
{
// public methods
Original file line number Diff line number Diff line change
@@ -13,13 +13,15 @@
* limitations under the License.
*/

using System;
using MongoDB.Driver.Core.Misc;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
{
/// <summary>
/// Represents a message encoder selector for compressed messages.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class CompressedMessageEncoderSelector : IMessageEncoderSelector
{
private readonly IMessageEncoderSelector _originalEncoderSelector;
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
/// <summary>
/// Represents an encodable message.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IEncodableMessage
{
// methods
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
/// <summary>
/// Represents a message encoder.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IMessageEncoder
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -13,13 +13,15 @@
* limitations under the License.
*/

using System;
using MongoDB.Bson.Serialization;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
{
/// <summary>
/// Represents a message encoder factory.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IMessageEncoderFactory
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -13,11 +13,14 @@
* limitations under the License.
*/

using System;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
{
/// <summary>
/// Represents the changes that can be made to a message after it has been encoded.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IMessageEncoderPostProcessor
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -13,11 +13,14 @@
* limitations under the License.
*/

using System;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
{
/// <summary>
/// Represents a message encoder selector that gets the appropriate encoder from an encoder factory.
/// </summary>
[Obsolete("This interface will be made internal in a later release.")]
public interface IMessageEncoderSelector
{
// methods
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders.MessageJsonEncoderBase" />
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandMessageJsonEncoder : MessageJsonEncoderBase, IMessageEncoder
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using MongoDB.Driver.Core.Misc;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
@@ -21,6 +22,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// Represents a Json encoder for a CommandRequestMessage.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandRequestMessageJsonEncoder : IMessageEncoder
{
// private fields
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using MongoDB.Driver.Core.Misc;

namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
@@ -21,6 +22,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// Represents a Json encoder for a CommandResponseMessage.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CommandResponseMessageJsonEncoder : IMessageEncoder
{
// private fields
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// Represents a Json encoder for a CompressedMessage.
/// </summary>
/// <seealso cref="MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder" />
[Obsolete("This class will be made internal in a later release.")]
public class CompressedMessageJsonEncoder : MessageJsonEncoderBase, IMessageEncoder
{
private readonly MessageEncoderSettings _encoderSettings;
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using System.IO;
using MongoDB.Bson.Serialization;
using MongoDB.Driver.Core.Misc;
@@ -22,6 +23,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// <summary>
/// Represents a factory for JSON message encoders.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class JsonMessageEncoderFactory : IMessageEncoderFactory
{
// fields
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// <summary>
/// Represents a base class for JSON message encoders.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class MessageJsonEncoderBase
{
// fields
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// <summary>
/// Represents a JSON encoder for a Query message.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class QueryMessageJsonEncoder : MessageJsonEncoderBase, IMessageEncoder
{
// constructors
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders.JsonEncoders
/// Represents a JSON encoder for a Reply message.
/// </summary>
/// <typeparam name="TDocument">The type of the documents.</typeparam>
[Obsolete("This class will be made internal in a later release.")]
public class ReplyMessageJsonEncoder<TDocument> : MessageJsonEncoderBase, IMessageEncoder
{
// fields
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
/// <summary>
/// Represents the names of different encoder settings.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public static class MessageEncoderSettingsName
{
// encoder settings used by the binary encoders
@@ -118,6 +119,7 @@ public static class MessageEncoderSettingsName
/// <summary>
/// Represents settings for message encoders.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class MessageEncoderSettings : IEnumerable<KeyValuePair<string, object>>
{
// fields
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@
* limitations under the License.
*/

using System;
using MongoDB.Bson.Serialization;
using MongoDB.Driver.Core.Misc;

@@ -22,6 +23,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages.Encoders
/// Represents a message encoder selector for ReplyMessages.
/// </summary>
/// <typeparam name="TDocument">The type of the document.</typeparam>
[Obsolete("This class will be made internal in a later release.")]
public class ReplyMessageEncoderSelector<TDocument> : IMessageEncoderSelector
{
// fields
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// <summary>
/// Represents a base class for messages.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class MongoDBMessage : IEncodableMessage
{
// properties
Original file line number Diff line number Diff line change
@@ -14,11 +14,14 @@
*/


using System;

namespace MongoDB.Driver.Core.WireProtocol.Messages
{
/// <summary>
/// Represents the type of message.
/// </summary>
[Obsolete("This enum will be made internal in a later release.")]
public enum MongoDBMessageType
{
/// <summary>
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// <summary>
/// Represents a Query message.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public class QueryMessage : RequestMessage
{
// fields
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// Represents a Reply message.
/// </summary>
/// <typeparam name="TDocument">The type of the document.</typeparam>
[Obsolete("This class will be made internal in a later release.")]
public class ReplyMessage<TDocument> : ResponseMessage
{
// fields
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ namespace MongoDB.Driver.Core.WireProtocol.Messages
/// <summary>
/// Represents a base class for request messages.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class RequestMessage : MongoDBMessage
{
#region static
Original file line number Diff line number Diff line change
@@ -13,11 +13,14 @@
* limitations under the License.
*/

using System;

namespace MongoDB.Driver.Core.WireProtocol.Messages
{
/// <summary>
/// Represents a base class for response messages.
/// </summary>
[Obsolete("This class will be made internal in a later release.")]
public abstract class ResponseMessage : MongoDBMessage
{
// fields

0 comments on commit ca12a03

Please sign in to comment.