use of com.amazonaws.services.qldb.model.JournalKinesisStreamDescription in project amazon-qldb-dmv-sample-java by aws-samples.
the class StreamJournal method listQldbStreamsForLedger.
/**
* List QLDB streams for the ledger.
*
* @return map of stream Id to description for the ledger's QLDB streams.
*/
public static Map<String, JournalKinesisStreamDescription> listQldbStreamsForLedger() {
Map<String, JournalKinesisStreamDescription> streams = new HashMap<>();
String nextToken = null;
do {
ListJournalKinesisStreamsForLedgerRequest listRequest = new ListJournalKinesisStreamsForLedgerRequest().withLedgerName(ledgerName).withNextToken(nextToken);
ListJournalKinesisStreamsForLedgerResult listResult = qldb.listJournalKinesisStreamsForLedger(listRequest);
listResult.getStreams().forEach(streamDescription -> streams.put(streamDescription.getStreamId(), streamDescription));
nextToken = listResult.getNextToken();
} while (nextToken != null);
return streams;
}
Aggregations