@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSubscriptionArn() == null) ? 0 : getSubscriptionArn().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }
/** * <p> * The subscription's endpoint (format depends on the protocol). * </p> * * @param endpoint * The subscription's endpoint (format depends on the protocol). * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withEndpoint(String endpoint) { setEndpoint(endpoint); return this; }
/** * <p> * The subscription's owner. * </p> * * @param owner * The subscription's owner. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withOwner(String owner) { setOwner(owner); return this; }
public Subscription unmarshall(StaxUnmarshallerContext context) throws Exception { Subscription subscription = new Subscription(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; subscription.setSubscriptionArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setOwner(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setProtocol(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setEndpoint(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
out.println("<form action=\"/webui/cnsuser/subscription/?userId="+user.getUserId()+"&arn="+s.getSubscriptionArn()+"&topicArn="+topicArn+"\" method=POST>"); out.println("<td>"+i+"</td>"); out.println("<td>"+s.getSubscriptionArn() +"<input type='hidden' name='arn' value="+s.getSubscriptionArn()+"></td>"); out.println("<td>"+s.getProtocol()+"</td>"); if(s.getProtocol().toLowerCase().equals("cqs")&&isAdmin(request)){ out.println("<td><a href='/webui/cqsuser?userId="+Util.getUserIdForQueueArn(s.getEndpoint())+"'>"+s.getEndpoint()+"</a></td>"); } else { out.println("<td>"+s.getEndpoint()+"</td>"); if (s.getProtocol().toString().equals("http") && !s.getSubscriptionArn().equals("PendingConfirmation")) { out.println("<td><a href='#' onclick=\"window.open('/webui/cnsuser/subscription/editdeliverypolicy?subscriptionArn="+ s.getSubscriptionArn() + "&userId=" + userId + "', 'EditDeliveryPolicy', 'height=630,width=580,toolbar=no')\">View/Edit Delivery Policy</a></td>"); } else { out.println("<td> </td>"); if ((s.getProtocol().toString().equals("https") || s.getProtocol().toString().equals("http") || s.getProtocol().toString().equals("cqs") || s.getProtocol().toString().equals("sqs")) && !s.getSubscriptionArn().equals("PendingConfirmation")) { String url = "/webui/cnsuser/subscription/rawmessagedeliverypolicy/?subscriptionArn="+ s.getSubscriptionArn() + "&userId=" + userId; out.println("<td><a href='#' onclick=\"window.open('" + url + "', 'RawMessageDelivery', 'height=200,width=580,toolbar=no')\">Raw Message Delivery</a></td>"); } else { if (s.getSubscriptionArn().equals("PendingConfirmation")) { out.println("<td> </td>"); } else {
log_.info("Topic " + topicName + " has subscription to " + s.getEndpoint() + " as " + s.getSubscriptionArn()); log_.info("Topic " + topicName + " has subscription to " + s.getEndpoint() + " as " + s.getSubscriptionArn());
ListSubscriptionsResult listResult = snsClient.listSubscriptions(); List<Subscription> subscriptions = listResult.getSubscriptions(); String arn=""; for (Subscription subs : subscriptions) { if(subs.getProtocol().equals("sms") && subs.getEndpoint().equals("12712438216")) { arn = subs.getTopicArn(); break; } } if(!arn.equals("")) { snsClient.unsubscribe(arn); }
if(queueArn.equals(s.getEndpoint()))
/** * <p> * The subscription's protocol. * </p> * * @param protocol * The subscription's protocol. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withProtocol(String protocol) { setProtocol(protocol); return this; }
/** * <p> * The subscription's ARN. * </p> * * @param subscriptionArn * The subscription's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public Subscription withSubscriptionArn(String subscriptionArn) { setSubscriptionArn(subscriptionArn); return this; }
public Subscription unmarshall(StaxUnmarshallerContext context) throws Exception { Subscription subscription = new Subscription(); subscription.setSubscriptionArn(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; subscription.setOwner(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setProtocol(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; subscription.setEndpoint(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; subscription.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue;
if(queueArn.equals(subscription.getEndpoint())) snsClient_.unsubscribe(subscription.getSubscriptionArn()); log_.info("Deleted subscription " + subscription.getSubscriptionArn());
return false; Subscription other = (Subscription) obj; if (other.getSubscriptionArn() == null ^ this.getSubscriptionArn() == null) return false; if (other.getSubscriptionArn() != null && other.getSubscriptionArn().equals(this.getSubscriptionArn()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getProtocol() == null ^ this.getProtocol() == null) return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) return false; if (other.getEndpoint() == null ^ this.getEndpoint() == null) return false; if (other.getEndpoint() != null && other.getEndpoint().equals(this.getEndpoint()) == false) return false; if (other.getTopicArn() == null ^ this.getTopicArn() == null) return false; if (other.getTopicArn() != null && other.getTopicArn().equals(this.getTopicArn()) == false) return false; return true;
public Subscription unmarshall(StaxUnmarshallerContext context) throws Exception { Subscription subscription = new Subscription(); subscription.setSubscriptionArn(StringStaxUnmarshaller.getInstance() .unmarshall(context)); continue; subscription.setOwner(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; subscription.setProtocol(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; subscription.setEndpoint(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue; subscription.setTopicArn(StringStaxUnmarshaller.getInstance().unmarshall( context)); continue;
/** * 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 (getSubscriptionArn() != null) sb.append("SubscriptionArn: ").append(getSubscriptionArn()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getProtocol() != null) sb.append("Protocol: ").append(getProtocol()).append(","); if (getEndpoint() != null) sb.append("Endpoint: ").append(getEndpoint()).append(","); if (getTopicArn() != null) sb.append("TopicArn: ").append(getTopicArn()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSubscriptionArn() == null) ? 0 : getSubscriptionArn().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }
Subscription other = (Subscription) obj; if (other.getSubscriptionArn() == null ^ this.getSubscriptionArn() == null) return false; if (other.getSubscriptionArn() != null && other.getSubscriptionArn().equals(this.getSubscriptionArn()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getProtocol() == null ^ this.getProtocol() == null) return false; if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false) return false; if (other.getEndpoint() == null ^ this.getEndpoint() == null) return false; if (other.getEndpoint() != null && other.getEndpoint().equals(this.getEndpoint()) == false) return false; 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 (getSubscriptionArn() != null) sb.append("SubscriptionArn: " + getSubscriptionArn() + ","); if (getOwner() != null) sb.append("Owner: " + getOwner() + ","); if (getProtocol() != null) sb.append("Protocol: " + getProtocol() + ","); if (getEndpoint() != null) sb.append("Endpoint: " + getEndpoint() + ","); if (getTopicArn() != null) sb.append("TopicArn: " + getTopicArn()); sb.append("}"); return sb.toString(); }
public void marshall(Subscription _subscription, Request<?> request, String _prefix) { String prefix; if (_subscription.getSubscriptionArn() != null) { prefix = _prefix + "SubscriptionArn"; String subscriptionArn = _subscription.getSubscriptionArn(); request.addParameter(prefix, StringUtils.fromString(subscriptionArn)); } if (_subscription.getOwner() != null) { prefix = _prefix + "Owner"; String owner = _subscription.getOwner(); request.addParameter(prefix, StringUtils.fromString(owner)); } if (_subscription.getProtocol() != null) { prefix = _prefix + "Protocol"; String protocol = _subscription.getProtocol(); request.addParameter(prefix, StringUtils.fromString(protocol)); } if (_subscription.getEndpoint() != null) { prefix = _prefix + "Endpoint"; String endpoint = _subscription.getEndpoint(); request.addParameter(prefix, StringUtils.fromString(endpoint)); } if (_subscription.getTopicArn() != null) { prefix = _prefix + "TopicArn"; String topicArn = _subscription.getTopicArn(); request.addParameter(prefix, StringUtils.fromString(topicArn)); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSubscriptionArn() == null) ? 0 : getSubscriptionArn().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); hashCode = prime * hashCode + ((getEndpoint() == null) ? 0 : getEndpoint().hashCode()); hashCode = prime * hashCode + ((getTopicArn() == null) ? 0 : getTopicArn().hashCode()); return hashCode; }