Interface MongoDataSource
- All Superinterfaces:
ServiceType
- Author:
- Clement Escoffier
-
Field Summary
FieldsFields inherited from interface ServiceType
UNKNOWN -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic RecordcreateRecord(String name, JsonObject location, JsonObject metadata) Convenient method to create a record for a Mongo data source.static Future<MongoClient> getMongoClient(ServiceDiscovery discovery, JsonObject filter) Convenient method that looks for a Mongo datasource source and provides the configuredMongoClient.static Future<MongoClient> getMongoClient(ServiceDiscovery discovery, JsonObject filter, JsonObject consumerConfiguration) Convenient method that looks for a Mongo datasource source and provides the configuredMongoClient.static Future<MongoClient> getMongoClient(ServiceDiscovery discovery, Function<Record, Boolean> filter) Convenient method that looks for a Mongo datasource source and provides the configuredMongoClient.Methods inherited from interface ServiceType
get, name
-
Field Details
-
TYPE
- See Also:
-
-
Method Details
-
createRecord
Convenient method to create a record for a Mongo data source.- Parameters:
name- the service namelocation- the location of the service (e.g. url, port...)metadata- additional metadata- Returns:
- the created record
-
getMongoClient
Convenient method that looks for a Mongo datasource source and provides the configuredMongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.- Parameters:
discovery- The service discovery instancefilter- 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 configuredMongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.- Parameters:
discovery- The service discovery instancefilter- 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 configuredMongoClient. The async result is marked as failed is there are no matching services, or if the lookup fails.- Parameters:
discovery- The service discovery instancefilter- The filter, optionalconsumerConfiguration- the consumer configuration- Returns:
- a future notified with the client
-