io.vertx.servicediscovery.types

## Interface MongoDataSource

- All Superinterfaces:
    ServiceType

      public interface MongoDataSource
      extends ServiceType

  Author:
    Clement Escoffier

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TYPE`

    - ### Fields inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `UNKNOWN`

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Record` | `createRecord(String name, JsonObject location, JsonObject metadata)` Convenient method to create a record for a Mongo data source.
    `static void` | `getMongoClient(ServiceDiscovery discovery, java.util.function.Function<Record,Boolean> filter, Handler<AsyncResult<MongoClient>> resultHandler)` Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`.
    `static void` | `getMongoClient(ServiceDiscovery discovery, JsonObject filter, Handler<AsyncResult<MongoClient>> resultHandler)` Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`.
    `static void` | `getMongoClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration, Handler<AsyncResult<MongoClient>> resultHandler)` Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`.

    - ### Methods inherited from interface io.vertx.servicediscovery.spi.ServiceType

      `get, name`

- - ### Field Detail

    - #### TYPE

          static final String TYPE

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createRecord

          static Record createRecord(String name,
                                     JsonObject location,
                                     JsonObject metadata)

      Convenient method to create a record for a Mongo data source.
      Parameters:
        `name` - the service name
        `location` - the location of the service (e.g. url, port...)
        `metadata` - additional metadata
      Returns:
        the created record

    - #### getMongoClient

          static void getMongoClient(ServiceDiscovery discovery,
                                     JsonObject filter,
                                     Handler<AsyncResult<MongoClient>> resultHandler)

      Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`. The async result is marked as failed is there are no matching services, or if the lookup fails.
      Parameters:
        `discovery` - The service discovery instance
        `filter` - The filter, optional
        `resultHandler` - The result handler

    - #### getMongoClient

          static void getMongoClient(ServiceDiscovery discovery,
                                     java.util.function.Function<Record,Boolean> filter,
                                     Handler<AsyncResult<MongoClient>> resultHandler)

      Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`. The async result is marked as failed is there are no matching services, or if the lookup fails.
      Parameters:
        `discovery` - The service discovery instance
        `filter` - The filter
        `resultHandler` - The result handler

    - #### getMongoClient

          static void getMongoClient(ServiceDiscovery discovery,
                                     JsonObject filter,
                                     JsonObject consumerConfiguration,
                                     Handler<AsyncResult<MongoClient>> resultHandler)

      Convenient method that looks for a Mongo datasource source and provides the configured `MongoClient`. The async result is marked as failed is there are no matching services, or if the lookup fails.
      Parameters:
        `discovery` - The service discovery instance
        `filter` - The filter, optional
        `consumerConfiguration` - the consumer configuration
        `resultHandler` - the result handler

Copyright © 2020 Eclipse. All rights reserved.