Exemplo n.º 1
0
            public CloudReceiver(CloudProxy cloudProxy, ICloudListener cloudListener)
            {
                this.cloudProxy    = Preconditions.CheckNotNull(cloudProxy, nameof(cloudProxy));
                this.cloudListener = Preconditions.CheckNotNull(cloudListener, nameof(cloudListener));
                IMessageConverter <TwinCollection> converter = cloudProxy.messageConverterProvider.Get <TwinCollection>();

                this.desiredUpdateHandler = new DesiredPropertyUpdateHandler(cloudListener, converter, cloudProxy);
            }
Exemplo n.º 2
0
 public DesiredPropertyUpdateHandler(
     ICloudListener listener,
     IMessageConverter <TwinCollection> converter,
     CloudProxy cloudProxy)
 {
     this.listener   = listener;
     this.converter  = converter;
     this.cloudProxy = cloudProxy;
 }
Exemplo n.º 3
0
        protected async Task <ICloudProxy> CreateNewCloudProxyAsync(ITokenProvider newTokenProvider)
        {
            IClient client = await this.ConnectToIoTHub(newTokenProvider);

            ICloudProxy proxy = new CloudProxy(
                client,
                this.messageConverterProvider,
                this.Identity.Id,
                this.ConnectionStatusChangedHandler,
                this.cloudListener,
                this.idleTimeout,
                this.closeOnIdleTimeout);

            return(proxy);
        }
Exemplo n.º 4
0
 public static void Closing(CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.ClosingReceiver, Invariant($"Closing receiver in cloud proxy {cloudProxy.id} for {cloudProxy.clientId}"));
 }
Exemplo n.º 5
0
 public static void SendFeedbackMessage(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.SendFeedbackMessage, Invariant($"Sending feedback message for device {cloudProxy.clientId}"));
 }
Exemplo n.º 6
0
 public static void BindCloudListener(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.BindCloudListener, Invariant($"Binding cloud listener for device {cloudProxy.clientId}"));
 }
Exemplo n.º 7
0
 internal static void ExceptionInHandleException(CloudProxy cloudProxy, Exception handlingException, Exception caughtException)
 {
     Log.LogDebug((int)EventIds.ExceptionInHandleException, Invariant($"Cloud proxy {cloudProxy.id} got exception {caughtException} while handling exception {handlingException}"));
 }
Exemplo n.º 8
0
 public static void ErrorGettingTwin(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.ErrorGettingTwin, ex, Invariant($"Error getting twin for {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 9
0
 public static void ErrorUpdatingReportedProperties(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.ErrorUpdatingReportedProperties, ex, Invariant($"Error sending updated reported properties for {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 10
0
 public static void TimedOutClosing(CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.TimedOutClosing, Invariant($"Closing cloud proxy {cloudProxy.id} for {cloudProxy.clientId} because of inactivity"));
 }
Exemplo n.º 11
0
 public static void HandleNre(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.HandleNre, Invariant($"Got a NullReferenceException from client for {cloudProxy.clientId}. Closing the cloud proxy since it may be in a bad state."));
 }
Exemplo n.º 12
0
 public static void FailOverDetected(Exception ex, CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.FailOverDetected, ex, Invariant($"Fail-over detected, closing cloud proxy for {cloudProxy.clientId}."));
 }
Exemplo n.º 13
0
 public static void SendFeedbackMessage(CloudProxy cloudProxy, string messageId)
 {
     Log.LogDebug((int)EventIds.SendFeedbackMessage, Invariant($"Sending feedback message with id {messageId} for {cloudProxy.clientId}"));
 }
Exemplo n.º 14
0
 public static void SendMessage(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.SendMessage, Invariant($"Sending message for {cloudProxy.clientId}"));
 }
Exemplo n.º 15
0
 public static void ErrorReceivingMessage(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.ReceiveError, ex, Invariant($"Error receiving message for device {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 16
0
 public static void Closed(CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.Close, Invariant($"Closed cloud proxy {cloudProxy.id} for {cloudProxy.clientId}"));
 }
Exemplo n.º 17
0
 public static void ReceiverStopped(CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.ReceiverStopped, Invariant($"Cloud message receiver stopped for device {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 18
0
 public static void ErrorClosing(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogError((int)EventIds.CloseError, ex, Invariant($"Error closing cloud proxy {cloudProxy.id} for device {cloudProxy.clientId}"));
 }
Exemplo n.º 19
0
 public static void Initialized(CloudProxy cloudProxy)
 {
     Log.LogInformation((int)EventIds.Initialized, Invariant($"Initialized cloud proxy {cloudProxy.id} for {cloudProxy.clientId}"));
 }
Exemplo n.º 20
0
 public static void GetTwin(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.GetTwin, Invariant($"Getting twin for device {cloudProxy.clientId}"));
 }
Exemplo n.º 21
0
 public static void ErrorSendingFeedbackMessageAsync(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.ErrorSendingFeedbackMessageAsync, ex, Invariant($"Error sending feedback message for {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 22
0
 public static void ErrorSendingBatchMessage(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.SendMessageBatchError, ex, Invariant($"Error sending message batch for device {cloudProxy.clientId} in cloud proxy {cloudProxy.id}"));
 }
Exemplo n.º 23
0
 public static void HandleNre(Exception ex, CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.HandleNre, ex, Invariant($"Got a non-recoverable error from client for {cloudProxy.clientId}. Closing the cloud proxy since it may be in a bad state."));
 }
Exemplo n.º 24
0
 public static void UpdateReportedProperties(CloudProxy cloudProxy)
 {
     Log.LogDebug((int)EventIds.UpdateReportedProperties, Invariant($"Updating reported properties for device {cloudProxy.clientId}"));
 }
Exemplo n.º 25
0
 internal static void TerminatingErrorReceivingMessage(CloudProxy cloudProxy, Exception e)
 {
     Log.LogInformation((int)EventIds.ReceiveError, e, Invariant($"Error receiving C2D messages for device {cloudProxy.clientId} in cloud proxy {cloudProxy.id}. Closing receive loop."));
 }
Exemplo n.º 26
0
 public static void ErrorSendingMessage(CloudProxy cloudProxy, Exception ex)
 {
     Log.LogDebug((int)EventIds.SendMessageError, ex, Invariant($"Error sending message for device {cloudProxy.clientId}"));
 }