Top Fields Constructors Methods
io.rsocket.resume

public Class ClientRSocketSession

extends Object
implements RSocketSession, ResumeStateHolder, CoreSubscriber<Tuple2<ByteBuf, DuplexConnection>>
Class Inheritance
All Implemented Interfaces
reactor.core.CoreSubscriber, org.reactivestreams.Subscriber, io.rsocket.resume.ResumeStateHolder, io.rsocket.resume.RSocketSession, reactor.core.Disposable
Imports
io.netty.buffer.ByteBuf, .ByteBufAllocator, io.netty.util.CharsetUtil, io.rsocket.DuplexConnection, io.rsocket.exceptions.ConnectionErrorException, .Exceptions, .RejectedResumeException, io.rsocket.frame.FrameHeaderCodec, .FrameType, .ResumeFrameCodec, .ResumeOkFrameCodec, io.rsocket.keepalive.KeepAliveSupport, java.time.Duration, java.util.concurrent.atomic.AtomicReferenceFieldUpdater, java.util.function.Function, org.reactivestreams.Subscription, org.slf4j.Logger, .LoggerFactory, reactor.core.CoreSubscriber, .Disposable, reactor.core.publisher.Mono, .Operators, reactor.util.function.Tuple2, reactor.util.retry.Retry

Field Summary

Modifier and TypeField and Description
pack-priv final ByteBufAllocator
pack-priv final boolean
pack-priv final Mono<Tuple2<ByteBuf, DuplexConnection>>
pack-priv KeepAliveSupport
private static final Logger
pack-priv final Disposable
pack-priv final ResumableDuplexConnection
pack-priv final ResumableFramesStore
pack-priv final Duration
pack-priv final ByteBuf
pack-priv final Retry
pack-priv volatile Subscription
s

pack-priv static final AtomicReferenceFieldUpdater<ClientRSocketSession, Subscription>
S

pack-priv final String

Constructor Summary

AccessConstructor and Description
public
ClientRSocketSession(ByteBuf resumeToken, ResumableDuplexConnection resumableDuplexConnection, Mono<DuplexConnection> connectionFactory, Function<DuplexConnection, Mono<Tuple2<ByteBuf, DuplexConnection>>> connectionTransformer, ResumableFramesStore resumableFramesStore, Duration resumeSessionDuration, Retry retry, boolean cleanupStoreOnKeepAlive)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.
public long
public boolean
isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.
public void
onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Successful terminal state.
public void
onError(Throwable
the throwable signaled
t
)

Implements org.reactivestreams.Subscriber.onError.

Failed terminal state.
public void
public void
onNext(Tuple2<ByteBuf, DuplexConnection>
the element signaled
objects
)

Implements org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).
public void
onSubscribe(Subscription
the Subscription that allows requesting data via Subscription#request(long)
s
)

Implements reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long).
pack-priv void
reconnect(int index)

public void
pack-priv boolean
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allocatorback to summary
pack-priv final ByteBufAllocator allocator
cleanupStoreOnKeepAliveback to summary
pack-priv final boolean cleanupStoreOnKeepAlive
connectionFactoryback to summary
pack-priv final Mono<Tuple2<ByteBuf, DuplexConnection>> connectionFactory
keepAliveSupportback to summary
pack-priv KeepAliveSupport keepAliveSupport
loggerback to summary
private static final Logger logger
reconnectDisposableback to summary
pack-priv final Disposable reconnectDisposable
resumableConnectionback to summary
pack-priv final ResumableDuplexConnection resumableConnection
resumableFramesStoreback to summary
pack-priv final ResumableFramesStore resumableFramesStore
resumeSessionDurationback to summary
pack-priv final Duration resumeSessionDuration
resumeTokenback to summary
pack-priv final ByteBuf resumeToken
retryback to summary
pack-priv final Retry retry
sback to summary
pack-priv volatile Subscription s
Sback to summary
pack-priv static final AtomicReferenceFieldUpdater<ClientRSocketSession, Subscription> S
sessionback to summary
pack-priv final String session

