Package org.jclouds.apis

Examples of org.jclouds.apis.ApiMetadata


   public AbiquoApiMetadataTest() {
      super(new AbiquoApiMetadata());
   }

   public void testAbiquoApiRegistered() {
      ApiMetadata api = Apis.withId("abiquo");

      assertNotNull(api);
      assertTrue(api instanceof AbiquoApiMetadata);
      assertEquals(api.getId(), "abiquo");
   }
View Full Code Here


         return true;
      // subclass equivalence is ok, since we don't know the classloader
      // we'll get things from
      if (o == null || !(o instanceof ApiMetadata))
         return false;
      ApiMetadata that = ApiMetadata.class.cast(o);
      return equal(this.getId(), that.getId()) && equal(this.getName(), that.getName())
               && equal(this.getViews(), that.getViews());
   }
View Full Code Here

         return true;
      // subclass equivalence is ok, since we don't know the classloader
      // we'll get things from
      if (o == null || !(o instanceof ApiMetadata))
         return false;
      ApiMetadata that = ApiMetadata.class.cast(o);
      return equal(this.getId(), that.getId()) && equal(this.getName(), that.getName())
               && equal(this.getViews(), that.getViews());
   }
View Full Code Here

                                       + provider
                                       + "] is not setup as META-INF/services/org.jclouds.apis.ApiMetadata or META-INF/services/org.jclouds.providers.ProviderMetadata");
         }
      if (builder == null) {
         ProviderMetadata pm = createProviderMetadata();
         ApiMetadata am = (pm != null) ? pm.getApiMetadata() : checkNotNull(createApiMetadata(),
                  "either createApiMetadata or createProviderMetadata must be overridden");

         builder = pm != null ? ContextBuilder.newBuilder(pm) : ContextBuilder.newBuilder(am);
      }
      ApiMetadata am = builder.getApiMetadata();
      if (am instanceof HttpApiMetadata) {
         this.api = HttpApiMetadata.class.cast(am).getApi();
      } else if (am instanceof org.jclouds.rest.RestApiMetadata) {
         this.api = org.jclouds.rest.RestApiMetadata.class.cast(am).getApi();
      } else {
View Full Code Here

   public DockerApiMetadataTest() {
      super(new DockerApiMetadata());
   }

   public void testDockerApiRegistered() {
      ApiMetadata api = Apis.withId("docker");

      assertNotNull(api);
      assertTrue(api instanceof DockerApiMetadata);
      assertEquals(api.getId(), "docker");
   }
View Full Code Here

   public AbiquoApiMetadataTest() {
      super(new AbiquoApiMetadata());
   }

   public void testAbiquoApiRegistered() {
      ApiMetadata api = Apis.withId("abiquo");

      assertNotNull(api);
      assertTrue(api instanceof AbiquoApiMetadata);
      assertEquals(api.getId(), "abiquo");
   }
View Full Code Here

      this.views = views;
   }

   @Test
   public void testWithId() {
      ApiMetadata apiMetadata = Apis.withId(toTest.getId());

      assertEquals(toTest, apiMetadata);
   }
View Full Code Here

   @Test
   public void testExpectedBindingsWhenBuildVersionAbsent() {

      ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
               IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
      ApiMetadata apiMd = md.getApiMetadata().toBuilder().buildVersion(null).build();
      md = md.toBuilder().apiMetadata(apiMd).build();
      Supplier<Credentials> creds = Suppliers.<Credentials> ofInstance(LoginCredentials.builder().user("user").build());

      ExpectedBindings bindings = Guice.createInjector(new BindProviderMetadataContextAndCredentials(md, creds))
               .getInstance(ExpectedBindings.class);
View Full Code Here

   @Override
   public ProviderMetadata apply(Properties input) {
      Properties mutable = new Properties();
      mutable.putAll(input);
      ApiMetadata apiMetadata = this.apiMetadata.toBuilder()
                                    .name(getAndRemove(mutable, PROPERTY_API, this.apiMetadata.getName()))
                                    .version(getAndRemove(mutable, PROPERTY_API_VERSION, this.apiMetadata.getVersion()))
                                    .buildVersion(getAndRemove(mutable, PROPERTY_BUILD_VERSION, this.apiMetadata.getBuildVersion().orNull())).build();

      String endpoint = getAndRemove(mutable, PROPERTY_ENDPOINT, providerMetadata.isPresent() ? providerMetadata.get()
               .getEndpoint() : null);
     
      String providerId = getAndRemove(mutable, PROPERTY_PROVIDER, providerMetadata.isPresent() ? providerMetadata.get()
               .getId() : apiMetadata.getId());
     
      String isoCodes = getAndRemove(mutable, PROPERTY_ISO3166_CODES, providerMetadata.isPresent() ? Joiner.on(',').join(providerMetadata.get()
               .getIso3166Codes()) : "");
     
      ProviderMetadata providerMetadata = this.providerMetadata
View Full Code Here

         return true;
      // subclass equivalence is ok, since we don't know the classloader
      // we'll get things from
      if (o == null || !(o instanceof ApiMetadata))
         return false;
      ApiMetadata that = ApiMetadata.class.cast(o);
      return equal(this.getId(), that.getId()) && equal(this.getName(), that.getName())
               && equal(this.getViews(), that.getViews());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.apis.ApiMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.