Package org.apache.cxf.ws.rm.soap
Class RedeliveryQueueImpl
- java.lang.Object
-
- org.apache.cxf.ws.rm.soap.RedeliveryQueueImpl
-
- All Implemented Interfaces:
RedeliveryQueue
public class RedeliveryQueueImpl extends Object implements RedeliveryQueue
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRedeliveryQueueImpl.RedeliverCandidate
-
Field Summary
-
Fields inherited from interface org.apache.cxf.ws.rm.RedeliveryQueue
DEFAULT_BASE_REDELIVERY_INTERVAL, DEFAULT_EXPONENTIAL_BACKOFF
-
-
Constructor Summary
Constructors Constructor Description RedeliveryQueueImpl(RMManager m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUndelivered(Message message)Accepts a failed message for possible future redelivery.protected RedeliveryQueueImpl.RedeliverCandidatecacheUndelivered(Message message)Accepts a new resend candidate.intcountUndelivered()intcountUndelivered(DestinationSequence seq)RMManagergetManager()RetryStatusgetRedeliveryStatus(DestinationSequence seq, long num)Returns the retransmission status for the specified message.Map<Long,RetryStatus>getRedeliveryStatuses(DestinationSequence seq)Return the retransmission status of all the messages assigned to the sequence.protected List<RedeliveryQueueImpl.RedeliverCandidate>getSequenceCandidates(String key)protected List<RedeliveryQueueImpl.RedeliverCandidate>getSequenceCandidates(DestinationSequence seq)protected Map<String,List<RedeliveryQueueImpl.RedeliverCandidate>>getUndelivered()List<Long>getUndeliveredMessageNumbers(DestinationSequence seq)booleanisEmpty()protected booleanisSequenceSuspended(String key)voidpurgeAll(DestinationSequence seq)Purge all candiates for the given sequence.protected voidpurgeDelivered(RedeliveryQueueImpl.RedeliverCandidate candidate)voidresume(DestinationSequence seq)Resumes the redelivery attempts for the specified sequencevoidsetManager(RMManager m)voidstart()Initiate resends.voidstop(DestinationSequence seq)Stops redelivery queue.voidsuspend(DestinationSequence seq)Suspends the redelivery attempts for the specified sequence
-
-
-
Constructor Detail
-
RedeliveryQueueImpl
public RedeliveryQueueImpl(RMManager m)
-
-
Method Detail
-
getManager
public RMManager getManager()
-
setManager
public void setManager(RMManager m)
-
addUndelivered
public void addUndelivered(Message message)
Description copied from interface:RedeliveryQueueAccepts a failed message for possible future redelivery.- Specified by:
addUndeliveredin interfaceRedeliveryQueue- Parameters:
message- the message context.
-
countUndelivered
public int countUndelivered(DestinationSequence seq)
- Specified by:
countUndeliveredin interfaceRedeliveryQueue- Parameters:
seq- the sequence under consideration- Returns:
- the number of undelivered messages for that sequence
-
countUndelivered
public int countUndelivered()
- Specified by:
countUndeliveredin interfaceRedeliveryQueue- Returns:
- the total number of undelivered messages in this queue
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceRedeliveryQueue- Returns:
- true if there are no unacknowledged messages in the queue
-
purgeAll
public void purgeAll(DestinationSequence seq)
Description copied from interface:RedeliveryQueuePurge all candiates for the given sequence.- Specified by:
purgeAllin interfaceRedeliveryQueue- Parameters:
seq- the sequence object
-
getUndeliveredMessageNumbers
public List<Long> getUndeliveredMessageNumbers(DestinationSequence seq)
- Specified by:
getUndeliveredMessageNumbersin interfaceRedeliveryQueue- Returns:
-
getSequenceCandidates
protected List<RedeliveryQueueImpl.RedeliverCandidate> getSequenceCandidates(DestinationSequence seq)
- Parameters:
seq- the sequence under consideration- Returns:
- the list of resend candidates for that sequence
-
getSequenceCandidates
protected List<RedeliveryQueueImpl.RedeliverCandidate> getSequenceCandidates(String key)
- Parameters:
key- the sequence identifier under consideration- Returns:
- the list of resend candidates for that sequence
-
isSequenceSuspended
protected boolean isSequenceSuspended(String key)
- Parameters:
key- the sequence identifier under consideration- Returns:
- true if the sequence is currently suspended; false otherwise
-
getRedeliveryStatus
public RetryStatus getRedeliveryStatus(DestinationSequence seq, long num)
Description copied from interface:RedeliveryQueueReturns the retransmission status for the specified message.- Specified by:
getRedeliveryStatusin interfaceRedeliveryQueue- Returns:
-
getRedeliveryStatuses
public Map<Long,RetryStatus> getRedeliveryStatuses(DestinationSequence seq)
Description copied from interface:RedeliveryQueueReturn the retransmission status of all the messages assigned to the sequence.- Specified by:
getRedeliveryStatusesin interfaceRedeliveryQueue- Returns:
-
start
public void start()
Description copied from interface:RedeliveryQueueInitiate resends.- Specified by:
startin interfaceRedeliveryQueue
-
stop
public void stop(DestinationSequence seq)
Description copied from interface:RedeliveryQueueStops redelivery queue.- Specified by:
stopin interfaceRedeliveryQueue
-
suspend
public void suspend(DestinationSequence seq)
Description copied from interface:RedeliveryQueueSuspends the redelivery attempts for the specified sequence- Specified by:
suspendin interfaceRedeliveryQueue
-
resume
public void resume(DestinationSequence seq)
Description copied from interface:RedeliveryQueueResumes the redelivery attempts for the specified sequence- Specified by:
resumein interfaceRedeliveryQueue
-
cacheUndelivered
protected RedeliveryQueueImpl.RedeliverCandidate cacheUndelivered(Message message)
Accepts a new resend candidate.- Parameters:
message- the message.- Returns:
- ResendCandidate
-
purgeDelivered
protected void purgeDelivered(RedeliveryQueueImpl.RedeliverCandidate candidate)
-
getUndelivered
protected Map<String,List<RedeliveryQueueImpl.RedeliverCandidate>> getUndelivered()
- Returns:
- a map relating sequence ID to a lists of un-acknowledged messages for that sequence
-
-