public final class LeaseFrame extends Object
LEASE frame.Disposable.Composite, Disposable.SwapFRAME_TYPE_SHIFT| Modifier and Type | Method and Description |
|---|---|
static LeaseFrame |
createLeaseFrame(ByteBuf byteBuf)
Creates the
LEASE frame. |
static LeaseFrame |
createLeaseFrame(ByteBufAllocator byteBufAllocator,
Duration timeToLive,
int numberOfRequests,
ByteBuf metadata)
Creates the
LEASE frame. |
void |
dispose() |
boolean |
equals(Object o) |
FrameType |
getFrameType()
Returns the
FrameType. |
int |
getNumberOfRequests()
Returns the number of requests
|
Duration |
getTimeToLive()
Returns the time to live.
|
ByteBuf |
getUnsafeFrame()
Returns the frame directly.
|
ByteBuf |
getUnsafeMetadata()
Returns the metadata directly.
|
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMetadataAsUtf8, getMetadataLength, getUnsafeMetadataAsUtf8, getUnsafeMetadataLength, mapMetadataconsumeFrame, getFrameType, getUnsafeFrame, mapFramedispose, isDisposedpublic static LeaseFrame createLeaseFrame(ByteBuf byteBuf)
LEASE frame.byteBuf - the ByteBuf representing the frameLEASE frame.NullPointerException - if byteBuf is nullpublic static LeaseFrame createLeaseFrame(ByteBufAllocator byteBufAllocator, Duration timeToLive, int numberOfRequests, @Nullable ByteBuf metadata)
LEASE frame.byteBufAllocator - the ByteBufAllocator to usetimeToLive - the validity of lease from time of receptionnumberOfRequests - the number of requests that may be sent until the next leasemetadata - the metadataLEASE frameIllegalArgumentException - if timeToLive is not a positive durationIllegalArgumentException - if numberOfRequests is not positiveNullPointerException - if byteBufAllocator or timeToLive is nullIllegalArgumentException - if timeToLive is not a positive duration or numberOfRequests is not positivepublic int getNumberOfRequests()
public Duration getTimeToLive()
@Nullable public ByteBuf getUnsafeMetadata()
MetadataFramenull.
Note: this metadata will be outside of the Frame's lifecycle and may be
released at any time. It is highly recommended that you ByteBuf.retain() the metadata
if you store it.
null if the Metadata flag is not setMetadataFrame.getMetadataAsUtf8(),
MetadataFrame.mapMetadata(Function)public final void dispose()
dispose in interface Disposablepublic FrameType getFrameType()
FrameFrameType.getFrameType in interface FrameFrameTypepublic final ByteBuf getUnsafeFrame()
FrameNote: this frame will be outside of the Frame's lifecycle and may be released
at any time. It is highly recommended that you ByteBuf.retain() the frame if you store
it.
getUnsafeFrame in interface FrameFrame.consumeFrame(Consumer),
Frame.mapFrame(Function)