@Override public UnsubscribeResult unsubscribe(UnsubscribeRequest unsubscribeRequest) throws AmazonClientException { if (!_subscriptionsByArn.containsKey(unsubscribeRequest.getSubscriptionArn())) throw new NotFoundException("no such subscription"); Subscription removed = _subscriptionsByArn.remove(unsubscribeRequest.getSubscriptionArn()); _subscriptionsForTopic.get(removed.getSubscriptionArn()).remove(removed.getSubscriptionArn()); return new UnsubscribeResult(); }
@Test public void testUnsubscribe_withNoRequestParams_shouldWork() { mockSns(new MockParameters()); assertNotNull(sns.unsubscribe(new UnsubscribeRequest())); }
@Override public UnsubscribeResult unsubscribe(UnsubscribeRequest unsubscribeRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException(); }
@Override public void delete(UnsubscribeRequest request) { delete(request, null); }
@Override public void delete(UnsubscribeRequest request, ResultCapture<Void> extractor ) { resource.performAction("Delete", request, extractor); }
@Override public void delete(ResultCapture<Void> extractor) { UnsubscribeRequest request = new UnsubscribeRequest(); delete(request, extractor); }
/** * Performs the <code>Delete</code> action. * * <p> * The following request parameters will be populated from the data of this * <code>Subscription</code> resource, and any conflicting parameter value * set in the request will be overridden: * <ul> * <li> * <b><code>SubscriptionArn</code></b> * - mapped from the <code>Arn</code> identifier. * </li> * </ul> * * <p> * * @see UnsubscribeRequest */ void delete(UnsubscribeRequest request);
/** * Performs the <code>Delete</code> action and use a ResultCapture to * retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>Subscription</code> resource, and any conflicting parameter value * set in the request will be overridden: * <ul> * <li> * <b><code>SubscriptionArn</code></b> * - mapped from the <code>Arn</code> identifier. * </li> * </ul> * * <p> * * @see UnsubscribeRequest */ void delete(UnsubscribeRequest request, ResultCapture<Void> extractor);