List of usage examples for com.amazonaws.services.dynamodbv2.document Table query
@Override
public ItemCollection<QueryOutcome> query(KeyAttribute hashKey, RangeKeyCondition rangeKeyCondition)
From source file:io.ignitr.dispatchr.manager.core.data.SubscriptionRepository.java
License:Apache License
/** * * @param topicName/*from ww w .ja v a 2 s.co m*/ * @return */ public Observable<Subscription> findAllForTopic(String topicName) { return Observable.create(subscriber -> { Table table = dynamoDB.getTable(TOPIC_SUBSCRIPTIONS_TABLE_NAME); table.query("topic", topicName).forEach(item -> { Subscription metadata = new Subscription(); metadata.setId(item.getString("subscriptionId")); metadata.setClientId(item.getString("clientId")); metadata.setTopicName(item.getString("topic")); metadata.setTopicArn(item.getString("topicArn")); metadata.setQueueArn(item.getString("queueArn")); metadata.setCreateDate(item.getLong("createDate")); metadata.setLastSubscribeDate(item.getLong("lastSubscribeDate")); subscriber.onNext(metadata); }); subscriber.onCompleted(); }); }