| | 1 | | // Copyright (c) Microsoft. All rights reserved. |
| | 2 | | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| | 3 | |
|
| | 4 | | namespace Microsoft.Azure.ServiceBus.Amqp |
| | 5 | | { |
| | 6 | | using System; |
| | 7 | | using Microsoft.Azure.Amqp; |
| | 8 | | using Microsoft.Azure.ServiceBus.Primitives; |
| | 9 | |
|
| | 10 | | internal class AmqpSendReceiveLinkCreator : AmqpLinkCreator |
| | 11 | | { |
| | 12 | | public AmqpSendReceiveLinkCreator(string entityPath, ServiceBusConnection serviceBusConnection, Uri endpointAddr |
| 0 | 13 | | : base(entityPath, serviceBusConnection, endpointAddress, audience, requiredClaims, cbsTokenProvider, linkSe |
| | 14 | | { |
| 0 | 15 | | } |
| | 16 | |
|
| | 17 | | protected override AmqpObject OnCreateAmqpLink(AmqpConnection connection, AmqpLinkSettings linkSettings, AmqpSes |
| | 18 | | { |
| | 19 | | AmqpLink amqpLink; |
| 0 | 20 | | if (linkSettings.IsReceiver()) |
| | 21 | | { |
| 0 | 22 | | amqpLink = new ReceivingAmqpLink(linkSettings); |
| | 23 | | } |
| | 24 | | else |
| | 25 | | { |
| 0 | 26 | | amqpLink = new SendingAmqpLink(linkSettings); |
| | 27 | | } |
| 0 | 28 | | linkSettings.LinkName = $"{connection.Settings.ContainerId};{connection.Identifier}:{amqpSession.Identifier} |
| 0 | 29 | | amqpLink.AttachTo(amqpSession); |
| 0 | 30 | | return amqpLink; |
| | 31 | | } |
| | 32 | | } |
| | 33 | | } |