Examples of toBuilder()


Examples of org.jclouds.domain.LoginCredentials.toBuilder()

      LoginCredentials defaultCredentials = image.getDefaultCredentials();
      String[] keys = defaultCredentials.getPrivateKey().split(":");
      String publicKey = keys[0];
      String privateKey = keys[1];

      LoginCredentials.Builder credentialsBuilder = defaultCredentials.toBuilder();
      credentialsBuilder.privateKey(privateKey);

      // LoginCredentials from image stores the public key along with the private key in the privateKey field
      // @see GoogleComputePopulateDefaultLoginCredentialsForImageStrategy
      // so if options doesn't have a public key set we set it from the default
View Full Code Here

Examples of org.jclouds.domain.LoginCredentials.toBuilder()

      LoginCredentials defaultCredentials = image.getDefaultCredentials();
      String[] keys = defaultCredentials.getPrivateKey().split(":");
      String publicKey = keys[0];
      String privateKey = keys[1];

      LoginCredentials.Builder credentialsBuilder = defaultCredentials.toBuilder();
      credentialsBuilder.privateKey(privateKey);

      // LoginCredentials from image stores the public key along with the private key in the privateKey field
      // @see GoogleComputePopulateDefaultLoginCredentialsForImageStrategy
      // so if options doesn't have a public key set we set it from the default
View Full Code Here

Examples of org.jclouds.domain.LoginCredentials.toBuilder()

      NodeAndInitialCredentials<VApp> from = computeClient.startAndReturnCredentials(URI.create(template.getLocation().getId()), URI.create(template
               .getImage().getId()), name, options, template.getOptions().getInboundPorts());
      LoginCredentials fromNode = from.getCredentials();
      if (credentialStore.containsKey("group#" + group)) {
         fromNode = fromNode == null ? LoginCredentials.fromCredentials(credentialStore.get("group#" + group))
                  : fromNode.toBuilder().privateKey(credentialStore.get("group#" + group).credential).build();
      }
      LoginCredentials creds = prioritizeCredentialsFromTemplate.apply(template, fromNode);
      if (creds != null)
         credentialStore.put("node#" + from.getNodeId(), creds);
      return vAppToNodeMetadata.apply(from.getNode());
View Full Code Here

Examples of org.jclouds.ec2.domain.KeyPair.toBuilder()

      expect(
            strategy.importExistingKeyPair.apply(new RegionNameAndPublicKeyMaterial(region, group,
                  CREDENTIALS.credential))).andReturn(keyPair);
      expect(
            strategy.credentialsMap.put(new RegionAndName(region, group),
                  keyPair.toBuilder().keyMaterial(CREDENTIALS.credential).build())).andReturn(null);

      // replay mocks
      replayStrategy(strategy);

      // run
View Full Code Here

Examples of org.jclouds.elasticstack.ElasticStackApiMetadata.toBuilder()

         ImmutableSet.Builder<Class<? extends Module>> modules = ImmutableSet.builder();
         modules.addAll(apiMedatada.getDefaultModules());
         modules.add(ServerloveImagesModule.class); // Custom image supplier binding

         id("serverlove-z1-man").name("Serverlove Manchester")
               .apiMetadata(apiMedatada.toBuilder().version("2.0").defaultModules(modules.build()).build())
               .homepage(URI.create("http://www.serverlove.com"))
               .console(URI.create("http://www.serverlove.com/accounts"))
               .iso3166Codes("GB-MAN")
               .endpoint("https://api.z1-man.serverlove.com")
               .defaultProperties(ServerloveManchesterProviderMetadata.defaultProperties());
View Full Code Here

Examples of org.jclouds.http.HttpRequest.toBuilder()

      headers.put("X-Ops-Sign", SIGNING_DESCRIPTION);
      request = calculateAndReplaceAuthorizationHeaders(request, toSign);
      headers.put("X-Ops-Timestamp", timestamp);
      utils.logRequest(signatureLog, request, "<<");

      return request.toBuilder().replaceHeaders(headers).build();
   }

   @VisibleForTesting
   HttpRequest calculateAndReplaceAuthorizationHeaders(HttpRequest request, String toSign) throws HttpException {
      String signature = sign(toSign);
View Full Code Here

Examples of org.jclouds.http.HttpRequest.toBuilder()

      headers.put("X-Ops-Sign", SIGNING_DESCRIPTION);
      request = calculateAndReplaceAuthorizationHeaders(request, toSign);
      headers.put("X-Ops-Timestamp", timestamp);
      utils.logRequest(signatureLog, request, "<<");

      return request.toBuilder().replaceHeaders(headers).build();
   }

   @VisibleForTesting
   HttpRequest calculateAndReplaceAuthorizationHeaders(HttpRequest request, String toSign) throws HttpException {
      String signature = sign(toSign);
View Full Code Here

Examples of org.jclouds.http.HttpResponse.toBuilder()

      HttpResponse response = super.invoke(connection);

      byte[] data = closeClientButKeepContentStream(response);
      if (data != null
            && !new String(data).contains("<responseStatus>SUCCESS</responseStatus>")) {
         response = response.toBuilder().statusCode(500).build();
      }

      return response;
   }
}
View Full Code Here

Examples of org.jclouds.http.HttpResponse.toBuilder()

   }

   @Override
   protected HttpResponse invoke(HttpURLConnection connection) throws IOException, InterruptedException {
      HttpResponse original = super.invoke(connection);
      HttpResponse.Builder<?> response = original.toBuilder();

      if (hasPayload(original)) {
         // As we need to read the response body to determine if there are errors, but we may need to process the body
         // again later in the response parsers if everything is OK, we buffer the body into an InputStream we can reset
         InputStream in = null;
View Full Code Here

Examples of org.jclouds.http.HttpResponse.toBuilder()

   }

   @Override
   protected HttpResponse invoke(HttpURLConnection connection) throws IOException, InterruptedException {
      HttpResponse original = super.invoke(connection);
      HttpResponse.Builder<?> response = original.toBuilder();

      if (hasPayload(original)) {
         // As we need to read the response body to determine if there are errors, but we may need to process the body
         // again later in the response parsers if everything is OK, we buffer the body into an InputStream we can reset
         InputStream in = null;
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.