| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using System; |
| | 5 | | using Microsoft.Azure.Amqp; |
| | 6 | | using Microsoft.Azure.Amqp.Encoding; |
| | 7 | |
|
| | 8 | | namespace Azure.Messaging.ServiceBus.Amqp |
| | 9 | | { |
| | 10 | | internal class AmqpClientConstants |
| | 11 | | { |
| | 12 | | // AMQP Management Operation |
| | 13 | | public const string ManagementAddress = "$management"; |
| | 14 | | public const string EntityTypeManagement = "entity-mgmt"; |
| | 15 | | public const string EntityNameKey = "name"; |
| | 16 | | public const string PartitionNameKey = "partition"; |
| | 17 | | public const string ManagementOperationKey = "operation"; |
| | 18 | | public const string ReadOperationValue = "READ"; |
| | 19 | | public const string ManagementEntityTypeKey = "type"; |
| | 20 | | public const string ManagementSecurityTokenKey = "security_token"; |
| | 21 | |
|
| | 22 | | // Filters |
| | 23 | | public const string FilterOffsetPartName = "amqp.annotation.x-opt-offset"; |
| | 24 | | public const string FilterOffset = FilterOffsetPartName + " > "; |
| | 25 | | public const string FilterInclusiveOffset = FilterOffsetPartName + " >= "; |
| | 26 | | public const string FilterOffsetFormatString = FilterOffset + "'{0}'"; |
| | 27 | | public const string FilterInclusiveOffsetFormatString = FilterInclusiveOffset + "'{0}'"; |
| | 28 | | public const string FilterReceivedAtPartNameV1 = "amqp.annotation.x-opt-enqueuedtimeutc"; |
| | 29 | | public const string FilterReceivedAtPartNameV2 = "amqp.annotation.x-opt-enqueued-time"; |
| | 30 | | public const string FilterReceivedAt = FilterReceivedAtPartNameV2 + " > "; |
| | 31 | | public const string FilterReceivedAtFormatString = FilterReceivedAt + "{0}"; |
| 2 | 32 | | public static readonly AmqpSymbol SessionFilterName = AmqpConstants.Vendor + ":session-filter"; |
| 2 | 33 | | public static readonly AmqpSymbol MessageReceiptsFilterName = AmqpConstants.Vendor + ":message-receipts-filter"; |
| 2 | 34 | | public static readonly AmqpSymbol ClientSideCursorFilterName = AmqpConstants.Vendor + ":client-side-filter"; |
| 2 | 35 | | public static readonly TimeSpan ClientMinimumTokenRefreshInterval = TimeSpan.FromMinutes(4); |
| | 36 | |
|
| | 37 | | // Properties |
| 2 | 38 | | public static readonly AmqpSymbol AttachEpoch = AmqpConstants.Vendor + ":epoch"; |
| 2 | 39 | | public static readonly AmqpSymbol BatchFlushIntervalName = AmqpConstants.Vendor + ":batch-flush-interval"; |
| 2 | 40 | | public static readonly AmqpSymbol EntityTypeName = AmqpConstants.Vendor + ":entity-type"; |
| 2 | 41 | | public static readonly AmqpSymbol TransferDestinationAddress = AmqpConstants.Vendor + ":transfer-destination-add |
| 2 | 42 | | public static readonly AmqpSymbol TimeoutName = AmqpConstants.Vendor + ":timeout"; |
| 2 | 43 | | public static readonly AmqpSymbol TrackingIdName = AmqpConstants.Vendor + ":tracking-id"; |
| | 44 | |
|
| | 45 | | // Error codes |
| 2 | 46 | | public static readonly AmqpSymbol DeadLetterName = AmqpConstants.Vendor + ":dead-letter"; |
| 2 | 47 | | public static readonly AmqpSymbol TimeoutError = AmqpConstants.Vendor + ":timeout"; |
| 2 | 48 | | public static readonly AmqpSymbol AddressAlreadyInUseError = AmqpConstants.Vendor + ":address-already-in-use"; |
| 2 | 49 | | public static readonly AmqpSymbol AuthorizationFailedError = AmqpConstants.Vendor + ":auth-failed"; |
| 2 | 50 | | public static readonly AmqpSymbol MessageLockLostError = AmqpConstants.Vendor + ":message-lock-lost"; |
| 2 | 51 | | public static readonly AmqpSymbol SessionLockLostError = AmqpConstants.Vendor + ":session-lock-lost"; |
| 2 | 52 | | public static readonly AmqpSymbol StoreLockLostError = AmqpConstants.Vendor + ":store-lock-lost"; |
| 2 | 53 | | public static readonly AmqpSymbol SessionCannotBeLockedError = AmqpConstants.Vendor + ":session-cannot-be-locked |
| 2 | 54 | | public static readonly AmqpSymbol NoMatchingSubscriptionError = AmqpConstants.Vendor + ":no-matching-subscriptio |
| 2 | 55 | | public static readonly AmqpSymbol ServerBusyError = AmqpConstants.Vendor + ":server-busy"; |
| 2 | 56 | | public static readonly AmqpSymbol ArgumentError = AmqpConstants.Vendor + ":argument-error"; |
| 2 | 57 | | public static readonly AmqpSymbol ArgumentOutOfRangeError = AmqpConstants.Vendor + ":argument-out-of-range"; |
| 2 | 58 | | public static readonly AmqpSymbol PartitionNotOwnedError = AmqpConstants.Vendor + ":partition-not-owned"; |
| 2 | 59 | | public static readonly AmqpSymbol EntityDisabledError = AmqpConstants.Vendor + ":entity-disabled"; |
| 2 | 60 | | public static readonly AmqpSymbol PublisherRevokedError = AmqpConstants.Vendor + ":publisher-revoked"; |
| 2 | 61 | | public static readonly AmqpSymbol OperationCancelledError = AmqpConstants.Vendor + ":operation-cancelled"; |
| 2 | 62 | | public static readonly AmqpSymbol EntityAlreadyExistsError = AmqpConstants.Vendor + ":entity-already-exists"; |
| 2 | 63 | | public static readonly AmqpSymbol RelayNotFoundError = AmqpConstants.Vendor + ":relay-not-found"; |
| 2 | 64 | | public static readonly AmqpSymbol MessageNotFoundError = AmqpConstants.Vendor + ":message-not-found"; |
| 2 | 65 | | public static readonly AmqpSymbol LockedUntilUtc = AmqpConstants.Vendor + ":locked-until-utc"; |
| | 66 | | } |
| | 67 | | } |