/** * Constructs a new AWSIotMqttManager. This method does not support * ATS enabled endpoints. * * @param mqttClientId MQTT client ID to use with this client. * @param region The AWS region to use when creating endpoint. * @param accountEndpointPrefix Customer specific endpont prefix XXXXXXX in * XXXXXXX.iot.[region].amazonaws.com or * XXXXXXX-ats.iot.[region].amazonaws.com or * XXXXXXX.ats.iot.cn-north-1.amazonaws.com.cn */ public AWSIotMqttManager(String mqttClientId, Region region, String accountEndpointPrefix) { if (mqttClientId == null || mqttClientId.isEmpty()) { throw new IllegalArgumentException("mqttClientId is null or empty"); } if (region == null) { throw new IllegalArgumentException("region is null"); } if (accountEndpointPrefix == null) { throw new IllegalArgumentException("accountEndpointPrefix is null"); } this.topicListeners = new ConcurrentHashMap<String, AWSIotMqttTopic>(); this.mqttMessageQueue = new ConcurrentLinkedQueue<AWSIotMqttQueueMessage>(); this.accountEndpointPrefix = accountEndpointPrefix; this.mqttClientId = mqttClientId; this.region = region; this.endpoint = null; initDefaults(); }
/** * Constructs a new AWSIotMqttManager. * * @param mqttClientId MQTT client ID to use with this client. * @param endpoint AWS IoT endpoint. * Expected endpoint formats: * XXXXXXX.iot.[region].amazonaws.com or * XXXXXXX-ats.iot.[region].amazonaws.com or * XXXXXXX.ats.iot.cn-north-1.amazonaws.com.cn */ public AWSIotMqttManager(String mqttClientId, String endpoint) { if (mqttClientId == null || mqttClientId.isEmpty()) { throw new IllegalArgumentException("mqttClientId is null or empty"); } if (endpoint == null) { throw new IllegalArgumentException("endpoint is null"); } this.topicListeners = new ConcurrentHashMap<String, AWSIotMqttTopic>(); this.mqttMessageQueue = new ConcurrentLinkedQueue<AWSIotMqttQueueMessage>(); this.mqttClientId = mqttClientId; this.endpoint = endpoint; this.accountEndpointPrefix = null; this.region = AwsIotEndpointUtility.getRegionFromIotEndpoint(endpoint); initDefaults(); }
/** * Constructs a new AWSIotMqttManager. This method does not support * ATS enabled endpoints. * * @param mqttClientId MQTT client ID to use with this client. * @param region The AWS region to use when creating endpoint. * @param accountEndpointPrefix Customer specific endpont prefix XXXXXXX in * XXXXXXX.iot.[region].amazonaws.com or * XXXXXXX-ats.iot.[region].amazonaws.com or * XXXXXXX.ats.iot.cn-north-1.amazonaws.com.cn */ public AWSIotMqttManager(String mqttClientId, Region region, String accountEndpointPrefix) { if (mqttClientId == null || mqttClientId.isEmpty()) { throw new IllegalArgumentException("mqttClientId is null or empty"); } if (region == null) { throw new IllegalArgumentException("region is null"); } if (accountEndpointPrefix == null) { throw new IllegalArgumentException("accountEndpointPrefix is null"); } this.topicListeners = new ConcurrentHashMap<String, AWSIotMqttTopic>(); this.mqttMessageQueue = new ConcurrentLinkedQueue<AWSIotMqttQueueMessage>(); this.accountEndpointPrefix = accountEndpointPrefix; this.mqttClientId = mqttClientId; this.region = region; this.endpoint = null; initDefaults(); }
/** * Constructs a new AWSIotMqttManager. * * @param mqttClientId MQTT client ID to use with this client. * @param endpoint AWS IoT endpoint. * Expected endpoint formats: * XXXXXXX.iot.[region].amazonaws.com or * XXXXXXX-ats.iot.[region].amazonaws.com or * XXXXXXX.ats.iot.cn-north-1.amazonaws.com.cn */ public AWSIotMqttManager(String mqttClientId, String endpoint) { if (mqttClientId == null || mqttClientId.isEmpty()) { throw new IllegalArgumentException("mqttClientId is null or empty"); } if (endpoint == null) { throw new IllegalArgumentException("endpoint is null"); } this.topicListeners = new ConcurrentHashMap<String, AWSIotMqttTopic>(); this.mqttMessageQueue = new ConcurrentLinkedQueue<AWSIotMqttQueueMessage>(); this.mqttClientId = mqttClientId; this.endpoint = endpoint; this.accountEndpointPrefix = null; this.region = AwsIotEndpointUtility.getRegionFromIotEndpoint(endpoint); initDefaults(); }