@Test public void removeChannelsNoUserAgentStored() { final String channelId1 = UUID.randomUUID().toString(); jpaDataStore.removeChannels(UUIDUtil.newUAID()); assertThat(channelExists(channelId1, jpaDataStore), is(false)); }
@Override public void removeChannels(final Set<String> channelIds) { if (channelIds == null || channelIds.isEmpty()) { return; } final JpaOperation<Integer> removeChannel = new JpaOperation<Integer>() { @Override public Integer perform(EntityManager em) { final Query delete = em.createQuery("DELETE from ChannelDTO c where c.channelId in (:channelIds)"); delete.setParameter("channelIds", channelIds); return delete.executeUpdate(); } }; jpaExecutor.execute(removeChannel); }
JpaDataStore implements DataStore { @Override public void removeChannels(final Set<String> channelIds) { if (channelIds == null || channelIds.isEmpty()) { return; } final JpaOperation<Integer> removeChannel = new JpaOperation<Integer>() { @Override public Integer perform(EntityManager em) { final Query delete = em.createQuery("DELETE from ChannelDTO c where c.channelId in (:channelIds)"); delete.setParameter("channelIds", channelIds); return delete.executeUpdate(); } }; jpaExecutor.execute(removeChannel); } }
JpaDataStore implements DataStore { @Override public void removeChannels(final Set<String> channelIds) { if (channelIds == null || channelIds.isEmpty()) { return; } final JpaOperation<Integer> removeChannel = new JpaOperation<Integer>() { @Override public Integer perform(EntityManager em) { final Query delete = em.createQuery("DELETE from ChannelDTO c where c.channelId in (:channelIds)"); delete.setParameter("channelIds", channelIds); return delete.executeUpdate(); } }; jpaExecutor.execute(removeChannel); } JpaDataStore(final String persistenceUnit); }
JpaDataStore implements DataStore { @Override public void removeChannels(final Set<String> channelIds) { if (channelIds == null || channelIds.isEmpty()) { return; } final JpaOperation<Integer> removeChannel = new JpaOperation<Integer>() { @Override public Integer perform(EntityManager em) { final Query delete = em.createQuery("DELETE from ChannelDTO c where c.channelId in (:channelIds)"); delete.setParameter("channelIds", channelIds); return delete.executeUpdate(); } }; jpaExecutor.execute(removeChannel); } JpaDataStore(final String persistenceUnit); @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 Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override void removeChannels(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); }
JpaDataStore implements DataStore { @Override public void removeChannels(final Set<String> channelIds) { if (channelIds == null || channelIds.isEmpty()) { return; } final JpaOperation<Integer> removeChannel = new JpaOperation<Integer>() { @Override public Integer perform(EntityManager em) { final Query delete = em.createQuery("DELETE from ChannelDTO c where c.channelId in (:channelIds)"); delete.setParameter("channelIds", channelIds); return delete.executeUpdate(); } }; jpaExecutor.execute(removeChannel); } JpaDataStore(final String persistenceUnit); @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 Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override void removeChannels(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);  }