Search in sources :

Example 1 with CancelJournalKinesisStreamRequest

use of com.amazonaws.services.qldb.model.CancelJournalKinesisStreamRequest in project amazon-qldb-dmv-sample-java by aws-samples.

the class StreamJournal method cancelQldbStream.

/**
 * Cancel the QLDB stream.
 */
public static void cancelQldbStream() {
    if (null == streamId) {
        return;
    }
    try {
        CancelJournalKinesisStreamRequest request = new CancelJournalKinesisStreamRequest().withLedgerName(ledgerName).withStreamId(streamId);
        qldb.cancelJournalKinesisStream(request);
        log.info("QLDB stream was cancelled.");
    } catch (com.amazonaws.services.qldb.model.ResourceNotFoundException ex) {
        log.info("No QLDB stream to cancel.");
    } catch (Exception ex) {
        log.warn("Error cancelling QLDB stream.", ex);
    }
}
Also used : CancelJournalKinesisStreamRequest(com.amazonaws.services.qldb.model.CancelJournalKinesisStreamRequest) NoSuchEntityException(com.amazonaws.services.identitymanagement.model.NoSuchEntityException) ResourceNotFoundException(com.amazonaws.services.kinesis.model.ResourceNotFoundException) IOException(java.io.IOException)

Aggregations

NoSuchEntityException (com.amazonaws.services.identitymanagement.model.NoSuchEntityException)1 ResourceNotFoundException (com.amazonaws.services.kinesis.model.ResourceNotFoundException)1 CancelJournalKinesisStreamRequest (com.amazonaws.services.qldb.model.CancelJournalKinesisStreamRequest)1 IOException (java.io.IOException)1