Package io.aeron.protocol
Class StatusMessageFlyweight
java.lang.Object
org.agrona.AbstractMutableDirectBuffer
org.agrona.concurrent.UnsafeBuffer
io.aeron.protocol.HeaderFlyweight
io.aeron.protocol.StatusMessageFlyweight
- All Implemented Interfaces:
Comparable<DirectBuffer>,AtomicBuffer,DirectBuffer,MutableDirectBuffer
Flyweight for a Status Message Frame.
Status Message wiki page.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final shortPublisher should treat Subscriber as going away.static final intLength of the Status Message Frame.static final shortPublisher should send SETUP frame.Fields inherited from class io.aeron.protocol.HeaderFlyweight
CURRENT_VERSION, FLAGS_FIELD_OFFSET, FRAME_LENGTH_FIELD_OFFSET, HDR_TYPE_ATS_DATA, HDR_TYPE_ATS_SETUP, HDR_TYPE_ATS_SM, HDR_TYPE_DATA, HDR_TYPE_ERR, HDR_TYPE_EXT, HDR_TYPE_NAK, HDR_TYPE_PAD, HDR_TYPE_RES, HDR_TYPE_RSP_SETUP, HDR_TYPE_RTTM, HDR_TYPE_SETUP, HDR_TYPE_SM, MIN_HEADER_LENGTH, TYPE_FIELD_OFFSET, VERSION_FIELD_OFFSETFields inherited from class org.agrona.concurrent.UnsafeBuffer
ALIGNMENT, DISABLE_BOUNDS_CHECKS_PROP_NAME, SHOULD_BOUNDS_CHECKFields inherited from class org.agrona.AbstractMutableDirectBuffer
addressOffset, byteArray, capacityFields inherited from interface org.agrona.concurrent.AtomicBuffer
STRICT_ALIGNMENT_CHECKS, STRICT_ALIGNMENT_CHECKS_PROP_NAMEFields inherited from interface org.agrona.DirectBuffer
DISABLE_ARRAY_CONTENT_PRINTOUT_PROP_NAME, STR_HEADER_LEN -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor which can later be used to wrap a frame.StatusMessageFlyweight(ByteBuffer buffer) Construct the flyweight over a frame.StatusMessageFlyweight(UnsafeBuffer buffer) Construct the flyweight over a frame. -
Method Summary
Modifier and TypeMethodDescriptionintThe length of the Application Specific Feedback (or gtag).intThe highest consumption term-id.consumptionTermId(int termId) Set the highest consumption term-id.intThe highest consumption offset within the term.consumptionTermOffset(int termOffset) Set the highest consumption offset within the term.longgetLongUnaligned(int offset) Get long value from a field that is not aligned on an 8 byte boundary.longgroupTag()The group tag (if present) from the Status Message.Set the Receiver Group Tag for the Status Message.static intReturn the field offset within the flyweight for the group tag field.putLongUnaligned(int offset, long value) Set long value into a field that is not aligned on an 8 byte boundary.longIdentifier for the receiver to distinguish them for FlowControl strategies.receiverId(long id) Identifier for the receiver to distinguish them for FlowControl strategies.intThe receiver window length they will accept.receiverWindowLength(int receiverWindowLength) Set the receiver window length they will accept.intThe session-id for the stream.sessionId(int sessionId) Set the session-id of the stream.intstreamId()The stream-id for the stream.streamId(int streamId) Set the session-id for the stream.toString()Methods inherited from class io.aeron.protocol.HeaderFlyweight
appendFlagsAsChars, flags, flags, flagsToChars, frameLength, frameLength, headerType, headerType, version, versionMethods inherited from class org.agrona.concurrent.UnsafeBuffer
addIntOpaque, addIntOrdered, addIntRelease, addLongOpaque, addLongOrdered, addLongRelease, byteBuffer, compareAndExchangeInt, compareAndExchangeLong, compareAndSetInt, compareAndSetLong, ensureCapacity, getAndAddInt, getAndAddLong, getAndSetInt, getAndSetLong, getByteVolatile, getCharVolatile, getIntAcquire, getIntOpaque, getIntVolatile, getLongAcquire, getLongOpaque, getLongVolatile, getShortVolatile, isExpandable, putByteVolatile, putCharVolatile, putIntOpaque, putIntOrdered, putIntRelease, putIntVolatile, putLongOpaque, putLongOrdered, putLongRelease, putLongVolatile, putShortVolatile, verifyAlignment, wrap, wrap, wrap, wrap, wrap, wrap, wrap, wrapAdjustmentMethods inherited from class org.agrona.AbstractMutableDirectBuffer
addressOffset, boundsCheck, boundsCheck0, byteArray, capacity, checkLimit, compareTo, equals, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, hashCode, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAscii, putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.agrona.DirectBuffer
addressOffset, boundsCheck, byteArray, capacity, checkLimit, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAsciiMethods inherited from interface org.agrona.MutableDirectBuffer
putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemory
-
Field Details
-
HEADER_LENGTH
public static final int HEADER_LENGTHLength of the Status Message Frame.- See Also:
-
SEND_SETUP_FLAG
public static final short SEND_SETUP_FLAGPublisher should send SETUP frame.- See Also:
-
END_OF_STREAM_FLAG
public static final short END_OF_STREAM_FLAGPublisher should treat Subscriber as going away.- See Also:
-
-
Constructor Details
-
StatusMessageFlyweight
public StatusMessageFlyweight()Default constructor which can later be used to wrap a frame. -
StatusMessageFlyweight
Construct the flyweight over a frame.- Parameters:
buffer- containing the frame.
-
StatusMessageFlyweight
Construct the flyweight over a frame.- Parameters:
buffer- containing the frame.
-
-
Method Details
-
sessionId
public int sessionId()The session-id for the stream.- Returns:
- session-id for the stream.
-
sessionId
Set the session-id of the stream.- Parameters:
sessionId- field value.- Returns:
- this for a fluent API.
-
streamId
public int streamId()The stream-id for the stream.- Returns:
- the session-id for the stream.
-
streamId
Set the session-id for the stream.- Parameters:
streamId- field value.- Returns:
- this for a fluent API.
-
consumptionTermOffset
public int consumptionTermOffset()The highest consumption offset within the term.- Returns:
- the highest consumption offset within the term.
-
consumptionTermOffset
Set the highest consumption offset within the term.- Parameters:
termOffset- field value.- Returns:
- this for a fluent API.
-
consumptionTermId
public int consumptionTermId()The highest consumption term-id.- Returns:
- highest consumption term-id.
-
consumptionTermId
Set the highest consumption term-id.- Parameters:
termId- field value.- Returns:
- this for a fluent API.
-
receiverWindowLength
public int receiverWindowLength()The receiver window length they will accept.- Returns:
- receiver window length they will accept.
-
receiverWindowLength
Set the receiver window length they will accept.- Parameters:
receiverWindowLength- field value.- Returns:
- this for a fluent API.
-
receiverId
public long receiverId()Identifier for the receiver to distinguish them for FlowControl strategies.- Returns:
- identifier for the receiver to distinguish them for FlowControl strategies.
-
receiverId
Identifier for the receiver to distinguish them for FlowControl strategies.- Parameters:
id- for the receiver to distinguish them for FlowControl strategies.- Returns:
- this for a fluent API.
-
asfLength
public int asfLength()The length of the Application Specific Feedback (or gtag).- Returns:
- length, in bytes, of the Application Specific Feedback (or gtag).
-
groupTag
public long groupTag()The group tag (if present) from the Status Message.- Returns:
- the group tag value or 0 if not present.
-
groupTag
Set the Receiver Group Tag for the Status Message.- Parameters:
groupTag- value to set if not null.- Returns:
- this for a fluent API.
-
groupTagFieldOffset
public static int groupTagFieldOffset()Return the field offset within the flyweight for the group tag field.- Returns:
- offset of group tag field
-
getLongUnaligned
public long getLongUnaligned(int offset) Get long value from a field that is not aligned on an 8 byte boundary.- Parameters:
offset- of the field to get.- Returns:
- value of field.
-
putLongUnaligned
Set long value into a field that is not aligned on an 8 byte boundary.- Parameters:
offset- of the field to put.value- of the field to put.- Returns:
- this for fluent API.
-
toString
- Overrides:
toStringin classUnsafeBuffer
-