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
applicationContext
ApplicationContextThe shared context for your application.
mqttClient
IMqttPubSubClientThe MQTT client to use.
topicTokenMap
Dictionary<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
request
CreateOrUpdateDiscoveredAssetRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
disposing
bool
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
request
GetAssetRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
request
GetAssetStatusRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation token.
Returns
- RpcCallAsync<GetDeviceStatusResponsePayload>
The command response.
ReceiveTelemetry(string, AssetUpdateEventTelemetry, IncomingTelemetryMetadata)
public abstract Task ReceiveTelemetry(string senderId, AssetUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)
Parameters
senderId
stringtelemetry
AssetUpdateEventTelemetrymetadata
IncomingTelemetryMetadata
Returns
ReceiveTelemetry(string, DeviceUpdateEventTelemetry, IncomingTelemetryMetadata)
public abstract Task ReceiveTelemetry(string senderId, DeviceUpdateEventTelemetry telemetry, IncomingTelemetryMetadata metadata)
Parameters
senderId
stringtelemetry
DeviceUpdateEventTelemetrymetadata
IncomingTelemetryMetadata
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
request
SetNotificationPreferenceForAssetUpdatesRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
request
SetNotificationPreferenceForDeviceUpdatesRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation token.
Returns
- RpcCallAsync<SetNotificationPreferenceForDeviceUpdatesResponsePayload>
The command response.
StartAsync(CancellationToken)
Begin accepting telemetry for all telemetry receivers.
public Task StartAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation token.
Returns
StopAsync(CancellationToken)
Stop accepting telemetry for all telemetry receivers.
public Task StopAsync(CancellationToken cancellationToken = default)
Parameters
cancellationToken
CancellationTokenCancellation 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
request
UpdateAssetStatusRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation 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
request
UpdateDeviceStatusRequestPayloadThe data for this command request.
requestMetadata
CommandRequestMetadataThe metadata for this command request.
additionalTopicTokenMap
Dictionary<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.
commandTimeout
TimeSpan?How long the command will be available on the broker for an executor to receive.
cancellationToken
CancellationTokenCancellation token.
Returns
- RpcCallAsync<UpdateDeviceStatusResponsePayload>
The command response.