All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.sdk.iotcentral.device.callbacks.ConnectionStatus Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
// Copyright (c) Luca Druda. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package com.microsoft.azure.sdk.iotcentral.device.callbacks;

import java.util.List;

import com.microsoft.azure.sdk.iot.device.IotHubConnectionStatusChangeCallback;
import com.microsoft.azure.sdk.iot.device.IotHubConnectionStatusChangeReason;
import com.microsoft.azure.sdk.iot.device.transport.IotHubConnectionStatus;
import com.microsoft.azure.sdk.iotcentral.device.enums.IOTC_CONNECTION_STATE;

public class ConnectionStatus implements IotHubConnectionStatusChangeCallback {
    private List callbacks;

    public ConnectionStatus(List callbacks) {
        this.callbacks = callbacks;
    }

    @Override
    public void execute(IotHubConnectionStatus status, IotHubConnectionStatusChangeReason statusChangeReason,
            Throwable throwable, Object callbackContext) {
        for (int i = 0; i < this.callbacks.size(); i++) {
            this.callbacks.get(i).Exec(IOTC_CONNECTION_STATE.valueOf(statusChangeReason.name()));
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy