Exemplo n.º 1
0
  @Activate
  public void activate(ClientConfig config) {
    handleIllegalConfiguration(validateClientId(config.clientId()));

    databaseName = config.databaseName();

    // The uriProperty is a single string containing one or more server URIs.
    // When more than one URI is specified, it denotes a replica set and the
    // URIs must be separated by a comma (CSV).

    uris = new ArrayList<String>();
    handleIllegalConfiguration(validateURI(config.uri(), uris));

    MongoClientOptions options = createMongoClientOptions(config);
    mongoClient = createMongoClient(uris, options);
  }