C# Class Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Repository.DeviceRegistryRepository

Inheritance: IDeviceRegistryCrudRepository, IDeviceRegistryListRepository
Exibir arquivo Open project: Azure/azure-iot-remote-monitoring Class Usage Examples

Public Methods

Method Description
AddDeviceAsync ( DeviceModel device ) : Task

Adds a device to the DocumentDB. Throws a DeviceAlreadyRegisteredException if a device already exists in the database with the provided deviceId

DeviceRegistryRepository ( IDocumentDBClient documentClient ) : System
GetDeviceAsync ( string deviceId ) : Task

Queries the DocumentDB and retrieves the device based on its deviceId

GetDeviceList ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery query ) : Task
RemoveDeviceAsync ( string deviceId ) : System.Threading.Tasks.Task
UpdateDeviceAsync ( DeviceModel device ) : Task

Updates an existing device in the DocumentDB Throws a DeviceNotRegisteredException is the device does not already exist in the DocumentDB

UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task

Private Methods

Method Description
GetAllDevicesAsync ( ) : Task>

Queries the DocumentDB and retrieves all documents in the collection

SearchDeviceList ( IQueryable deviceList, string search ) : IQueryable
SearchTypePropertiesForValue ( DeviceModel device, string search ) : bool
SortDeviceList ( IQueryable deviceList, string sortColumn, QuerySortOrder sortOrder ) : IQueryable

Method Details

AddDeviceAsync() public method

Adds a device to the DocumentDB. Throws a DeviceAlreadyRegisteredException if a device already exists in the database with the provided deviceId
public AddDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
return Task

DeviceRegistryRepository() public method

public DeviceRegistryRepository ( IDocumentDBClient documentClient ) : System
documentClient IDocumentDBClient
return System

GetDeviceAsync() public method

Queries the DocumentDB and retrieves the device based on its deviceId
public GetDeviceAsync ( string deviceId ) : Task
deviceId string DeviceID of the device to retrieve
return Task

GetDeviceList() public method

public GetDeviceList ( Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery query ) : Task
query Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models.DeviceListQuery
return Task

RemoveDeviceAsync() public method

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

UpdateDeviceAsync() public method

Updates an existing device in the DocumentDB Throws a DeviceNotRegisteredException is the device does not already exist in the DocumentDB
public UpdateDeviceAsync ( DeviceModel device ) : Task
device Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Models.DeviceModel
return Task

UpdateDeviceEnabledStatusAsync() public method

public UpdateDeviceEnabledStatusAsync ( string deviceId, bool isEnabled ) : Task
deviceId string
isEnabled bool
return Task