@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointRequest == false) return false; DescribeEndpointRequest other = (DescribeEndpointRequest) obj; if (other.getEndpointType() == null ^ this.getEndpointType() == null) return false; if (other.getEndpointType() != null && other.getEndpointType().equals(this.getEndpointType()) == false) return false; return true; }
setEndpointType(endpointType); return this;
@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); }
@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_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); }
thing.getDeviceMetadata().put("port", 8883); thing.getDeviceMetadata().put("host", getClient(). describeEndpoint(new DescribeEndpointRequest()).getEndpointAddress());
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointType() == null) ? 0 : getEndpointType().hashCode()); return hashCode; }
@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); }
thing.getDeviceMetadata().put("port", 8883); thing.getDeviceMetadata().put("host", getClient(). describeEndpoint(new DescribeEndpointRequest()).getEndpointAddress());
setEndpointType(endpointType); return this;
/** * 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 (getEndpointType() != null) sb.append("EndpointType: ").append(getEndpointType()); sb.append("}"); return sb.toString(); }
@Ignore @Test public void mqttConnectMalformedEndpoints() 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); DescribeEndpointRequest atsRequest = new DescribeEndpointRequest(); atsRequest.setEndpointType("iot:Data-ATS"); DescribeEndpointResult atsResult = iotClient.describeEndpoint(atsRequest); String atsEndpointPrefix = atsResult.getEndpointAddress().split("\\.")[0];
/** * Marshall the given parameter object. */ public void marshall(DescribeEndpointRequest describeEndpointRequest, ProtocolMarshaller protocolMarshaller) { if (describeEndpointRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEndpointRequest.getEndpointType(), ENDPOINTTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointType() == null) ? 0 : getEndpointType().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointRequest == false) return false; DescribeEndpointRequest other = (DescribeEndpointRequest) obj; if (other.getEndpointType() == null ^ this.getEndpointType() == null) return false; if (other.getEndpointType() != null && other.getEndpointType().equals(this.getEndpointType()) == 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 (getEndpointType() != null) sb.append("endpointType: " + getEndpointType()); sb.append("}"); return sb.toString(); }
public Request<DescribeEndpointRequest> marshall(DescribeEndpointRequest describeEndpointRequest) { if (describeEndpointRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(DescribeEndpointRequest)"); } Request<DescribeEndpointRequest> request = new DefaultRequest<DescribeEndpointRequest>( describeEndpointRequest, "AWSIot"); request.setHttpMethod(HttpMethodName.GET); String uriResourcePath = "/endpoint"; if (describeEndpointRequest.getEndpointType() != null) { request.addParameter("endpointType", StringUtils.fromString(describeEndpointRequest.getEndpointType())); } request.setResourcePath(uriResourcePath); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); } return request; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointType() == null) ? 0 : getEndpointType().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointType() == null) ? 0 : getEndpointType().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DescribeEndpointRequest == false) return false; DescribeEndpointRequest other = (DescribeEndpointRequest) obj; if (other.getEndpointType() == null ^ this.getEndpointType() == null) return false; if (other.getEndpointType() != null && other.getEndpointType().equals(this.getEndpointType()) == false) return false; return true; }