in src/main/java/org/apache/sling/distribution/journal/queue/impl/PubQueue.java [75:99]
public PubQueue(String queueName,
OffsetQueue<DistributionQueueItem> offsetQueue,
int retries,
@Nullable Throwable error,
@Nullable ClearCallback clearCallback) {
this.queueName = Objects.requireNonNull(queueName);
this.offsetQueue = Objects.requireNonNull(offsetQueue);
this.retries = retries;
this.clearCallback = clearCallback;
this.error = error;
if (clearCallback != null) {
capabilities.add(CLEARABLE);
/*
* The REMOVABLE capability is not meant to be
* supported by the PubQueue. however we currently
* claim to support it, because the UI is not yet
* able to allow selecting a range for clearing the
* queue.
*/
capabilities.add(REMOVABLE);
}
this.entryFactory = new QueueEntryFactory(queueName, this::attempts, this::error);
this.headItem = offsetQueue.getHeadItem();
}