in docker_images/java/wrapper/src/main/java/glue/RegistryGlue.java [83:112]
public void sendModuleTwinPatch(String connectionId, String deviceId, String moduleId, Twin twin, Handler<AsyncResult<Void>> handler)
{
System.out.printf("sendModuleTwinPatch called for %s with deviceId = %s and moduleId = %s%n", connectionId, deviceId, moduleId);
System.out.println(twin.toString());
TwinClient client = getClient(connectionId);
if (client == null)
{
handler.handle(Future.failedFuture(new MainApiException(500, "invalid connection id")));
}
else
{
com.microsoft.azure.sdk.iot.service.twin.Twin serviceTwin = new com.microsoft.azure.sdk.iot.service.twin.Twin(deviceId, moduleId);
Map<String, Object> desiredProps = (Map<String, Object>)twin.getDesired();
serviceTwin.getDesiredProperties().putAll(desiredProps);
try
{
client.patch(serviceTwin);
}
catch (Exception e)
{
handler.handle(Future.failedFuture(e));
}
handler.handle(Future.succeededFuture());
}
}