@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; }
/** * <p> * The endpoint. The format of the endpoint is as follows: <i>identifier</i>.iot.<i>region</i>.amazonaws.com. * </p> * * @param endpointAddress * The endpoint. The format of the endpoint is as follows: <i>identifier</i>.iot.<i>region</i>.amazonaws.com. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointResult withEndpointAddress(String endpointAddress) { setEndpointAddress(endpointAddress); return this; }
public DescribeEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeEndpointResult describeEndpointResult = new DescribeEndpointResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeEndpointResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("endpointAddress", targetDepth)) { context.nextToken(); describeEndpointResult.setEndpointAddress(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeEndpointResult; }
public DescribeEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeEndpointResult describeEndpointResult = new DescribeEndpointResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("endpointAddress")) { describeEndpointResult.setEndpointAddress(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return describeEndpointResult; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getEndpointAddress() == null) ? 0 : getEndpointAddress().hashCode()); return hashCode; }
public DescribeEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeEndpointResult describeEndpointResult = new DescribeEndpointResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("endpointAddress")) { describeEndpointResult.setEndpointAddress(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return describeEndpointResult; }
/** * <p> * The endpoint. The format of the endpoint is as follows: <i>identifier</i>.iot.<i>region</i>.amazonaws.com. * </p> * * @param endpointAddress * The endpoint. The format of the endpoint is as follows: <i>identifier</i>.iot.<i>region</i>.amazonaws.com. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeEndpointResult withEndpointAddress(String endpointAddress) { setEndpointAddress(endpointAddress); 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 (getEndpointAddress() != null) sb.append("EndpointAddress: ").append(getEndpointAddress()); sb.append("}"); return sb.toString(); }
public DescribeEndpointResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeEndpointResult describeEndpointResult = new DescribeEndpointResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeEndpointResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("endpointAddress", targetDepth)) { context.nextToken(); describeEndpointResult.setEndpointAddress(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeEndpointResult; }
@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; } }