Java 类com.amazonaws.services.sns.model.GetTopicAttributesResult 实例源码

项目:spring-integration-aws    文件:SnsExecutor.java   
private void addPermissions() {
    if (permissions != null && permissions.isEmpty() == false) {
        GetTopicAttributesResult result = client
                .getTopicAttributes(topicArn);

        AwsUtil.addPermissions(result.getAttributes(), permissions,
                new AwsUtil.AddPermissionHandler() {

                    @Override
                    public void execute(Permission p) {
                        client.addPermission(new AddPermissionRequest()
                                .withTopicArn(topicArn)
                                .withLabel(p.getLabel())
                                .withAWSAccountIds(p.getAwsAccountIds())
                                .withActionNames(p.getActions()));
                    }
                });
    }
}
项目:unitstack    文件:MockSnsTest.java   
@Test
public void testGetSetTopicAttributes_shouldAddAndRespondAttributes() {
  mockSns(new MockParameters());
  CreateTopicResult topicResult = sns.createTopic(new CreateTopicRequest().withName("attributefull-topic"));

  SetTopicAttributesResult setAttrResult = sns.setTopicAttributes(topicResult.getTopicArn(), "planet", "Omega 3");
  assertNotNull(setAttrResult);

  GetTopicAttributesResult topicAttributes = sns.getTopicAttributes(new GetTopicAttributesRequest().withTopicArn(topicResult.getTopicArn()));

  assertEquals("verify added attribute is correct", "Omega 3", topicAttributes.getAttributes().get("planet"));

  sns.deleteTopic(topicResult.getTopicArn());
}
项目:Camel    文件:AmazonSNSClientMock.java   
@Override
public GetTopicAttributesResult getTopicAttributes(GetTopicAttributesRequest getTopicAttributesRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException();
}
项目:aws-sdk-java-resources    文件:TopicImpl.java   
@Override
public boolean load(GetTopicAttributesRequest request,
        ResultCapture<GetTopicAttributesResult> extractor) {

    return resource.load(request, extractor);
}
项目:aws-sdk-java-resources    文件:Topic.java   
/**
 * Makes a call to the service to load this resource's attributes if they
 * are not loaded yet, and use a ResultCapture to retrieve the low-level
 * client response
 * The following request parameters will be populated from the data of this
 * <code>Topic</code> resource, and any conflicting parameter value set in
 * the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>TopicArn</code></b>
 *         - mapped from the <code>Arn</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return Returns {@code true} if the resource is not yet loaded when this
 *         method was invoked, which indicates that a service call has been
 *         made to retrieve the attributes.
 * @see GetTopicAttributesRequest
 */
boolean load(GetTopicAttributesRequest request,
        ResultCapture<GetTopicAttributesResult> extractor);