@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }
public Topic unmarshall(StaxUnmarshallerContext context) throws Exception { Topic topic = new Topic(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return topic; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("TopicArn", targetDepth)) { topic.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return topic; } } } }
/** * <p> * The topic's ARN. * </p> * * @param topicArn * The topic's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public Topic withTopicArn(String topicArn) { setTopicArn(topicArn); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Topic == false) return false; Topic other = (Topic) obj; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false) return false; return true; }
public Topic unmarshall(StaxUnmarshallerContext context) throws Exception { Topic topic = new Topic(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("TopicArn", targetDepth)) { topic.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return topic; }
/** * 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 (getTopicArn() != null) sb.append("TopicArn: ").append(getTopicArn()); sb.append("}"); return sb.toString(); }
public Topic unmarshall(StaxUnmarshallerContext context) throws Exception { Topic topic = new Topic(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) break; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("TopicArn", targetDepth)) { topic.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { break; } } } return topic; }
String arn = topic.getTopicArn();
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Topic == false) return false; Topic other = (Topic) obj; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == 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 (getTopicArn() != null) sb.append("TopicArn: " + getTopicArn()); sb.append("}"); return sb.toString(); }
public void marshall(Topic _topic, Request<?> request, String _prefix) { String prefix; if (_topic.getTopicArn() != null) { prefix = _prefix + "TopicArn"; String topicArn = _topic.getTopicArn(); request.addParameter(prefix, StringUtils.fromString(topicArn)); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Topic == false) return false; Topic other = (Topic) obj; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == 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 (getTopicArn() != null) sb.append("TopicArn: " + getTopicArn()); sb.append("}"); return sb.toString(); }
public void marshall(Topic _topic, Request<?> request, String _prefix) { String prefix; if (_topic.getTopicArn() != null) { prefix = _prefix + "TopicArn"; String topicArn = _topic.getTopicArn(); request.addParameter(prefix, StringUtils.fromString(topicArn)); } }
@Override public Collection<NevadoTopic> listTopics() throws JMSException { Collection<NevadoTopic> topics; ListTopicsResult result; try { result = _amazonSNS.listTopics(); } catch (AmazonClientException e) { throw handleAWSException("Unable to list topics", e); } topics = new HashSet<NevadoTopic>(result.getTopics().size()); for(Topic topic : result.getTopics()) { topics.add(new NevadoTopic(topic.getTopicArn())); } return topics; }
private String getTopicResourceName(String marker, String topicName) { ListTopicsResult listTopicsResult = this.amazonSns.listTopics(new ListTopicsRequest(marker)); for (Topic topic : listTopicsResult.getTopics()) { AmazonResourceName resourceName = AmazonResourceName.fromString(topic.getTopicArn()); if (resourceName.getResourceType().equals(topicName)) { return topic.getTopicArn(); } } if (StringUtils.hasText(listTopicsResult.getNextToken())) { return getTopicResourceName(listTopicsResult.getNextToken(), topicName); } else { throw new IllegalArgumentException("No topic found for name :'" + topicName + "'"); } } }
private void scanSubscriptions(Topic topic) { ListSubscriptionsByTopicResult result = getClient().listSubscriptionsByTopic(topic.getTopicArn()); String token = null; do { rateLimit(); token = result.getNextToken(); for (Subscription subscription : result.getSubscriptions()) { projectSubscription(topic, subscription); } result = getClient().listSubscriptionsByTopic(topic.getTopicArn(), token); } while ((!Strings.isNullOrEmpty(token)) && (!token.equals("null"))); }
private String getTopicResourceName(String marker, String topicName) { ListTopicsResult listTopicsResult = this.amazonSns.listTopics(new ListTopicsRequest(marker)); for (Topic topic : listTopicsResult.getTopics()) { AmazonResourceName resourceName = AmazonResourceName.fromString(topic.getTopicArn()); if (resourceName.getResourceType().equals(topicName)) { return topic.getTopicArn(); } } if (StringUtils.hasText(listTopicsResult.getNextToken())) { return getTopicResourceName(listTopicsResult.getNextToken(), topicName); } else { throw new IllegalArgumentException("No topic found for name :'" + topicName + "'"); } } }