Interface MongoDataSource

All Superinterfaces:
ServiceType

public interface MongoDataSource extends ServiceType
Author:
Clement Escoffier
  • Field Details

  • Method Details

    • 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 Future<MongoClient> getMongoClient(ServiceDiscovery discovery, JsonObject filter)
      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
      Returns:
      a future notified with the client
    • getMongoClient

      static Future<MongoClient> getMongoClient(ServiceDiscovery discovery, Function<Record,Boolean> filter)
      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
      Returns:
      a future notified with the client
    • getMongoClient

      static Future<MongoClient> getMongoClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration)
      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
      Returns:
      a future notified with the client