@Test public void waitingDeliveryMessages() throws Exception { final Subscription subscription = server.subscribe(); final String messageId = UUID.randomUUID().toString(); server.saveMessage(new DefaultPushMessage(messageId, subscription.id(), Optional.empty(), "testing", Optional.of(0))); final List<PushMessage> message = server.waitingDeliveryMessages(subscription.id()); assertThat(message.get(0).payload(), equalTo("testing")); assertThat(message.get(0).ttl().get(), equalTo(0)); }
@Override public List<PushMessage> waitingDeliveryMessages(final String subId) { return store.waitingDeliveryMessages(subId); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> waitingDeliveryMessages(final String subId) { return store.waitingDeliveryMessages(subId); } }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> waitingDeliveryMessages(final String subId) { return store.waitingDeliveryMessages(subId); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> waitingDeliveryMessages(final String subId) { return store.waitingDeliveryMessages(subId); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); @Override Subscription subscribe(); @Override Optional<Subscription> subscriptionById(final String id); @Override Optional<Subscription> subscriptionByToken(final String subscriptionToken); @Override Optional<Subscription> subscriptionByPushToken(final String pushToken); @Override Optional<Subscription> subscriptionByReceiptToken(final String receiptToken); @Override List<PushMessage> removeSubscription(final String id); @Override void saveMessage(final PushMessage msg); @Override List<PushMessage> waitingDeliveryMessages(final String subId); @Override void saveSentMessage(final PushMessage msg); @Override Optional<PushMessage> sentMessage(final String pushMsgResource); @Override WebPushServerConfig config(); static byte[] generateAndStorePrivateKey(final DataStore store, final WebPushServerConfig config); @Override String generateEndpointToken(final String value); @Override String generateEndpointToken(final String firstId, final String secondId); }
DefaultWebPushServer implements WebPushServer { @Override public List<PushMessage> waitingDeliveryMessages(final String subId) { return store.waitingDeliveryMessages(subId); } DefaultWebPushServer(final DataStore store, final WebPushServerConfig config, final byte[] privateKey); @Override Subscription subscribe(); @Override Optional<Subscription> subscriptionById(final String id); @Override Optional<Subscription> subscriptionByToken(final String subscriptionToken); @Override Optional<Subscription> subscriptionByPushToken(final String pushToken); @Override Optional<Subscription> subscriptionByReceiptToken(final String receiptToken); @Override List<PushMessage> removeSubscription(final String id); @Override void saveMessage(final PushMessage msg); @Override List<PushMessage> waitingDeliveryMessages(final String subId); @Override void saveSentMessage(final PushMessage msg); @Override Optional<PushMessage> sentMessage(final String pushMsgResource); @Override WebPushServerConfig config(); static byte[] generateAndStorePrivateKey(final DataStore store, final WebPushServerConfig config); @Override String generateEndpointToken(final String value); @Override String generateEndpointToken(final String firstId, final String secondId);  }