Java 类com.amazonaws.services.iot.client.AWSIotDevice 实例源码

项目:aws-iot-fuse    文件:AwsIot.java   
public int attachDevice(AWSIotDevice device) {
    try {
        mqttClient.attach(device);
    } catch (Exception e) {
        return translateException(e);
    }
    return 0;
}
项目:aws-iot-fuse    文件:AwsIot.java   
public int detachDevice(AWSIotDevice device) {
    try {
        mqttClient.detach(device);
    } catch (Exception e) {
        return translateException(e);
    }
    return 0;
}
项目:aws-iot-device-sdk-java    文件:AbstractAwsIotClient.java   
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();
    }
}
项目:aws-iot-device-sdk-java    文件:AbstractAwsIotClient.java   
public void detach(AWSIotDevice device) throws AWSIotException {
    if (devices.remove(device.getThingName()) == null) {
        return;
    }

    device.deactivate();
}
项目:aws-iot-fuse    文件:StateNode.java   
public StateNode(Node parent) {
    super(parent, NODE_NAME);
    setMaxDocumentSize(MAX_BUFFER_SIZE);

    this.iotDevice = new AWSIotDevice(parent.getName());
}