| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | using Microsoft.Azure.Amqp; |
| | 5 | | using Microsoft.Azure.Amqp.Encoding; |
| | 6 | |
|
| | 7 | | namespace Azure.Messaging.EventHubs |
| | 8 | | { |
| | 9 | | /// <summary> |
| | 10 | | /// The set of annotations for management-related operations associated with an AMQP messages and |
| | 11 | | /// entities. |
| | 12 | | /// </summary> |
| | 13 | | /// |
| | 14 | | internal static class AmqpManagement |
| | 15 | | { |
| | 16 | | /// <summary>The location to specify for management operations.</summary> |
| | 17 | | public const string Address = "$management"; |
| | 18 | |
|
| | 19 | | /// <summary>The type to specify for an AMQP link used for management operations.</summary> |
| | 20 | | public const string LinkType = "svc"; |
| | 21 | |
|
| | 22 | | /// <summary>The key to use for specifying an Event Hubs resource name.</summary> |
| | 23 | | public const string ResourceNameKey = "name"; |
| | 24 | |
|
| | 25 | | /// <summary>The key to use for specifying a partition. </summary> |
| | 26 | | public const string PartitionNameKey = "partition"; |
| | 27 | |
|
| | 28 | | /// <summary>The key to use for specifying an operation.</summary> |
| | 29 | | public const string OperationKey = "operation"; |
| | 30 | |
|
| | 31 | | /// <summary>The key to use for specifying the type of Event Hubs resource.</summary> |
| | 32 | | public const string ResourceTypeKey = "type"; |
| | 33 | |
|
| | 34 | | /// <summary>The key to use for specifying a security token.</summary> |
| | 35 | | public const string SecurityTokenKey = "security_token"; |
| | 36 | |
|
| | 37 | | /// <summary>The value to specify when requesting a read-based operation.</summary> |
| | 38 | | public const string ReadOperationValue = "READ"; |
| | 39 | |
|
| | 40 | | /// <summary>The value to specify when identifying an Event Hub resource.</summary> |
| | 41 | | public const string EventHubResourceTypeValue = AmqpConstants.Vendor + ":eventhub"; |
| | 42 | |
|
| | 43 | | /// <summary>The value to specify when identifying a partition resource.</summary> |
| | 44 | | public const string PartitionResourceTypeValue = AmqpConstants.Vendor + ":partition"; |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// The set of property mappings to use for reading management-related |
| | 48 | | /// responses from the Event Hubs service. |
| | 49 | | /// </summary> |
| | 50 | | /// |
| | 51 | | public static class ResponseMap |
| | 52 | | { |
| | 53 | | /// <summary> |
| | 54 | | /// The message property that identifies the name of a resource. |
| | 55 | | /// </summary> |
| | 56 | | /// |
| 10 | 57 | | public static MapKey Name { get; } = new MapKey("name"); |
| | 58 | |
|
| | 59 | | /// <summary> |
| | 60 | | /// The message property that identifies the date/time that a resource was created. |
| | 61 | | /// </summary> |
| | 62 | | /// |
| 6 | 63 | | public static MapKey CreatedAt { get; } = new MapKey("created_at"); |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// The message property that identifies the unique identifier associated with a partition. |
| | 67 | | /// </summary> |
| | 68 | | /// |
| 6 | 69 | | public static MapKey PartitionIdentifier { get; } = new MapKey("partition"); |
| | 70 | |
|
| | 71 | | /// <summary> |
| | 72 | | /// The message property that identifies the set of unique identifiers for each partition of an Event Hub. |
| | 73 | | /// </summary> |
| | 74 | | /// |
| 6 | 75 | | public static MapKey PartitionIdentifiers { get; } = new MapKey("partition_ids"); |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// The message property that identifies the beginning sequence number in a partition. |
| | 79 | | /// </summary> |
| | 80 | | /// |
| 6 | 81 | | public static MapKey PartitionBeginSequenceNumber { get; } = new MapKey("begin_sequence_number"); |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// The message property that identifies the last sequence number enqueued for a partition. |
| | 85 | | /// </summary> |
| | 86 | | /// |
| 6 | 87 | | public static MapKey PartitionLastEnqueuedSequenceNumber { get; } = new MapKey("last_enqueued_sequence_numbe |
| | 88 | |
|
| | 89 | | /// <summary> |
| | 90 | | /// The message property that identifies the last offset enqueued for a partition. |
| | 91 | | /// </summary> |
| | 92 | | /// |
| 6 | 93 | | public static MapKey PartitionLastEnqueuedOffset { get; } = new MapKey("last_enqueued_offset"); |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// The message property that identifies the last time enqueued for a partition. |
| | 97 | | /// </summary> |
| | 98 | | /// |
| 6 | 99 | | public static MapKey PartitionLastEnqueuedTimeUtc { get; } = new MapKey("last_enqueued_time_utc"); |
| | 100 | |
|
| | 101 | | /// <summary> |
| | 102 | | /// The message property that identifies the date and time, in UTC, that partition information was sent fr |
| | 103 | | /// </summary> |
| | 104 | | /// |
| 0 | 105 | | public static MapKey PartitionRuntimeInfoRetrievalTimeUtc { get; } = new MapKey("runtime_info_retrieval_time |
| | 106 | |
|
| | 107 | | /// <summary> |
| | 108 | | /// The message property that identifies whether or not a partition is considered empty. |
| | 109 | | /// </summary> |
| | 110 | | /// |
| 6 | 111 | | public static MapKey PartitionRuntimeInfoPartitionIsEmpty { get; } = new MapKey("is_partition_empty"); |
| | 112 | | } |
| | 113 | | } |
| | 114 | | } |