@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointResult == false) return false; DescribeEndpointResult other = (DescribeEndpointResult) obj; if (other.getEndpointAddress() == null ^ this.getEndpointAddress() == null) return false; if (other.getEndpointAddress() != null && other.getEndpointAddress().equals(this.getEndpointAddress()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointAddress() == null) ? 0 : getEndpointAddress().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEndpointAddress() != null) sb.append("EndpointAddress: ").append(getEndpointAddress()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointAddress() == null) ? 0 : getEndpointAddress().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointResult == false) return false; DescribeEndpointResult other = (DescribeEndpointResult) obj; if (other.getEndpointAddress() == null ^ this.getEndpointAddress() == null) return false; if (other.getEndpointAddress() != null && other.getEndpointAddress().equals(this.getEndpointAddress()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEndpointAddress() != null) sb.append("endpointAddress: " + getEndpointAddress()); sb.append("}"); return sb.toString(); }
@Test public void mqttConnect_USEast1_Endpoint() throws Exception { DescribeEndpointRequest request = new DescribeEndpointRequest(); request.setEndpointType("iot:Data"); DescribeEndpointResult result = iotClient.describeEndpoint(request); endpointPrefix = result.getEndpointAddress().split("\\.")[0]; System.out.println("Endpoint prefix: " + endpointPrefix); String endpoint = endpointPrefix + ".iot." + Region.getRegion(Regions.US_EAST_1).getName() + ".amazonaws.com"; System.out.println("Endpoint: " + endpoint); AWSIotMqttManager mqttManager = new AWSIotMqttManager("int-test-w-certs", endpoint); mqttConnect(mqttManager); }
@Test public void mqttConnect_USEast1_ATS_Endpoint() throws Exception { DescribeEndpointRequest request = new DescribeEndpointRequest(); request.setEndpointType("iot:Data-ATS"); DescribeEndpointResult result = iotClient.describeEndpoint(request); endpointPrefix = result.getEndpointAddress().split("\\.")[0]; System.out.println("Endpoint prefix: " + endpointPrefix); String endpoint = endpointPrefix + ".iot." + Region.getRegion(Regions.US_EAST_1).getName() + ".amazonaws.com"; System.out.println("Endpoint: " + endpoint); AWSIotMqttManager mqttManager = new AWSIotMqttManager("int-test-w-certs", endpoint); mqttConnect(mqttManager); }
@Before public void setUp() throws Exception { if (!initCompleted) { r = new Random(); credentialsProvider = new CognitoCachingCredentialsProvider(new Activity(), IDENTITY_POOL_ID, Regions.US_EAST_1); iotClient = new AWSIotClient(credentialsProvider); DescribeEndpointRequest request = new DescribeEndpointRequest(); DescribeEndpointResult result = iotClient.describeEndpoint(request); endpointPrefix = result.getEndpointAddress().split("\\.")[0]; initCompleted = true; } }
@Test public void mqttConnect_USEast1_EndpointPrefix_Region() throws Exception { DescribeEndpointRequest request = new DescribeEndpointRequest(); request.setEndpointType("iot:Data"); DescribeEndpointResult result = iotClient.describeEndpoint(request); endpointPrefix = result.getEndpointAddress().split("\\.")[0]; System.out.println("Endpoint prefix: " + endpointPrefix); AWSIotMqttManager mqttManager = new AWSIotMqttManager("int-test-w-certs", Region.getRegion(Regions.US_EAST_1), endpointPrefix); mqttConnect(mqttManager); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointAddress() == null) ? 0 : getEndpointAddress().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointAddress() == null) ? 0 : getEndpointAddress().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointResult == false) return false; DescribeEndpointResult other = (DescribeEndpointResult) obj; if (other.getEndpointAddress() == null ^ this.getEndpointAddress() == null) return false; if (other.getEndpointAddress() != null && other.getEndpointAddress().equals(this.getEndpointAddress()) == false) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointResult == false) return false; DescribeEndpointResult other = (DescribeEndpointResult) obj; if (other.getEndpointAddress() == null ^ this.getEndpointAddress() == null) return false; if (other.getEndpointAddress() != null && other.getEndpointAddress().equals(this.getEndpointAddress()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEndpointAddress() != null) sb.append("endpointAddress: " + getEndpointAddress()); sb.append("}"); return sb.toString(); }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getEndpointAddress() != null) sb.append("EndpointAddress: ").append(getEndpointAddress()); sb.append("}"); return sb.toString(); }
request.setEndpointType("iot:Data"); DescribeEndpointResult result = iotClient.describeEndpoint(request); endpointPrefix = result.getEndpointAddress().split("\\.")[0]; System.out.println("Endpoint prefix: " + endpointPrefix); atsRequest.setEndpointType("iot:Data-ATS"); DescribeEndpointResult atsResult = iotClient.describeEndpoint(atsRequest); String atsEndpointPrefix = atsResult.getEndpointAddress().split("\\.")[0]; String atsEndpointPrefixWithDot = atsEndpointPrefix.replaceAll("-", "."); System.out.println("ATS Endpoint prefix: " + atsEndpointPrefix);
thing.getDeviceMetadata().put("port", 8883); thing.getDeviceMetadata().put("host", getClient(). describeEndpoint(new DescribeEndpointRequest()).getEndpointAddress());
thing.getDeviceMetadata().put("port", 8883); thing.getDeviceMetadata().put("host", getClient(). describeEndpoint(new DescribeEndpointRequest()).getEndpointAddress());