use of org.apache.cxf.ws.rm.persistence.RMStore in project cxf by apache.
the class Destination method removeSequence.
public void removeSequence(DestinationSequence seq) {
DestinationSequence o;
o = map.remove(seq.getIdentifier().getValue());
RMStore store = getReliableEndpoint().getManager().getStore();
if (null != store) {
store.removeDestinationSequence(seq.getIdentifier());
}
if (o != null) {
processingSequenceCount.decrementAndGet();
completedSequenceCount.incrementAndGet();
}
}
use of org.apache.cxf.ws.rm.persistence.RMStore in project cxf by apache.
the class Destination method addSequence.
public void addSequence(DestinationSequence seq, boolean persist) {
seq.setDestination(this);
map.put(seq.getIdentifier().getValue(), seq);
if (persist) {
RMStore store = getReliableEndpoint().getManager().getStore();
if (null != store) {
store.createDestinationSequence(seq);
}
}
processingSequenceCount.incrementAndGet();
}
use of org.apache.cxf.ws.rm.persistence.RMStore in project cxf by apache.
the class DestinationSequence method purgeAcknowledged.
void purgeAcknowledged(long messageNr) {
RMStore store = destination.getManager().getStore();
if (null == store) {
return;
}
store.removeMessages(getIdentifier(), Collections.singleton(messageNr), false);
}
use of org.apache.cxf.ws.rm.persistence.RMStore in project cxf by apache.
the class RedeliveryQueueImpl method purgeAll.
public void purgeAll(DestinationSequence seq) {
Collection<Long> purged = new ArrayList<>();
synchronized (this) {
LOG.fine("Start purging redeliver candidates.");
List<RedeliverCandidate> sequenceCandidates = getSequenceCandidates(seq);
if (null != sequenceCandidates) {
for (int i = sequenceCandidates.size() - 1; i >= 0; i--) {
RedeliverCandidate candidate = sequenceCandidates.get(i);
long m = candidate.getNumber();
sequenceCandidates.remove(i);
candidate.resolved();
undeliveredCount--;
purged.add(m);
}
if (sequenceCandidates.isEmpty()) {
candidates.remove(seq.getIdentifier().getValue());
}
}
LOG.fine("Completed purging redeliver candidates.");
}
if (!purged.isEmpty()) {
RMStore store = manager.getStore();
if (null != store) {
store.removeMessages(seq.getIdentifier(), purged, false);
}
}
}
use of org.apache.cxf.ws.rm.persistence.RMStore in project cxf by apache.
the class RetransmissionQueueImpl method purgeCandidates.
private void purgeCandidates(SourceSequence seq, boolean any) {
Collection<Long> purged = new ArrayList<>();
Collection<ResendCandidate> resends = new ArrayList<>();
Identifier sid = seq.getIdentifier();
synchronized (this) {
LOG.fine("Start purging resend candidates.");
List<ResendCandidate> sequenceCandidates = getSequenceCandidates(seq);
if (null != sequenceCandidates) {
for (int i = sequenceCandidates.size() - 1; i >= 0; i--) {
ResendCandidate candidate = sequenceCandidates.get(i);
long m = candidate.getNumber();
if (any || seq.isAcknowledged(m)) {
sequenceCandidates.remove(i);
candidate.resolved();
unacknowledgedCount--;
purged.add(m);
resends.add(candidate);
}
}
if (sequenceCandidates.isEmpty()) {
candidates.remove(sid.getValue());
}
}
LOG.fine("Completed purging resend candidates.");
}
if (!purged.isEmpty()) {
RMStore store = manager.getStore();
if (null != store) {
store.removeMessages(sid, purged, true);
}
RMEndpoint rmEndpoint = seq.getSource().getReliableEndpoint();
for (ResendCandidate resend : resends) {
rmEndpoint.handleAcknowledgment(sid.getValue(), resend.getNumber(), resend.getMessage());
}
}
}
Aggregations