> +
> +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);
> + }
@nacx The ServiceType should never be configured independently as you have
described via the ContextBuilder. The only way to access the CDNApi is through
the CloudFilesApi like this:
CloudFilesApi api = ContextBuilder.newBuilder("rackspace-cloudfiles")
.credentials(username, apiKey)
.buildApi(CloudFilesApi.class);
CDNApi cdnApi = api.cdnApiInRegion("DFW");
What else can I do to clarify the intent here? This is similar to how most of
the delegate APIs work today, except it is delegating to a different endpoint.
@zack-shoylev I updated the RegionToCDNEndpoint docs. :)
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/79/files#r10061692