Constructor Detail

ClientRSocketSessionback to summary
public ClientRSocketSession(ByteBuf resumeToken, ResumableDuplexConnection resumableDuplexConnection, Mono<DuplexConnection> connectionFactory, Function<DuplexConnection, Mono<Tuple2<ByteBuf, DuplexConnection>>> connectionTransformer, ResumableFramesStore resumableFramesStore, Duration resumeSessionDuration, Retry retry, boolean cleanupStoreOnKeepAlive)

Method Detail

disposeback to summary
public void dispose()

Implements reactor.core.Disposable.dispose.

Doc from reactor.core.Disposable.dispose.

Cancel or dispose the underlying task or resource.

Implementations are required to make this method idempotent.

Annotations
@Override
impliedPositionback to summary
public long impliedPosition()

Implements io.rsocket.resume.ResumeStateHolder.impliedPosition.

Annotations
@Override
isDisposedback to summary
public boolean isDisposed()

Overrides default reactor.core.Disposable.isDisposed.

Doc from reactor.core.Disposable.isDisposed.

Optionally return true when the resource or task is disposed.

Implementations are not required to track disposition and as such may never return true even when disposed. However, they MUST only return true when there's a guarantee the resource or task is disposed.

Returns:boolean

true when there's a guarantee the resource or task is disposed.

Annotations
@Override
onCompleteback to summary
public void onComplete()

Implements org.reactivestreams.Subscriber.onComplete.

Doc from org.reactivestreams.Subscriber.onComplete.

Successful terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Annotations
@Override
onErrorback to summary
public void onError(Throwable t)

Implements org.reactivestreams.Subscriber.onError.

Doc from org.reactivestreams.Subscriber.onError.

Failed terminal state.

No further events will be sent even if Subscription#request(long) is invoked again.

Parameters
t:Throwable

the throwable signaled

Annotations
@Override
onImpliedPositionback to summary
public void onImpliedPosition(long remoteImpliedPos)

Implements io.rsocket.resume.ResumeStateHolder.onImpliedPosition.

Annotations
@Override
onNextback to summary
public void onNext(Tuple2<ByteBuf, DuplexConnection> objects)

Implements org.reactivestreams.Subscriber.onNext.

Doc from org.reactivestreams.Subscriber.onNext.

Data notification sent by the Publisher in response to requests to Subscription#request(long).

Parameters
objects:Tuple2<ByteBuf, DuplexConnection>

the element signaled

Annotations
@Override
onSubscribeback to summary
public void onSubscribe(Subscription s)

Implements reactor.core.CoreSubscriber.onSubscribe.

Doc from reactor.core.CoreSubscriber.onSubscribe.

Implementors should initialize any state used by onNext(Object) before calling Subscription#request(long). Should further onNext related state modification occur, thread-safety will be required.

Note that an invalid request <= 0 will not produce an onError and will simply be ignored or reported through a debug-enabled reactor.util.Logger. Invoked after calling Publisher#subscribe(Subscriber).

No data will start flowing until Subscription#request(long) is invoked.

It is the responsibility of this Subscriber instance to call Subscription#request(long) whenever more data is wanted.

The Publisher will send notifications only in response to Subscription#request(long).

Parameters
s:Subscription

Doc from org.reactivestreams.Subscriber.onSubscribe.

the Subscription that allows requesting data via Subscription#request(long)

Annotations
@Override
reconnectback to summary
pack-priv void reconnect(int index)
setKeepAliveSupportback to summary
public void setKeepAliveSupport(KeepAliveSupport keepAliveSupport)

Implements io.rsocket.resume.RSocketSession.setKeepAliveSupport.

tryCancelSessionTimeoutback to summary
pack-priv boolean tryCancelSessionTimeout()
tryReestablishSessionback to summary
pack-priv void tryReestablishSession(Tuple2<ByteBuf, DuplexConnection> tuple2)