Class ReactiveMongoClientImpl

java.lang.Object
io.quarkus.mongodb.impl.ReactiveMongoClientImpl
All Implemented Interfaces:
ReactiveMongoClient, Closeable, AutoCloseable

public class ReactiveMongoClientImpl extends Object implements ReactiveMongoClient
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactiveMongoClientImpl(com.mongodb.reactivestreams.client.MongoClient client)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the client, which will close all underlying cached resources, including, for example, sockets and background monitoring threads.
    Retrieves a ReactiveMongoDatabase with the given name.
    io.smallrye.mutiny.Multi<String>
    Gets a list of the database names.
    io.smallrye.mutiny.Multi<String>
    listDatabaseNames(com.mongodb.reactivestreams.client.ClientSession clientSession)
    Gets a list of the database names.
    io.smallrye.mutiny.Multi<org.bson.Document>
    Gets the list of database descriptors.
    io.smallrye.mutiny.Multi<org.bson.Document>
    listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession)
    Gets the list of databases as a stream.
    io.smallrye.mutiny.Multi<org.bson.Document>
    listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, DatabaseListOptions options)
    Gets the list of databases as a stream.
    <T> io.smallrye.mutiny.Multi<T>
    listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz)
    Gets the list of databases.
    <T> io.smallrye.mutiny.Multi<T>
    listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz, DatabaseListOptions options)
    Gets the list of databases.
    io.smallrye.mutiny.Multi<org.bson.Document>
    Gets the list of database descriptors.
    <T> io.smallrye.mutiny.Multi<T>
    listDatabases(Class<T> clazz)
    Gets the list of databases.
    <T> io.smallrye.mutiny.Multi<T>
    Gets the list of databases.
    io.smallrye.mutiny.Uni<com.mongodb.reactivestreams.client.ClientSession>
    Creates a client session.
    io.smallrye.mutiny.Uni<com.mongodb.reactivestreams.client.ClientSession>
    startSession(com.mongodb.ClientSessionOptions options)
    Creates a client session.
    com.mongodb.reactivestreams.client.MongoClient
     
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, ChangeStreamOptions options)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz, ChangeStreamOptions options)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, ChangeStreamOptions options)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz, ChangeStreamOptions options)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(Class<T> clazz)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(Class<T> clazz, ChangeStreamOptions options)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(List<? extends org.bson.conversions.Bson> pipeline)
    Creates a change stream for this client.
    io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>>
    watch(List<? extends org.bson.conversions.Bson> pipeline, ChangeStreamOptions options)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz)
    Creates a change stream for this client.
    <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>>
    watch(List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz, ChangeStreamOptions options)
    Creates a change stream for this client.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReactiveMongoClientImpl

      public ReactiveMongoClientImpl(com.mongodb.reactivestreams.client.MongoClient client)
  • Method Details

    • getDatabase

      public ReactiveMongoDatabase getDatabase(String name)
      Description copied from interface: ReactiveMongoClient
      Retrieves a ReactiveMongoDatabase with the given name.
      Specified by:
      getDatabase in interface ReactiveMongoClient
      Parameters:
      name - the name, must not be null
      Returns:
      the ReactiveMongoDatabase
    • close

      public void close()
      Description copied from interface: ReactiveMongoClient
      Closes the client, which will close all underlying cached resources, including, for example, sockets and background monitoring threads.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface ReactiveMongoClient
    • listDatabaseNames

      public io.smallrye.mutiny.Multi<String> listDatabaseNames()
      Description copied from interface: ReactiveMongoClient
      Gets a list of the database names.
      Specified by:
      listDatabaseNames in interface ReactiveMongoClient
      Returns:
      a stream containing the database names, empty is none.
    • listDatabaseNames

      public io.smallrye.mutiny.Multi<String> listDatabaseNames(com.mongodb.reactivestreams.client.ClientSession clientSession)
      Description copied from interface: ReactiveMongoClient
      Gets a list of the database names.
      Specified by:
      listDatabaseNames in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      Returns:
      a stream containing the database names, empty is none.
    • listDatabases

      public io.smallrye.mutiny.Multi<org.bson.Document> listDatabases()
      Description copied from interface: ReactiveMongoClient
      Gets the list of database descriptors.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Returns:
      a stream of the database, empty if none.
    • listDatabases

      public io.smallrye.mutiny.Multi<org.bson.Document> listDatabases(DatabaseListOptions options)
      Description copied from interface: ReactiveMongoClient
      Gets the list of database descriptors.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Parameters:
      options - the stream options (max time, filter, name only...), may be null
      Returns:
      a stream of the database, empty if none.
    • listDatabases

      public <T> io.smallrye.mutiny.Multi<T> listDatabases(Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Type Parameters:
      T - the type of the class to use instead of Document.
      Parameters:
      clazz - the class to cast the database documents to
      Returns:
      the stream of database descriptors
    • listDatabases

      public <T> io.smallrye.mutiny.Multi<T> listDatabases(Class<T> clazz, DatabaseListOptions options)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Type Parameters:
      T - the type of the class to use instead of Document.
      Parameters:
      clazz - the class to cast the database documents to
      options - the stream options
      Returns:
      the stream of database descriptors
    • listDatabases

      public io.smallrye.mutiny.Multi<org.bson.Document> listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases as a stream.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      Returns:
      the stream of database descriptors, empty if none.
    • listDatabases

      public io.smallrye.mutiny.Multi<org.bson.Document> listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, DatabaseListOptions options)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases as a stream.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      options - the stream options
      Returns:
      the stream of database descriptors, empty if none.
    • listDatabases

      public <T> io.smallrye.mutiny.Multi<T> listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Type Parameters:
      T - the type of the class to use instead of Document.
      Parameters:
      clientSession - the client session with which to associate this operation
      clazz - the class to cast the database documents to
      Returns:
      the stream of database descriptors
    • listDatabases

      public <T> io.smallrye.mutiny.Multi<T> listDatabases(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz, DatabaseListOptions options)
      Description copied from interface: ReactiveMongoClient
      Gets the list of databases.
      Specified by:
      listDatabases in interface ReactiveMongoClient
      Type Parameters:
      T - the type of the class to use instead of Document.
      Parameters:
      clientSession - the client session with which to associate this operation
      clazz - the class to cast the database documents to
      options - the stream options
      Returns:
      the stream of database descriptors
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch()
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clazz - the class to decode each document into
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(Class<T> clazz, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clazz - the class to decode each document into
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(List<? extends org.bson.conversions.Bson> pipeline)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      pipeline - the aggregation pipeline to apply to the change stream
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(List<? extends org.bson.conversions.Bson> pipeline, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      pipeline - the aggregation pipeline to apply to the change stream
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      pipeline - the aggregation pipeline to apply to the change stream
      clazz - the class to decode each document into
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      pipeline - the aggregation pipeline to apply to the change stream
      clazz - the class to decode each document into
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clientSession - the client session with which to associate this operation
      clazz - the class to decode each document into
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, Class<T> clazz, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clientSession - the client session with which to associate this operation
      clazz - the class to decode each document into
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      pipeline - the aggregation pipeline to apply to the change stream
      Returns:
      the stream of change stream.
    • watch

      public io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<org.bson.Document>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Parameters:
      clientSession - the client session with which to associate this operation
      pipeline - the aggregation pipeline to apply to the change stream
      options - the stream options
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clientSession - the client session with which to associate this operation
      pipeline - the aggregation pipeline to apply to the change stream
      clazz - the class to decode each document into
      Returns:
      the stream of change stream.
    • watch

      public <T> io.smallrye.mutiny.Multi<com.mongodb.client.model.changestream.ChangeStreamDocument<T>> watch(com.mongodb.reactivestreams.client.ClientSession clientSession, List<? extends org.bson.conversions.Bson> pipeline, Class<T> clazz, ChangeStreamOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a change stream for this client.
      Specified by:
      watch in interface ReactiveMongoClient
      Type Parameters:
      T - the target document type of the iterable.
      Parameters:
      clientSession - the client session with which to associate this operation
      pipeline - the aggregation pipeline to apply to the change stream
      clazz - the class to decode each document into
      options - the stream options
      Returns:
      the stream of change stream.
    • startSession

      public io.smallrye.mutiny.Uni<com.mongodb.reactivestreams.client.ClientSession> startSession()
      Description copied from interface: ReactiveMongoClient
      Creates a client session.
      Specified by:
      startSession in interface ReactiveMongoClient
      Returns:
      a Uni completed when the session is ready to be used.
    • startSession

      public io.smallrye.mutiny.Uni<com.mongodb.reactivestreams.client.ClientSession> startSession(com.mongodb.ClientSessionOptions options)
      Description copied from interface: ReactiveMongoClient
      Creates a client session.
      Specified by:
      startSession in interface ReactiveMongoClient
      Parameters:
      options - the options for the client session
      Returns:
      a Uni completed when the session is ready to be used.
    • unwrap

      public com.mongodb.reactivestreams.client.MongoClient unwrap()
      Specified by:
      unwrap in interface ReactiveMongoClient
      Returns:
      the underlying client.