public final class AckedSendBuffer<T extends HasSequenceNumber>
extends java.lang.Object
implements scala.Product, scala.Serializable
AckedReceiveBuffer
on the receiving end.
param: capacity Maximum number of messages the buffer is willing to accept. If reached ResendBufferCapacityReachedException
is thrown.
param: nonAcked Sequence of messages that has not yet been acknowledged.
param: nacked Sequence of messages that has been explicitly negative acknowledged.
param: maxSeq The maximum sequence number that has been stored in this buffer. Messages having lower sequence number
will be not stored but rejected with IllegalArgumentException
Constructor and Description |
---|
AckedSendBuffer(int capacity,
scala.collection.immutable.IndexedSeq<T> nonAcked,
scala.collection.immutable.IndexedSeq<T> nacked,
SeqNo maxSeq) |
Modifier and Type | Method and Description |
---|---|
AckedSendBuffer<T> |
acknowledge(Ack ack)
Processes an incoming acknowledgement and returns a new buffer with only unacknowledged elements remaining.
|
AckedSendBuffer<T> |
buffer(T msg)
Puts a new message in the buffer.
|
abstract static boolean |
canEqual(java.lang.Object that) |
int |
capacity() |
abstract static boolean |
equals(java.lang.Object that) |
SeqNo |
maxSeq() |
scala.collection.immutable.IndexedSeq<T> |
nacked() |
scala.collection.immutable.IndexedSeq<T> |
nonAcked() |
abstract static int |
productArity() |
abstract static java.lang.Object |
productElement(int n) |
static scala.collection.Iterator<java.lang.Object> |
productIterator() |
static java.lang.String |
productPrefix() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public abstract static boolean canEqual(java.lang.Object that)
public abstract static boolean equals(java.lang.Object that)
public abstract static java.lang.Object productElement(int n)
public abstract static int productArity()
public static scala.collection.Iterator<java.lang.Object> productIterator()
public static java.lang.String productPrefix()
public int capacity()
public scala.collection.immutable.IndexedSeq<T> nonAcked()
public scala.collection.immutable.IndexedSeq<T> nacked()
public SeqNo maxSeq()
public AckedSendBuffer<T> acknowledge(Ack ack)
ack
- The received acknowledgementpublic AckedSendBuffer<T> buffer(T msg)
IllegalArgumentException
if an out-of-sequence message
is attempted to be stored.msg
- The message to be stored for possible future retransmission.public java.lang.String toString()
toString
in class java.lang.Object