Top Description Fields Constructors Methods
io.rsocket.lease

public final Class Lease

extends Object
Class Inheritance
Imports
io.netty.buffer.ByteBuf, .Unpooled, java.time.Duration, reactor.util.annotation.Nullable

A contract for RSocket lease, which is sent by a request acceptor and is time bound.

Field Summary

Modifier and TypeField and Description
pack-priv final long
pack-priv final ByteBuf
pack-priv final int
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv
Lease(Duration timeToLive, int numberOfRequests, ByteBuf metadata)

Method Summary

Modifier and TypeMethod and Description
public static Lease
create(Duration timeToLive, int numberOfRequests, ByteBuf metadata)

public static Lease
create(Duration timeToLive, int numberOfRequests)

public static Lease
public long

Returns:

Absolute time since epoch at which this lease will expire.
expirationTime
()

Absolute time since epoch at which this lease will expire.

public ByteBuf

Returns:

Metadata for the lease.
metadata
()

Metadata for the lease.

public int

Returns:

The number of requests allowed by this lease.
numberOfRequests
()

Number of requests allowed by this lease.

public int

Returns:

relative duration in milliseconds
timeToLiveInMillis
()

Time to live for the given lease

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static Lease
public static Lease
unbounded(ByteBuf metadata)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

expirationTimeback to summary
pack-priv final long expirationTime
metadataback to summary
pack-priv final ByteBuf metadata
numberOfRequestsback to summary
pack-priv final int numberOfRequests
timeToLiveMillisback to summary
pack-priv final int timeToLiveMillis

Constructor Detail

Leaseback to summary
pack-priv Lease(Duration timeToLive, int numberOfRequests, ByteBuf metadata)

Method Detail

createback to summary
public static Lease create(Duration timeToLive, int numberOfRequests, ByteBuf metadata)
createback to summary
public static Lease create(Duration timeToLive, int numberOfRequests)
emptyback to summary
public static Lease empty()
expirationTimeback to summary
public long expirationTime()

Absolute time since epoch at which this lease will expire.

Returns:long

Absolute time since epoch at which this lease will expire.

metadataback to summary
public ByteBuf metadata()

Metadata for the lease.

Returns:ByteBuf

Metadata for the lease.

Annotations
@Nullable
numberOfRequestsback to summary
public int numberOfRequests()

Number of requests allowed by this lease.

Returns:int

The number of requests allowed by this lease.

timeToLiveInMillisback to summary
public int timeToLiveInMillis()

Time to live for the given lease

Returns:int

relative duration in milliseconds

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
unboundedback to summary
public static Lease unbounded()
unboundedback to summary
public static Lease unbounded(ByteBuf metadata)