@Test public void getUnacknowledged() throws ChannelNotFoundException { final String uaid = UUIDUtil.newUAID(); final Channel channel = newChannel(uaid, UUID.randomUUID().toString(), 10); datastore.saveChannel(channel); datastore.saveUnacknowledged(channel.getChannelId(), channel.getVersion()); final Set<Ack> unacks = datastore.getUnacknowledged(uaid); assertThat(unacks, hasItems(ack(channel))); }
@Override public Set<Ack> getUnacknowledged(final String uaid) { final ViewResult viewResult = db.queryView(query(Views.UNACKS.viewName(), uaid)); return rowsToAcks(viewResult.getRows()); }
CouchDBDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final ViewResult viewResult = db.queryView(query(Views.UNACKS.viewName(), uaid)); return rowsToAcks(viewResult.getRows()); } }
CouchDBDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final ViewResult viewResult = db.queryView(query(Views.UNACKS.viewName(), uaid)); return rowsToAcks(viewResult.getRows()); } CouchDBDataStore(final String url, final String dbName); }
CouchDBDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final ViewResult viewResult = db.queryView(query(Views.UNACKS.viewName(), uaid)); return rowsToAcks(viewResult.getRows()); } CouchDBDataStore(final String url, final String dbName); @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel channel); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked); }
CouchDBDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final ViewResult viewResult = db.queryView(query(Views.UNACKS.viewName(), uaid)); return rowsToAcks(viewResult.getRows()); } CouchDBDataStore(final String url, final String dbName); @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel channel); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked);  }