Class AbstractReactorConnectionOperations<C>

java.lang.Object
io.micronaut.data.connection.support.AbstractReactorConnectionOperations<C>
Type Parameters:
C - The connection type
All Implemented Interfaces:
ReactiveStreamsConnectionOperations<C>, ReactorConnectionOperations<C>
Direct Known Subclasses:
DefaultR2dbcReactorConnectionOperations

@Internal public abstract class AbstractReactorConnectionOperations<C> extends Object implements ReactorConnectionOperations<C>
The reactive MongoDB connection operations implementation.
Since:
4.0.0
Author:
Denis Stepanov
  • Constructor Details

    • AbstractReactorConnectionOperations

      public AbstractReactorConnectionOperations()
  • Method Details

    • openConnection

      @NonNull protected abstract @NonNull org.reactivestreams.Publisher<C> openConnection(@NonNull @NonNull ConnectionDefinition definition)
      Open a new connection.
      Parameters:
      definition - The connection definition
      Returns:
      new connection publisher
    • closeConnection

      @NonNull protected abstract @NonNull org.reactivestreams.Publisher<Void> closeConnection(@NonNull C connection, @NonNull @NonNull ConnectionDefinition definition)
      Close the connection.
      Parameters:
      connection - The connection
      definition - The connection definition
      Returns:
      closed publisher
    • findConnectionStatus

      public final Optional<ConnectionStatus<C>> findConnectionStatus(@NonNull @NonNull reactor.util.context.ContextView contextView)
      Description copied from interface: ReactorConnectionOperations
      Obtains the current connection.
      Specified by:
      findConnectionStatus in interface ReactorConnectionOperations<C>
      Parameters:
      contextView - The reactor's context view
      Returns:
      The optional connection
    • withConnectionFlux

      @NonNull public <T> @NonNull reactor.core.publisher.Flux<T> withConnectionFlux(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>,reactor.core.publisher.Flux<T>> callback)
      Description copied from interface: ReactorConnectionOperations
      Execute the given handler with a new transaction.
      Specified by:
      withConnectionFlux in interface ReactorConnectionOperations<C>
      Type Parameters:
      T - The emitted type
      Parameters:
      definition - The definition
      callback - The handler
      Returns:
      A publisher that emits the result type
    • withConnectionMono

      @NonNull public <T> @NonNull reactor.core.publisher.Mono<T> withConnectionMono(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>,reactor.core.publisher.Mono<T>> callback)
      Description copied from interface: ReactorConnectionOperations
      Execute the given handler with a new connection.
      Specified by:
      withConnectionMono in interface ReactorConnectionOperations<C>
      Type Parameters:
      T - The emitted type
      Parameters:
      definition - The definition
      callback - The handler
      Returns:
      A publisher that emits the result type