use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class CreateTopic method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicName>\n\n" + "Where:\n" + " topicName - the name of the topic to create (for example, mytopic).\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String topicName = args[0];
System.out.println("Creating a topic with name: " + topicName);
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
String arnVal = createSNSTopic(snsClient, topicName);
System.out.println("The topic ARN is" + arnVal);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class DeleteTopic method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to delete.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
System.out.println("Deleting a topic with name: " + topicArn);
deleteSNSTopic(snsClient, topicArn);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class GetTopicAttributes method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage: " + " <topicArn>\n\n" + "Where:\n" + " topicArn - the ARN of the topic to look up.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String topicArn = args[0];
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
System.out.println("Getting attributes for a topic with name: " + topicArn);
getSNSTopicAttributes(snsClient, topicArn);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class ListSubscriptions method main.
public static void main(String[] args) {
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
listSNSSubscriptions(snsClient);
snsClient.close();
}
use of software.amazon.awssdk.services.sns.SnsClient in project aws-doc-sdk-examples by awsdocs.
the class ListTopics method main.
public static void main(String[] args) {
SnsClient snsClient = SnsClient.builder().region(Region.US_WEST_2).build();
listSNSTopics(snsClient);
snsClient.close();
}
Aggregations