com.microsoft.azure.sdk.iotcentral.device.callbacks.EventCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotc-java-device-client Show documentation
Show all versions of iotc-java-device-client Show documentation
The Azure IoTCentral Device client for Java and Android
// 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 com.microsoft.azure.sdk.iot.device.IotHubEventCallback;
import com.microsoft.azure.sdk.iot.device.IotHubStatusCode;
import com.microsoft.azure.sdk.iotcentral.device.ILogger;
public class EventCallback implements IotHubEventCallback {
private IoTCCallback callback;
private ILogger logger;
public EventCallback(IoTCCallback callback, ILogger logger) {
this.callback = callback;
this.logger = logger;
}
public void execute(IotHubStatusCode responseStatus, Object callbackContext) {
if (this.callback != null) {
if (!responseStatus.equals(IotHubStatusCode.OK)) {
this.callback.Exec(responseStatus.toString());
} else {
this.callback.Exec(responseStatus.toString());
}
} else {
this.logger.Log(responseStatus.toString());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy