| | 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.Management |
| | 5 | | { |
| | 6 | | using System; |
| | 7 | |
|
| | 8 | | internal class ManagementClientConstants |
| | 9 | | { |
| | 10 | | public const int QueueNameMaximumLength = 260; |
| | 11 | | public const int TopicNameMaximumLength = 260; |
| | 12 | | public const int SubscriptionNameMaximumLength = 50; |
| | 13 | | public const int RuleNameMaximumLength = 50; |
| | 14 | |
|
| | 15 | | public const string AtomNamespace = "http://www.w3.org/2005/Atom"; |
| | 16 | | public const string ServiceBusNamespace = "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"; |
| | 17 | | public const string XmlSchemaInstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance"; |
| | 18 | | public const string XmlSchemaNamespace = "http://www.w3.org/2001/XMLSchema"; |
| | 19 | | public const string SerializationNamespace = "http://schemas.microsoft.com/2003/10/Serialization/"; |
| | 20 | | public const string AtomContentType = "application/atom+xml"; |
| | 21 | | public const string apiVersionQuery = "api-version=" + ApiVersion; |
| | 22 | | public const string ApiVersion = "2017-04"; |
| | 23 | |
|
| | 24 | | public const string ServiceBusSupplementartyAuthorizationHeaderName = "ServiceBusSupplementaryAuthorization"; |
| | 25 | | public const string ServiceBusDlqSupplementaryAuthorizationHeaderName = "ServiceBusDlqSupplementaryAuthorization |
| | 26 | | public const string HttpErrorSubCodeFormatString = "SubCode={0}"; |
| 2 | 27 | | public static string ConflictOperationInProgressSubCode = |
| 2 | 28 | | string.Format(HttpErrorSubCodeFormatString, ExceptionErrorCodes.ConflictOperationInProgress.ToString("D")); |
| 2 | 29 | | public static string ForbiddenInvalidOperationSubCode = |
| 2 | 30 | | string.Format(HttpErrorSubCodeFormatString, ExceptionErrorCodes.ForbiddenInvalidOperation.ToString("D")); |
| | 31 | |
|
| 2 | 32 | | public static readonly TimeSpan MinimumAllowedTimeToLive = TimeSpan.FromSeconds(1); |
| 2 | 33 | | public static readonly TimeSpan MaximumAllowedTimeToLive = TimeSpan.MaxValue; |
| 2 | 34 | | public static readonly TimeSpan MinimumLockDuration = TimeSpan.FromSeconds(5); |
| 2 | 35 | | public static readonly TimeSpan MaximumLockDuration = TimeSpan.FromMinutes(5); |
| 2 | 36 | | public static readonly TimeSpan MinimumAllowedAutoDeleteOnIdle = TimeSpan.FromMinutes(5); |
| 2 | 37 | | public static readonly TimeSpan MaximumDuplicateDetectionHistoryTimeWindow = TimeSpan.FromDays(7); |
| 2 | 38 | | public static readonly TimeSpan MinimumDuplicateDetectionHistoryTimeWindow = TimeSpan.FromSeconds(20); |
| 2 | 39 | | public static readonly int MinAllowedMaxDeliveryCount = 1; |
| 2 | 40 | | public static readonly int MaxUserMetadataLength = 1024; |
| | 41 | |
|
| 2 | 42 | | public static char[] InvalidEntityPathCharacters = { '@', '?', '#', '*' }; |
| | 43 | |
|
| | 44 | | // Authorization constants |
| 2 | 45 | | public static readonly int SupportedClaimsCount = 3; |
| | 46 | |
|
| | 47 | | /// <summary>Specifies the error codes of the exceptions.</summary> |
| | 48 | | public enum ExceptionErrorCodes |
| | 49 | | { |
| | 50 | | /// <summary>A parse error encountered while processing a request.</summary> |
| | 51 | | BadRequest = 40000, |
| | 52 | | /// <summary>A generic unauthorized error.</summary> |
| | 53 | | UnauthorizedGeneric = 40100, |
| | 54 | | /// <summary>The service bus has no transport security.</summary> |
| | 55 | | NoTransportSecurity = 40101, |
| | 56 | | /// <summary>The token is missing.</summary> |
| | 57 | | MissingToken = 40102, |
| | 58 | | /// <summary>The signature is invalid.</summary> |
| | 59 | | InvalidSignature = 40103, |
| | 60 | | /// <summary>The audience is invalid.</summary> |
| | 61 | | InvalidAudience = 40104, |
| | 62 | | /// <summary>A malformed token.</summary> |
| | 63 | | MalformedToken = 40105, |
| | 64 | | /// <summary>The token had expired.</summary> |
| | 65 | | ExpiredToken = 40106, |
| | 66 | | /// <summary>The audience is not found.</summary> |
| | 67 | | AudienceNotFound = 40107, |
| | 68 | | /// <summary>The expiry date not found.</summary> |
| | 69 | | ExpiresOnNotFound = 40108, |
| | 70 | | /// <summary>The issuer cannot be found.</summary> |
| | 71 | | IssuerNotFound = 40109, |
| | 72 | | /// <summary>The signature cannot be found.</summary> |
| | 73 | | SignatureNotFound = 40110, |
| | 74 | | /// <summary>The incoming ip has been rejected by policy.</summary> |
| | 75 | | IpRejected = 40111, |
| | 76 | | /// <summary>The incoming ip is not in acled subnet.</summary> |
| | 77 | | IpNotInAcledSubNet = 40112, |
| | 78 | | /// <summary>A generic forbidden error.</summary> |
| | 79 | | ForbiddenGeneric = 40300, |
| | 80 | | /// <summary>Operation is not allowed.</summary> |
| | 81 | | ForbiddenInvalidOperation = 40301, |
| | 82 | | /// <summary>The endpoint is not found.</summary> |
| | 83 | | EndpointNotFound = 40400, |
| | 84 | | /// <summary>The destination is invalid.</summary> |
| | 85 | | InvalidDestination = 40401, |
| | 86 | | /// <summary>The namespace is not found.</summary> |
| | 87 | | NamespaceNotFound = 40402, |
| | 88 | | /// <summary>The store lock is lost.</summary> |
| | 89 | | StoreLockLost = 40500, |
| | 90 | | /// <summary>The SQL filters exceeded its allowable maximum number.</summary> |
| | 91 | | SqlFiltersExceeded = 40501, |
| | 92 | | /// <summary>The correlation filters exceeded its allowable maximum number.</summary> |
| | 93 | | CorrelationFiltersExceeded = 40502, |
| | 94 | | /// <summary>The subscriptions exceeded its allowable maximum number.</summary> |
| | 95 | | SubscriptionsExceeded = 40503, |
| | 96 | | /// <summary>A conflict during updating occurred.</summary> |
| | 97 | | UpdateConflict = 40504, |
| | 98 | | /// <summary>The Event Hub is at full capacity.</summary> |
| | 99 | | EventHubAtFullCapacity = 40505, |
| | 100 | | /// <summary>A generic conflict error.</summary> |
| | 101 | | ConflictGeneric = 40900, |
| | 102 | | /// <summary>An operation is in progress.</summary> |
| | 103 | | ConflictOperationInProgress = 40901, |
| | 104 | | /// <summary>The entity is not found.</summary> |
| | 105 | | EntityGone = 41000, |
| | 106 | | /// <summary>An internal error that is not specified.</summary> |
| | 107 | | UnspecifiedInternalError = 50000, |
| | 108 | | /// <summary>The error of data communication.</summary> |
| | 109 | | DataCommunicationError = 50001, |
| | 110 | | /// <summary>An internal error.</summary> |
| | 111 | | InternalFailure = 50002, |
| | 112 | | /// <summary>The provider is unreachable.</summary> |
| | 113 | | ProviderUnreachable = 50003, |
| | 114 | | /// <summary>The server is busy.</summary> |
| | 115 | | ServerBusy = 50004, |
| | 116 | | /// <summary> Archive Storage Account Server is busy. </summary> |
| | 117 | | ArchiveStorageAccountServerBusy = 50005, |
| | 118 | | /// <summary> Archive Storage Account ResourceId is invalid. </summary> |
| | 119 | | InvalidArchiveStorageAccountResourceId = 50006, |
| | 120 | | /// <summary>The error is caused by bad gateway.</summary> |
| | 121 | | BadGatewayFailure = 50200, |
| | 122 | | /// <summary>The gateway did not receive a timely response from the upstream server.</summary> |
| | 123 | | GatewayTimeoutFailure = 50400, |
| | 124 | | /// <summary>This exception detail will be used for those exceptions that are thrown without specific any ex |
| | 125 | | UnknownExceptionDetail = 60000, |
| | 126 | | } |
| | 127 | | } |
| | 128 | | } |