+ private class StartStopChainCallback implements FutureCallback<Void> {
+
+ private final String deviceInfo;
+ private final String stop;
+ private final String stopped;
+ private final boolean start;
+ private final DeviceContext deviceContext;
+
+ StartStopChainCallback(final DeviceContext deviceContext, final boolean stop) {
+
+ this.deviceInfo = Objects.nonNull(deviceContext) ? deviceContext.getDeviceInfo().getLOGValue() : "null";
+ this.stop = stop ? "stop" : "start";
+ this.stopped = stop ? "stopped" : "started";
+ this.start = !stop;
+ this.deviceContext = deviceContext;
+ }
+
+ @Override
+ public void onSuccess(@Nullable Void aVoid) {
+ LOG.info("Context chain for device {} successfully {}", deviceInfo, stopped);
+// if (start && Objects.nonNull(deviceContext)) {
+// deviceContext.masterSuccessful();
+// }
+ }
+
+ @Override
+ public void onFailure(Throwable throwable) {
+ LOG.warn("Not able to {} the context chain for device {}", stop, deviceInfo);
+ }
+ }
+