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

Rename Atom client #14931

Merged
merged 3 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion sdk/servicebus/Azure.Messaging.ServiceBus/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The Live tests read information from the following environment variables:
The connection string to an existing Service Bus namespace to use for testing. If specified, this namespace will be used as the basis for the test run, with queues, topics, and subscriptions dynamically managed by the tests. When the run is complete, the namespace will be left in the state that it was in before the test run took place. If not specified, a new namespace will be dynamically created for the test run and removed at the end of the run.

- `AZURE_TEST_MODE` _**(optional)**_\
This is used for the Service Bus management client tests, which use the HTTP recording framework. By default tests are run in playback mode. To change the mode this value may be set to one of the following values: `Live`, `Playback`, `Record`.
This is used for the Service Bus administration client tests, which use the HTTP recording framework. By default tests are run in playback mode. To change the mode this value may be set to one of the following values: `Live`, `Playback`, `Record`.

- `AZURE_AUTHORITY_HOST` _**(optional)**_\
The name of the Azure Authority to use for authenticating resource management operations. The default for this is appropriate for use with the Azure public cloud; when testing in other cloud instances, this may be needed.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This sample demonstrates how to use the management client to manage entities wit
```C# Snippet:CreateQueue
string connectionString = "<connection_string>";
string queueName = "<queue_name>";
var client = new ServiceBusManagementClient(connectionString);
var client = new ServiceBusAdministrationClient(connectionString);
var options = new CreateQueueOptions(queueName)
{
AutoDeleteOnIdle = TimeSpan.FromDays(7),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System;
using System.Globalization;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
internal class ManagementClientConstants
internal class AdministrationClientConstants
{
public const int QueueNameMaximumLength = 260;
public const int TopicNameMaximumLength = 260;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Data;
using System.Xml.Linq;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Specifies the authorization rule.
Expand Down Expand Up @@ -49,7 +49,7 @@ internal AuthorizationRule()

internal static AuthorizationRule ParseFromXElement(XElement xElement)
{
XAttribute attribute = xElement.Attribute(XName.Get("type", ManagementClientConstants.XmlSchemaInstanceNamespace));
XAttribute attribute = xElement.Attribute(XName.Get("type", AdministrationClientConstants.XmlSchemaInstanceNamespace));
if (attribute == null)
{
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq;
using System.Xml.Linq;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Specifies the authorization rules.
Expand All @@ -16,7 +16,7 @@ public class AuthorizationRules : List<AuthorizationRule>, IEquatable<Authorizat
internal XElement Serialize()
{
var rules = new XElement(
XName.Get("AuthorizationRules", ManagementClientConstants.ServiceBusNamespace),
XName.Get("AuthorizationRules", AdministrationClientConstants.ServiceBusNamespace),
this.Select(rule => rule.Serialize()));

return rules;
Expand All @@ -37,7 +37,7 @@ internal AuthorizationRules() { }
internal static AuthorizationRules ParseFromXElement(XElement xElement)
{
var rules = new AuthorizationRules();
var xRules = xElement.Elements(XName.Get("AuthorizationRule", ManagementClientConstants.ServiceBusNamespace));
var xRules = xElement.Elements(XName.Get("AuthorizationRule", AdministrationClientConstants.ServiceBusNamespace));
rules.AddRange(xRules.Select(rule => AuthorizationRule.ParseFromXElement(rule)));
return rules;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using Azure.Core;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Represents the set of options that can be specified for the creation of a queue.
Expand Down Expand Up @@ -130,8 +130,8 @@ public TimeSpan DefaultMessageTimeToLive
{
Argument.AssertInRange(
value,
ManagementClientConstants.MinimumAllowedTimeToLive,
ManagementClientConstants.MaximumAllowedTimeToLive,
AdministrationClientConstants.MinimumAllowedTimeToLive,
AdministrationClientConstants.MaximumAllowedTimeToLive,
nameof(DefaultMessageTimeToLive));

_defaultMessageTimeToLive = value;
Expand All @@ -149,7 +149,7 @@ public TimeSpan AutoDeleteOnIdle
{
Argument.AssertAtLeast(
value,
ManagementClientConstants.MinimumAllowedAutoDeleteOnIdle,
AdministrationClientConstants.MinimumAllowedAutoDeleteOnIdle,
nameof(AutoDeleteOnIdle));

autoDeleteOnIdle = value;
Expand All @@ -175,8 +175,8 @@ public TimeSpan DuplicateDetectionHistoryTimeWindow
{
Argument.AssertInRange(
value,
ManagementClientConstants.MinimumDuplicateDetectionHistoryTimeWindow,
ManagementClientConstants.MaximumDuplicateDetectionHistoryTimeWindow,
AdministrationClientConstants.MinimumDuplicateDetectionHistoryTimeWindow,
AdministrationClientConstants.MaximumDuplicateDetectionHistoryTimeWindow,
nameof(DuplicateDetectionHistoryTimeWindow));

_duplicateDetectionHistoryTimeWindow = value;
Expand All @@ -196,7 +196,7 @@ public int MaxDeliveryCount
{
Argument.AssertAtLeast(
value,
ManagementClientConstants.MinAllowedMaxDeliveryCount,
AdministrationClientConstants.MinAllowedMaxDeliveryCount,
nameof(MaxDeliveryCount));

_maxDeliveryCount = value;
Expand Down Expand Up @@ -291,7 +291,7 @@ public string UserMetadata
Argument.AssertNotNull(value, nameof(UserMetadata));
Argument.AssertNotTooLong(
value,
ManagementClientConstants.MaxUserMetadataLength,
AdministrationClientConstants.MaxUserMetadataLength,
nameof(UserMetadata));

_userMetadata = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Collections.Generic;
using Azure.Core;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Represents the metadata description of the subscription.
Expand Down Expand Up @@ -100,8 +100,8 @@ public TimeSpan DefaultMessageTimeToLive
{
Argument.AssertInRange(
value,
ManagementClientConstants.MinimumAllowedTimeToLive,
ManagementClientConstants.MaximumAllowedTimeToLive,
AdministrationClientConstants.MinimumAllowedTimeToLive,
AdministrationClientConstants.MaximumAllowedTimeToLive,
nameof(DefaultMessageTimeToLive));

_defaultMessageTimeToLive = value;
Expand All @@ -119,7 +119,7 @@ public TimeSpan AutoDeleteOnIdle
{
Argument.AssertAtLeast(
value,
ManagementClientConstants.MinimumAllowedAutoDeleteOnIdle,
AdministrationClientConstants.MinimumAllowedAutoDeleteOnIdle,
nameof(AutoDeleteOnIdle));

_autoDeleteOnIdle = value;
Expand Down Expand Up @@ -181,7 +181,7 @@ public int MaxDeliveryCount
{
Argument.AssertAtLeast(
value,
ManagementClientConstants.MinAllowedMaxDeliveryCount,
AdministrationClientConstants.MinAllowedMaxDeliveryCount,
nameof(AutoDeleteOnIdle));

_maxDeliveryCount = value;
Expand Down Expand Up @@ -264,7 +264,7 @@ public string UserMetadata
Argument.AssertNotNull(value, nameof(UserMetadata));
Argument.AssertNotTooLong(
value,
ManagementClientConstants.MaxUserMetadataLength,
AdministrationClientConstants.MaxUserMetadataLength,
nameof(UserMetadata));

_userMetadata = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using Azure.Core;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Represents the options that can be specified for the creation of a topic.
Expand Down Expand Up @@ -67,8 +67,8 @@ public TimeSpan DefaultMessageTimeToLive
{
Argument.AssertInRange(
value,
ManagementClientConstants.MinimumAllowedTimeToLive,
ManagementClientConstants.MaximumAllowedTimeToLive,
AdministrationClientConstants.MinimumAllowedTimeToLive,
AdministrationClientConstants.MaximumAllowedTimeToLive,
nameof(DefaultMessageTimeToLive));

_defaultMessageTimeToLive = value;
Expand All @@ -86,7 +86,7 @@ public TimeSpan AutoDeleteOnIdle
{
Argument.AssertAtLeast(
value,
ManagementClientConstants.MinimumAllowedAutoDeleteOnIdle,
AdministrationClientConstants.MinimumAllowedAutoDeleteOnIdle,
nameof(AutoDeleteOnIdle));

_autoDeleteOnIdle = value;
Expand Down Expand Up @@ -120,8 +120,8 @@ public TimeSpan DuplicateDetectionHistoryTimeWindow
{
Argument.AssertInRange(
value,
ManagementClientConstants.MinimumDuplicateDetectionHistoryTimeWindow,
ManagementClientConstants.MaximumDuplicateDetectionHistoryTimeWindow,
AdministrationClientConstants.MinimumDuplicateDetectionHistoryTimeWindow,
AdministrationClientConstants.MaximumDuplicateDetectionHistoryTimeWindow,
nameof(DuplicateDetectionHistoryTimeWindow));

_duplicateDetectionHistoryTimeWindow = value;
Expand Down Expand Up @@ -185,7 +185,7 @@ public string UserMetadata
Argument.AssertNotNull(value, nameof(UserMetadata));
Argument.AssertNotTooLong(
value,
ManagementClientConstants.MaxUserMetadataLength,
AdministrationClientConstants.MaxUserMetadataLength,
nameof(UserMetadata));

_userMetadata = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.ComponentModel;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// The status of the messaging entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using System.Collections.Generic;
using System.Globalization;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
internal class HttpRequestAndResponse
{
Expand All @@ -33,7 +33,7 @@ public HttpRequestAndResponse(
ClientDiagnostics diagnostics,
TokenCredential tokenCredential,
string fullyQualifiedNamespace,
ServiceBusManagementClientOptions.ServiceVersion version)
ServiceBusAdministrationClientOptions.ServiceVersion version)
{
_pipeline = pipeline;
_diagnostics = diagnostics;
Expand Down Expand Up @@ -91,7 +91,7 @@ internal async Task ThrowIfRequestFailedAsync(Request request, Response response

if (response.Status == (int)HttpStatusCode.Forbidden)
{
if (ex.Message.Contains(ManagementClientConstants.ForbiddenInvalidOperationSubCode))
if (ex.Message.Contains(AdministrationClientConstants.ForbiddenInvalidOperationSubCode))
{
throw new InvalidOperationException(ex.Message, ex);
}
Expand Down Expand Up @@ -214,7 +214,7 @@ public async Task<Response> PutEntityAsync(
request.Method = RequestMethod.Put;
request.Uri = requestUriBuilder;
request.Content = RequestContent.Create(Encoding.UTF8.GetBytes(requestBody));
request.Headers.Add("Content-Type", ManagementClientConstants.AtomContentType);
request.Headers.Add("Content-Type", AdministrationClientConstants.AtomContentType);

if (isUpdate)
{
Expand All @@ -226,15 +226,15 @@ public async Task<Response> PutEntityAsync(
{
var token = await GetTokenAsync(forwardTo).ConfigureAwait(false);
request.Headers.Add(
ManagementClientConstants.ServiceBusSupplementartyAuthorizationHeaderName,
AdministrationClientConstants.ServiceBusSupplementartyAuthorizationHeaderName,
credential.IsSharedAccessSignatureCredential == true ? token : $"Bearer { token }");
}

if (!string.IsNullOrWhiteSpace(fwdDeadLetterTo))
{
var token = await GetTokenAsync(fwdDeadLetterTo).ConfigureAwait(false);
request.Headers.Add(
ManagementClientConstants.ServiceBusDlqSupplementaryAuthorizationHeaderName,
AdministrationClientConstants.ServiceBusDlqSupplementaryAuthorizationHeaderName,
credential.IsSharedAccessSignatureCredential == true ? token : $"Bearer { token }");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.ComponentModel;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Specifies the SKU/tier of the messaging namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using System;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Represents the properties related to a Service Bus namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Globalization;
using System.Xml.Linq;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
internal class NamespacePropertiesExtensions
{
Expand Down Expand Up @@ -34,8 +34,8 @@ private static NamespaceProperties ParseFromEntryElement(XElement xEntry)
{
var nsInfo = new NamespaceProperties();

var nsInfoXml = xEntry.Element(XName.Get("content", ManagementClientConstants.AtomNamespace))?
.Element(XName.Get("NamespaceInfo", ManagementClientConstants.ServiceBusNamespace));
var nsInfoXml = xEntry.Element(XName.Get("content", AdministrationClientConstants.AtomNamespace))?
.Element(XName.Get("NamespaceInfo", AdministrationClientConstants.ServiceBusNamespace));

if (nsInfoXml == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.ComponentModel;

namespace Azure.Messaging.ServiceBus.Management
namespace Azure.Messaging.ServiceBus.Administration
{
/// <summary>
/// Specifies the type of entities the namespace can contain.
Expand Down
Loading