private Iterable clear()

in src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueue.java [236:247]


    private Iterable<DistributionQueueEntry> clear(String tailEntryId) {
        log.info("Clearing up to tail queue entry {}", tailEntryId);
        List<DistributionQueueEntry> removed = new ArrayList<>();
        for (DistributionQueueEntry entry : getEntries(0, -1)) {
            removed.add(entry);
            if (tailEntryId.equals(entry.getId())) {
                clear(entry);
                return removed;
            }
        }
        return emptyList();
    }