List of usage examples for com.amazonaws.services.sns AmazonSNSClient getCachedResponseMetadata
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
From source file:com.dev.appx.sns.SNSMobilePush.java
License:Open Source License
public void createTopic(String topic) throws IOException { //create a new SNS client and set endpoint AmazonSNSClient snsClient = new AmazonSNSClient(new ClasspathPropertiesFileCredentialsProvider()); /*AmazonSNS snsClient = new AmazonSNSClient(new PropertiesCredentials( SNSMobilePush.class// ww w . ja v a 2s .co m .getResourceAsStream("AwsCredentials.properties")));*/ snsClient.setRegion(Region.getRegion(Regions.US_EAST_1)); //create a new SNS topic CreateTopicRequest createTopicRequest = new CreateTopicRequest(topic); CreateTopicResult createTopicResult = snsClient.createTopic(createTopicRequest); //print TopicArn System.out.println(createTopicResult); //get request id for CreateTopicRequest from SNS metadata System.out.println("CreateTopicRequest - " + snsClient.getCachedResponseMetadata(createTopicRequest)); }