Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsoletes cleanup round 2 #6819

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace NServiceBus
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -26,11 +25,6 @@ public override async Task<TransportInfrastructure> Initialize(HostSettings host
return infrastructure;
}

[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
return new[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public override Task<TransportInfrastructure> Initialize(HostSettings hostSettin
return Task.FromResult<TransportInfrastructure>(infrastructure);
}

[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
return new[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ public override Task<TransportInfrastructure> Initialize(HostSettings hostSettin
return Task.FromResult<TransportInfrastructure>(new FakeTransportInfrastructure(receivers));
}

[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
return new[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,6 @@ namespace NServiceBus
public string StorageDirectory { get; set; }
public override System.Collections.Generic.IReadOnlyCollection<NServiceBus.TransportTransactionMode> GetSupportedTransactionModes() { }
public override System.Threading.Tasks.Task<NServiceBus.Transport.TransportInfrastructure> Initialize(NServiceBus.Transport.HostSettings hostSettings, NServiceBus.Transport.ReceiveSettings[] receivers, string[] sendingAddresses, System.Threading.CancellationToken cancellationToken = default) { }
[System.Obsolete("Inject the ITransportAddressResolver type to access the address translation mecha" +
"nism at runtime. See the NServiceBus version 8 upgrade guide for further details" +
". The member currently throws a NotImplementedException. Will be removed in vers" +
"ion 10.0.0.", true)]
public override string ToTransportAddress(NServiceBus.Transport.QueueAddress queueAddress) { }
}
public static class LearningTransportConfigurationExtensions
{
Expand Down Expand Up @@ -1573,7 +1568,8 @@ namespace NServiceBus.Pipeline
System.Collections.Generic.Dictionary<string, string> AuditMetadata { get; }
NServiceBus.Transport.OutgoingMessage Message { get; }
System.TimeSpan? TimeToBeReceived { get; }
[System.Obsolete("Use `AuditMetadata` instead. Will be removed in version 10.0.0.", true)]
[System.Obsolete("Use `AuditMetadata` instead. The member currently throws a NotImplementedExceptio" +
"n. Will be removed in version 10.0.0.", true)]
void AddAuditData(string key, string value);
NServiceBus.Pipeline.IAuditActionContext PreventChanges();
}
Expand Down Expand Up @@ -2225,8 +2221,9 @@ namespace NServiceBus.Transport
public abstract System.Threading.Tasks.Task<NServiceBus.Transport.TransportInfrastructure> Initialize(NServiceBus.Transport.HostSettings hostSettings, NServiceBus.Transport.ReceiveSettings[] receivers, string[] sendingAddresses, System.Threading.CancellationToken cancellationToken = default);
[System.Obsolete("Inject the ITransportAddressResolver type to access the address translation mecha" +
"nism at runtime. See the NServiceBus version 8 upgrade guide for further details" +
". Will be removed in version 10.0.0.", true)]
public abstract string ToTransportAddress(NServiceBus.Transport.QueueAddress address);
". The member currently throws a NotImplementedException. Will be removed in vers" +
"ion 10.0.0.", true)]
public virtual string ToTransportAddress(NServiceBus.Transport.QueueAddress address) { }
}
public abstract class TransportInfrastructure
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace NServiceBus.Core.Tests.Config;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand Down Expand Up @@ -90,11 +89,6 @@ public Task Initialize(PushRuntimeSettings limitations, OnMessage onMessage, OnE
public override string ToTransportAddress(QueueAddress address) => address.BaseAddress;
}

[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes() => new[]
{
TransportTransactionMode.ReceiveOnly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ public override Task<TransportInfrastructure> Initialize(HostSettings hostSettin
throw new NotImplementedException();
}

[Obsolete("This should be removed when TransportDefinition.ToTransportAddress is removed in v10.", true)]
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member
public override string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member

public override IReadOnlyCollection<TransportTransactionMode> GetSupportedTransactionModes()
{
throw new NotImplementedException();
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Core/Audit/AuditContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace NServiceBus
using Pipeline;
using Transport;

partial class AuditContext : BehaviorContext, IAuditContext, IAuditActionContext
class AuditContext : BehaviorContext, IAuditContext, IAuditActionContext
{
public AuditContext(OutgoingMessage message, string auditAddress, TimeSpan? timeToBeReceived, IBehaviorContext parent)
: base(parent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// <summary>
/// A transport optimized for development and learning use. DO NOT use in production.
/// </summary>
public partial class LearningTransport : TransportDefinition
public class LearningTransport : TransportDefinition
{
/// <summary>
/// Creates a new instance of a learning transport.
Expand Down
25 changes: 6 additions & 19 deletions src/NServiceBus.Core/obsoletes-v9.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ namespace NServiceBus
using NServiceBus.Settings;
using NServiceBus.Transport;

partial class AuditContext
{
[ObsoleteEx(
ReplacementTypeOrMember = nameof(AuditMetadata),
TreatAsErrorFromVersion = "9.0",
RemoveInVersion = "10.0")]
public void AddAuditData(string key, string value) => throw new NotImplementedException();
}

public static partial class ConnectorContextExtensions
{
[ObsoleteEx(
Expand Down Expand Up @@ -45,14 +36,6 @@ public static partial class ImmediateDispatchOptionExtensions
TreatAsErrorFromVersion = "9.0")]
public static bool RequiredImmediateDispatch(this ExtendableOptions options) => throw new NotImplementedException();
}
public partial class LearningTransport
{
[ObsoleteEx(
Message = "Inject the ITransportAddressResolver type to access the address translation mechanism at runtime. See the NServiceBus version 8 upgrade guide for further details.",
TreatAsErrorFromVersion = "9",
RemoveInVersion = "10")]
public override string ToTransportAddress(QueueAddress queueAddress) => throw new NotImplementedException();
}

[ObsoleteEx(
Message = "Error notification events have been replaced with a Task-based API available on the recoverability settings.",
Expand Down Expand Up @@ -191,13 +174,15 @@ public static class ServiceProviderExtensions

namespace NServiceBus.Pipeline
{
using System;

public partial interface IAuditContext : IBehaviorContext
{
[ObsoleteEx(
ReplacementTypeOrMember = nameof(AuditMetadata),
TreatAsErrorFromVersion = "9.0",
RemoveInVersion = "10.0")]
void AddAuditData(string key, string value);
void AddAuditData(string key, string value) => throw new NotImplementedException();
}
}

Expand All @@ -217,13 +202,15 @@ public static partial class RuntimeEnvironment

namespace NServiceBus.Transport
{
using System;

public abstract partial class TransportDefinition
{
[ObsoleteEx(
Message = "Inject the ITransportAddressResolver type to access the address translation mechanism at runtime. See the NServiceBus version 8 upgrade guide for further details.",
TreatAsErrorFromVersion = "9",
RemoveInVersion = "10")]
public abstract string ToTransportAddress(QueueAddress address);
public virtual string ToTransportAddress(QueueAddress address) => throw new NotImplementedException();
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/NServiceBus.Testing.Fakes/TestableAuditContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public partial class TestableAuditContext : TestableBehaviorContext, IAuditConte

IReadOnlyDictionary<string, string> IAuditActionContext.AuditMetadata => AuditMetadata;

// This method is being removed from IAuditContext, so this stub method remains until the removal is done in v10
public void AddAuditData(string key, string value) => throw new NotImplementedException();

/// <summary>
/// Locks the audit action for further changes.
/// </summary>
Expand Down