Class VersionAwareRegionToEndpoint

java.lang.Object
org.jclouds.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint
All Implemented Interfaces:
com.google.common.base.Function<Object,URI>, Function<Object,URI>

public class VersionAwareRegionToEndpoint extends Object implements com.google.common.base.Function<Object,URI>
  • Constructor Details

    • VersionAwareRegionToEndpoint

      @Inject public VersionAwareRegionToEndpoint(com.google.common.base.Supplier<Map<String,com.google.common.base.Supplier<URI>>> regionToEndpointSupplier)
  • Method Details

    • apply

      public URI apply(Object from)
      A quick fix to ensure Neutron works with endpoint definitions that are not version-agnostic. The service-side API will always have a v2.0 in the path. However, the endpoint will sometimes contain a v2.0 and sometimes it will not. The VersionAwareRegionToEndpoint ensures that the endpoint will always look the same before /v2.0 is added to it. Cannot leave labs until fixed: TODO: https://issues.apache.org/jira/browse/JCLOUDS-773 This code will be unnecessary once this is supported.
      Specified by:
      apply in interface com.google.common.base.Function<Object,URI>
      Specified by:
      apply in interface Function<Object,URI>