Example usage for com.amazonaws.services.kinesis AmazonKinesis deleteStream

List of usage examples for com.amazonaws.services.kinesis AmazonKinesis deleteStream

Introduction

In this page you can find the example usage for com.amazonaws.services.kinesis AmazonKinesis deleteStream.

Prototype

DeleteStreamResult deleteStream(String streamName);

Source Link

Document

Simplified method form for invoking the DeleteStream operation.

Usage

From source file:AmazonKinesisAuditVerify.java

License:Open Source License

public static void deleteResources() {
    AWSCredentials credentials = credentialsProvider.getCredentials();

    // Delete the stream
    AmazonKinesis kinesis = new AmazonKinesisClient(credentials);
    System.out.printf("Deleting the Amazon Kinesis stream used by the sample. Stream Name = %s.\n",
            SAMPLE_APPLICATION_STREAM_NAME);
    try {//  www .j  a  va  2  s  .  c o m
        kinesis.deleteStream(SAMPLE_APPLICATION_STREAM_NAME);
    } catch (ResourceNotFoundException ex) {
        // The stream doesn't exist.
    }

    // Delete the table
    AmazonDynamoDBClient dynamoDB = new AmazonDynamoDBClient(credentialsProvider.getCredentials());
    System.out.printf(
            "Deleting the Amazon DynamoDB table used by the Amazon Kinesis Client Library. Table Name = %s.\n",
            SAMPLE_APPLICATION_NAME);
    try {
        dynamoDB.deleteTable(SAMPLE_APPLICATION_NAME);
    } catch (com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException ex) {
        // The table doesn't exist.
    }
}

From source file:awskinesis.AmazonKinesisApplicationSample.java

License:Apache License

public static void deleteResources() {
    AWSCredentials credentials = credentialsProvider.getCredentials();

    // Delete the stream
    AmazonKinesis kinesis = new AmazonKinesisClient(credentials);
    kinesis.setEndpoint("kinesis.cn-north-1.amazonaws.com.cn");
    System.out.printf("Deleting the Amazon Kinesis stream used by the sample. Stream Name = %s.\n",
            SAMPLE_APPLICATION_STREAM_NAME);
    try {/* w  w w. j a v a 2  s .  c  om*/
        kinesis.deleteStream(SAMPLE_APPLICATION_STREAM_NAME);
    } catch (ResourceNotFoundException ex) {
        // The stream doesn't exist.
    }

    // Delete the table
    AmazonDynamoDBClient dynamoDB = new AmazonDynamoDBClient(credentialsProvider.getCredentials());
    dynamoDB.setEndpoint("dynamodb.cn-north-1.amazonaws.com.cn");
    System.out.printf(
            "Deleting the Amazon DynamoDB table used by the Amazon Kinesis Client Library. Table Name = %s.\n",
            SAMPLE_APPLICATION_NAME);
    try {
        dynamoDB.deleteTable(SAMPLE_APPLICATION_NAME);
    } catch (com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException ex) {
        // The table doesn't exist.
    }
}

From source file:edu.hawaii.kscmfeedprocessor.AmazonKinesisApplicationSample.java

License:Open Source License

public void deleteResources() {
    AWSCredentials credentials = credentialsProvider.getCredentials();

    // Delete the stream
    AmazonKinesis kinesis = new AmazonKinesisClient(credentials);
    System.out.printf("Deleting the Amazon Kinesis stream used by the sample. Stream Name = %s.\n",
            SAMPLE_APPLICATION_STREAM_NAME);
    try {//from   ww  w .ja v a2 s .  co  m
        kinesis.deleteStream(SAMPLE_APPLICATION_STREAM_NAME);
    } catch (ResourceNotFoundException ex) {
        // The stream doesn't exist.
    }

    // Delete the table
    AmazonDynamoDBClient dynamoDB = new AmazonDynamoDBClient(credentialsProvider.getCredentials());
    System.out.printf(
            "Deleting the Amazon DynamoDB table used by the Amazon Kinesis Client Library. Table Name = %s.\n",
            SAMPLE_APPLICATION_NAME);
    try {
        dynamoDB.deleteTable(SAMPLE_APPLICATION_NAME);
    } catch (com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException ex) {
        // The table doesn't exist.
    }
}