C# Class Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.BusinessLogic.DeviceLogic

Inheritance: IDeviceLogic
Afficher le fichier Open project: Azure/azure-iot-remote-monitoring

Méthodes publiques

Méthode Description
AddDeviceAsync ( DeviceModel device ) : Task

Adds a device to the Device Identity Store and Device Registry

ApplyDevicePropertyValueModels ( DeviceModel device, IEnumerable devicePropertyValueModels ) : void

Modified a Device using a list of DevicePropertyValueModel.

BootstrapDefaultDevices ( ) : Task>
DeviceLogic ( IIotHubRepository iotHubRepository, IDeviceRegistryCrudRepository deviceRegistryCrudRepository, IDeviceRegistryListRepository deviceRegistryListRepository, IVirtualDeviceStorage virtualDeviceStorage, ISecurityKeyGenerator securityKeyGenerator, IConfigurationProvider configProvider, IDeviceRulesLogic deviceRulesLogic ) : System
ExtractDevicePropertyValuesModels ( DeviceModel device ) : IEnumerable
ExtractLocationsData ( List devices ) : Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListLocationsModel
ExtractTelemetry ( DeviceModel device ) : IList
GenerateNDevices ( int deviceCount ) : System.Threading.Tasks.Task

Generates N devices with random data and properties for testing NOTE: Adds the devices to both the device registry and device identity repository

TEMPORARY DEVICE GENERATION CODE FOR TESTING PURPOSES!

GetDeviceAsync ( string deviceId ) : Task
GetDevices ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery q ) : Task
GetIoTHubKeysAsync ( string deviceId ) : Task

Retrieves the IoT Hub keys for the given device

RemoveDeviceAsync ( string deviceId ) : System.Threading.Tasks.Task

Removes a device from the underlying repositories

SendCommandAsync ( string deviceId, string commandName, dynamic parameters ) : System.Threading.Tasks.Task

Send a command to a device based on the provided device id

UpdateDeviceAsync ( DeviceModel device ) : Task

Updates the device in the device registry with the exact device provided in this call. NOTE: The device provided here should represent the entire device that will be serialized into the device registry.

UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task
UpdateDeviceFromDeviceInfoPacketAsync ( DeviceModel device ) : Task

Private Methods

Méthode Description
AddDeviceToRepositoriesAsync ( DeviceModel device, Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.SecurityKeys securityKeys ) : Task

Adds the given device and assigned keys to the underlying repositories

AddOrRemoveSimulatedDevice ( DeviceModel repositoryDevice, bool isEnabled ) : Task
ApplyPropertyValueModels ( DeviceProperties deviceProperties, IEnumerable devicePropertyValueModels ) : void
CheckIfDeviceExists ( DeviceModel device, List validationErrors ) : System.Threading.Tasks.Task
ExtractPropertyValueModels ( DeviceProperties deviceProperties ) : IEnumerable
GetDevicePropertyConfiguration ( ) : IEnumerable
SendCommandAsyncWithDevice ( DeviceModel device, string commandName, dynamic parameters ) : Task

Sends a command to the provided device and updates the command history of the device

ValidateDevice ( DeviceModel device ) : System.Threading.Tasks.Task
ValidateDeviceId ( DeviceModel device, List validationErrors ) : bool

Method Details

AddDeviceAsync() public méthode

Adds a device to the Device Identity Store and Device Registry
public AddDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel Device to add to the underlying repositories
Résultat Task

ApplyDevicePropertyValueModels() public méthode

Modified a Device using a list of DevicePropertyValueModel.
public ApplyDevicePropertyValueModels ( DeviceModel device, IEnumerable devicePropertyValueModels ) : void
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel /// The Device to modify. ///
devicePropertyValueModels IEnumerable /// The list of s for modifying /// . ///
Résultat void

BootstrapDefaultDevices() public méthode

public BootstrapDefaultDevices ( ) : Task>
Résultat Task>

DeviceLogic() public méthode

public DeviceLogic ( IIotHubRepository iotHubRepository, IDeviceRegistryCrudRepository deviceRegistryCrudRepository, IDeviceRegistryListRepository deviceRegistryListRepository, IVirtualDeviceStorage virtualDeviceStorage, ISecurityKeyGenerator securityKeyGenerator, IConfigurationProvider configProvider, IDeviceRulesLogic deviceRulesLogic ) : System
iotHubRepository IIotHubRepository
deviceRegistryCrudRepository IDeviceRegistryCrudRepository
deviceRegistryListRepository IDeviceRegistryListRepository
virtualDeviceStorage IVirtualDeviceStorage
securityKeyGenerator ISecurityKeyGenerator
configProvider IConfigurationProvider
deviceRulesLogic IDeviceRulesLogic
Résultat System

ExtractDevicePropertyValuesModels() public méthode

public ExtractDevicePropertyValuesModels ( DeviceModel device ) : IEnumerable
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
Résultat IEnumerable

ExtractLocationsData() public méthode

public ExtractLocationsData ( List devices ) : Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListLocationsModel
devices List
Résultat Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListLocationsModel

ExtractTelemetry() public méthode

public ExtractTelemetry ( DeviceModel device ) : IList
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
Résultat IList

GenerateNDevices() public méthode

Generates N devices with random data and properties for testing NOTE: Adds the devices to both the device registry and device identity repository
TEMPORARY DEVICE GENERATION CODE FOR TESTING PURPOSES!
public GenerateNDevices ( int deviceCount ) : System.Threading.Tasks.Task
deviceCount int Number of devices to generate
Résultat System.Threading.Tasks.Task

GetDeviceAsync() public méthode

public GetDeviceAsync ( string deviceId ) : Task
deviceId string
Résultat Task

GetDevices() public méthode

public GetDevices ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery q ) : Task
q Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery
Résultat Task

GetIoTHubKeysAsync() public méthode

Retrieves the IoT Hub keys for the given device
public GetIoTHubKeysAsync ( string deviceId ) : Task
deviceId string ID of the device to retrieve
Résultat Task

RemoveDeviceAsync() public méthode

Removes a device from the underlying repositories
public RemoveDeviceAsync ( string deviceId ) : System.Threading.Tasks.Task
deviceId string ID of the device to remove
Résultat System.Threading.Tasks.Task

SendCommandAsync() public méthode

Send a command to a device based on the provided device id
public SendCommandAsync ( string deviceId, string commandName, dynamic parameters ) : System.Threading.Tasks.Task
deviceId string The Device's ID
commandName string The name of the command
parameters dynamic The parameters to send
Résultat System.Threading.Tasks.Task

UpdateDeviceAsync() public méthode

Updates the device in the device registry with the exact device provided in this call. NOTE: The device provided here should represent the entire device that will be serialized into the device registry.
public UpdateDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel Device to update in the device registry
Résultat Task

UpdateDeviceEnabledStatusAsync() public méthode

public UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task
deviceId string
isEnabled bool
Résultat Task

UpdateDeviceFromDeviceInfoPacketAsync() public méthode

public UpdateDeviceFromDeviceInfoPacketAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
Résultat Task