Class AdrBaseService.Client
- Assembly
- Azure.Iot.Operations.Services.dll
public abstract class AdrBaseService.Client : IAsyncDisposable
- Inheritance
-
AdrBaseService.Client
- Implements
- Inherited Members
Constructors
Client(ApplicationContext, IMqttPubSubClient, Dictionary<string, string>?)
Construct a new instance of this client.
public Client(ApplicationContext applicationContext, IMqttPubSubClient mqttClient, Dictionary<string, string>? topicTokenMap = null)
Parameters
applicationContextApplicationContextThe shared context for your application.
mqttClientIMqttPubSubClientThe MQTT client to use.
topicTokenMapDictionary<string, string>The topic token replacement map to use for all operations by default. Generally, this will include the token values for topic tokens such as "modelId" which should be the same for the duration of this client's lifetime.
Properties
AssetUpdateEventTelemetryReceiver
public AdrBaseService.AssetUpdateEventTelemetryReceiver AssetUpdateEventTelemetryReceiver { get; }
Property Value
CreateOrUpdateDiscoveredAssetCommandInvoker
public AdrBaseService.CreateOrUpdateDiscoveredAssetCommandInvoker CreateOrUpdateDiscoveredAssetCommandInvoker { get; }
Property Value
DeviceUpdateEventTelemetryReceiver
public AdrBaseService.DeviceUpdateEventTelemetryReceiver DeviceUpdateEventTelemetryReceiver { get; }
Property Value
GetAssetCommandInvoker
public AdrBaseService.GetAssetCommandInvoker GetAssetCommandInvoker { get; }
Property Value
GetAssetStatusCommandInvoker
public AdrBaseService.GetAssetStatusCommandInvoker GetAssetStatusCommandInvoker { get; }
Property Value
GetDeviceCommandInvoker
public AdrBaseService.GetDeviceCommandInvoker GetDeviceCommandInvoker { get; }
Property Value
GetDeviceStatusCommandInvoker
public AdrBaseService.GetDeviceStatusCommandInvoker GetDeviceStatusCommandInvoker { get; }
Property Value
SetNotificationPreferenceForAssetUpdatesCommandInvoker
public AdrBaseService.SetNotificationPreferenceForAssetUpdatesCommandInvoker SetNotificationPreferenceForAssetUpdatesCommandInvoker { get; }
Property Value
SetNotificationPreferenceForDeviceUpdatesCommandInvoker
public AdrBaseService.SetNotificationPreferenceForDeviceUpdatesCommandInvoker SetNotificationPreferenceForDeviceUpdatesCommandInvoker { get; }
Property Value
UpdateAssetStatusCommandInvoker
public AdrBaseService.UpdateAssetStatusCommandInvoker UpdateAssetStatusCommandInvoker { get; }
Property Value
UpdateDeviceStatusCommandInvoker
public AdrBaseService.UpdateDeviceStatusCommandInvoker UpdateDeviceStatusCommandInvoker { get; }
Property Value
Methods
CreateOrUpdateDiscoveredAssetAsync(CreateOrUpdateDiscoveredAssetRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<CreateOrUpdateDiscoveredAssetResponsePayload> CreateOrUpdateDiscoveredAssetAsync(CreateOrUpdateDiscoveredAssetRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestCreateOrUpdateDiscoveredAssetRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<CreateOrUpdateDiscoveredAssetResponsePayload>
The command response.
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.
DisposeAsync(bool)
public ValueTask DisposeAsync(bool disposing)
Parameters
disposingbool
Returns
GetAssetAsync(GetAssetRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<GetAssetResponsePayload> GetAssetAsync(GetAssetRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestGetAssetRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<GetAssetResponsePayload>
The command response.
GetAssetStatusAsync(GetAssetStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<GetAssetStatusResponsePayload> GetAssetStatusAsync(GetAssetStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestGetAssetStatusRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<GetAssetStatusResponsePayload>
The command response.
GetDeviceAsync(CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<GetDeviceResponsePayload> GetDeviceAsync(CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<GetDeviceResponsePayload>
The command response.
GetDeviceStatusAsync(CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<GetDeviceStatusResponsePayload> GetDeviceStatusAsync(CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<GetDeviceStatusResponsePayload>
The command response.
ReceiveTelemetry(string, AssetUpdateEventTelemetry, IncomingTelemetryMetadata)
public abstract Task ReceiveTelemetry(string senderId, AssetUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)
Parameters
senderIdstringtelemetryAssetUpdateEventTelemetrymetadataIncomingTelemetryMetadata
Returns
ReceiveTelemetry(string, DeviceUpdateEventTelemetry, IncomingTelemetryMetadata)
public abstract Task ReceiveTelemetry(string senderId, DeviceUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)
Parameters
senderIdstringtelemetryDeviceUpdateEventTelemetrymetadataIncomingTelemetryMetadata
Returns
SetNotificationPreferenceForAssetUpdatesAsync(SetNotificationPreferenceForAssetUpdatesRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<SetNotificationPreferenceForAssetUpdatesResponsePayload> SetNotificationPreferenceForAssetUpdatesAsync(SetNotificationPreferenceForAssetUpdatesRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestSetNotificationPreferenceForAssetUpdatesRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<SetNotificationPreferenceForAssetUpdatesResponsePayload>
The command response.
SetNotificationPreferenceForDeviceUpdatesAsync(SetNotificationPreferenceForDeviceUpdatesRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<SetNotificationPreferenceForDeviceUpdatesResponsePayload> SetNotificationPreferenceForDeviceUpdatesAsync(SetNotificationPreferenceForDeviceUpdatesRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestSetNotificationPreferenceForDeviceUpdatesRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<SetNotificationPreferenceForDeviceUpdatesResponsePayload>
The command response.
StartAsync(CancellationToken)
Begin accepting telemetry for all telemetry receivers.
public Task StartAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
StopAsync(CancellationToken)
Stop accepting telemetry for all telemetry receivers.
public Task StopAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
UpdateAssetStatusAsync(UpdateAssetStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<UpdateAssetStatusResponsePayload> UpdateAssetStatusAsync(UpdateAssetStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestUpdateAssetStatusRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<UpdateAssetStatusResponsePayload>
The command response.
UpdateDeviceStatusAsync(UpdateDeviceStatusRequestPayload, CommandRequestMetadata?, Dictionary<string, string>?, TimeSpan?, CancellationToken)
Invoke a command.
public RpcCallAsync<UpdateDeviceStatusResponsePayload> UpdateDeviceStatusAsync(UpdateDeviceStatusRequestPayload request, CommandRequestMetadata? requestMetadata = null, Dictionary<string, string>? additionalTopicTokenMap = null, TimeSpan? commandTimeout = null, CancellationToken cancellationToken = default)
Parameters
requestUpdateDeviceStatusRequestPayloadThe data for this command request.
requestMetadataCommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMapDictionary<string, string>The topic token replacement map to use in addition to the topic tokens specified in the constructor. If this map contains any keys that the topic tokens specified in the constructor also has, then values specified in this map will take precedence.
commandTimeoutTimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationTokenCancellationTokenCancellation token.
Returns
- RpcCallAsync<UpdateDeviceStatusResponsePayload>
The command response.