public int attachDevice(AWSIotDevice device) { try { mqttClient.attach(device); } catch (Exception e) { return translateException(e); } return 0; }
public int detachDevice(AWSIotDevice device) { try { mqttClient.detach(device); } catch (Exception e) { return translateException(e); } return 0; }
public void attach(AWSIotDevice device) throws AWSIotException { if (devices.putIfAbsent(device.getThingName(), device) != null) { return; } device.setClient(this); // start the shadow sync task if the connection is already established if (getConnectionStatus().equals(AWSIotConnectionStatus.CONNECTED)) { device.activate(); } }
public void detach(AWSIotDevice device) throws AWSIotException { if (devices.remove(device.getThingName()) == null) { return; } device.deactivate(); }
public StateNode(Node parent) { super(parent, NODE_NAME); setMaxDocumentSize(MAX_BUFFER_SIZE); this.iotDevice = new AWSIotDevice(parent.getName()); }