class BaseBucketLoader implements BucketLoader {

  @Override
  public Mono<ProposedBucketConfigContext> load(final NodeIdentifier seed, final int port, final String bucket,
                                                final Optional<String> alternateAddress) {
    return core
      .ensureServiceAt(seed, serviceType, port, Optional.of(bucket), alternateAddress)
      .then(ensureServiceConnected(seed, serviceType, Optional.of(bucket)))
      .then(discoverConfig(seed, bucket))
      .map(config -> new String(config, UTF_8))
      .map(config -> config.replace("$HOST", seed.address()))
      .map(config -> new ProposedBucketConfigContext(bucket, config, seed.address()))
      .onErrorResume(ex -> Mono.error(ex instanceof ConfigException
        ? ex
        : new ConfigException("Caught exception while loading config.", ex)
      ));
  }

    BaseBucketLoader(final Core core, final ServiceType serviceType);

}