Examples of utils()


Examples of org.jclouds.Context.utils()

   public void testSocketOpenThrowsUnsupported() {
      Context context = ContextBuilder.newBuilder(forApiOnEndpoint(IntegrationTestClient.class, "dummyurl"))
            .modules(ImmutableSet.of(new GoogleAppEngineConfigurationModule()))
            .build();

      SocketOpen socketOpen = context.utils().injector().getInstance(SocketOpen.class);
      socketOpen.apply(HostAndPort.fromParts("localhost", 22));
   }
}
View Full Code Here

Examples of org.jclouds.abiquo.AbiquoContext.utils()

         HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create(endpoint)).build();

         request = request.toBuilder().replaceHeader(HttpHeaders.AUTHORIZATION, basic(identity, credential)).build();

         // Execute the request and read the generated token
         HttpResponse response = context.utils().http().invoke(request);
         assertEquals(response.getStatusCode(), 200);

         token = readAuthenticationToken(response);
         assertNotNull(token);
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.utils()

   public InputStream getBlobInputStream(BlobStore blobStore, String containerName, String blobName, boolean signedRequest)
         throws Exception {
      if (signedRequest) {
         BlobStoreContext context = blobStore.getContext();
         HttpRequest request = context.getSigner().signGetBlob(containerName, blobName);
         HttpClient httpClient = context.utils().http();
         HttpResponse response = httpClient.invoke(request);
         int statusCode = response.getStatusCode();
         if (statusCode != 200) {
            throw new IOException(response.getStatusLine());
         }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.utils()

      }

      if (signedRequest) {
         BlobStoreContext context = blobStore.getContext();
         HttpRequest request = context.getSigner().signPutBlob(bucket, blob);
         HttpClient httpClient = context.utils().http();
         HttpResponse response = httpClient.invoke(request);
         int statusCode = response.getStatusCode();
         if (statusCode != 200 && statusCode != 201) {
            throw new IOException(response.getStatusLine());
         }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.utils()

   public InputSupplier<InputStream> getBlobInputStream(BlobStore blobStore, String containerName, String blobName, boolean signedRequest)
         throws Exception {
      if (signedRequest) {
         BlobStoreContext context = blobStore.getContext();
         HttpRequest request = context.getSigner().signGetBlob(containerName, blobName);
         HttpClient httpClient = context.utils().http();
         HttpResponse response = httpClient.invoke(request);
         int statusCode = response.getStatusCode();
         if (statusCode != 200) {
            throw new IOException(response.getStatusLine());
         }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStoreContext.utils()

      }

      if (signedRequest) {
         BlobStoreContext context = blobStore.getContext();
         HttpRequest request = context.getSigner().signPutBlob(bucket, blob);
         HttpClient httpClient = context.utils().http();
         HttpResponse response = httpClient.invoke(request);
         int statusCode = response.getStatusCode();
         if (statusCode != 200 && statusCode != 201) {
            throw new IOException(response.getStatusLine());
         }
View Full Code Here

Examples of org.jclouds.cloudstack.CloudStackContext.utils()

      NodeAndInitialCredentials<VirtualMachine> server = adapter.createNodeWithGroupEncodedIntoName("test", "test-e92",
            template);
      assertNotNull(server);
      assertEquals(server.getCredentials(),
                   LoginCredentials.fromCredentials(context.utils().getCredentialStore().get("keypair#" +
                                                                        template.getOptions().
                                                                          as(CloudStackTemplateOptions.class).
                                                                          getKeyPair())));
   }
View Full Code Here

Examples of org.jclouds.cloudstack.CloudStackContext.utils()

      NodeAndInitialCredentials<VirtualMachine> server = adapter.createNodeWithGroupEncodedIntoName("test", "test-e92",
            template);
      assertNotNull(server);
      assertEquals(server.getCredentials(),
                   LoginCredentials.fromCredentials(context.utils().getCredentialStore().get("keypair#" +
                                                                        template.getOptions().
                                                                          as(CloudStackTemplateOptions.class).
                                                                          getKeyPair())));
   }  
  
View Full Code Here

Examples of org.jclouds.compute.ComputeServiceContext.utils()

                                             .overrides(properties);
                                            
      System.out.printf(">> initializing %s%n", builder.getApiMetadata());
      ComputeServiceContext context = builder.buildView(ComputeServiceContext.class);
     
      context.utils().eventBus().register(ScriptLogger.INSTANCE);
      return context.utils().injector().getInstance(MinecraftController.class);
   }

   static enum ScriptLogger {
      INSTANCE;
View Full Code Here

Examples of org.jclouds.compute.ComputeServiceContext.utils()

                                            
      System.out.printf(">> initializing %s%n", builder.getApiMetadata());
      ComputeServiceContext context = builder.buildView(ComputeServiceContext.class);
     
      context.utils().eventBus().register(ScriptLogger.INSTANCE);
      return context.utils().injector().getInstance(MinecraftController.class);
   }

   static enum ScriptLogger {
      INSTANCE;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.