> +
> +import com.google.common.base.Function;
> +import com.google.common.base.Supplier;
> +
> +/**
> + * @author Jeremy Daggett
> + */
> +@Singleton
> +public class RegionToCDNEndpoint implements Function<Object, URI> {
> +
> + private final Supplier<Map<String, Supplier<URI>>> endpointsSupplier;
> +
> + @Inject
> + public RegionToCDNEndpoint(@ApiVersion final String apiVersion, final
> RegionIdToURISupplier.Factory factory) {
> + this.endpointsSupplier =
> factory.createForApiTypeAndVersion(ServiceType.OBJECT_CDN, apiVersion);
> + }
Ok, so if I understand properly, users that want to use the "object-storage"
service type must use the parent class factory method to get the ObjectApi, and
users willing to use the "rax:object-cdn" have to use the CloudFilesApi
subclass one (which is actually the same as the third approach as you have two
factory methods, one for each service type).
If this is what you really want, then it is ok for me. But I really don't get
what you were asking for in the email thread :) I understood you were asking
how to support both endpoints in the CloudFilesApi. Sorry for misunderstanding
your email and for the confusion!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/79/files#r10148373