Package org.jclouds.ec2.compute.domain

Examples of org.jclouds.ec2.compute.domain.PasswordDataAndPrivateKey


         computeService.destroyNode(node.getId());
         return;
      }

      // Now we can get the password data, decrypt it, and get a LoginCredentials instance
      PasswordDataAndPrivateKey dataAndKey = new PasswordDataAndPrivateKey(
         ec2Client.getWindowsServices().getPasswordDataInRegion(region, node.getProviderId()),
         node.getCredentials().getPrivateKey());
      WindowsLoginCredentialsFromEncryptedData f = context.getUtils().getInjector().getInstance(WindowsLoginCredentialsFromEncryptedData.class);
      LoginCredentials credentials = f.apply(dataAndKey);
View Full Code Here


      PasswordData passwordData = PasswordData.builder()
                                              .instanceId("i-2574e22a")
                                              .timestamp(dateService.iso8601DateParse("2012-07-30T07:27:23.000+0000"))
                                              .passwordData(ENCRYPTED_PASSWORD).build();

      LoginCredentials credentials = f.apply(new PasswordDataAndPrivateKey(passwordData, PRIVATE_KEY));

      assertEquals(credentials.getUser(), "Administrator");
      assertEquals(credentials.getPassword(), "u4.y9mb;nR.");
      assertFalse(credentials.getOptionalPrivateKey().isPresent());
   }
View Full Code Here

      // TODO: parameterize
      Predicate<String> passwordReadyRetryable = retry(passwordReady, 600, 10, SECONDS);

      logger.debug(">> awaiting password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      if (passwordReadyRetryable.apply(instance.getId())) {
         credentials = pwDataToLoginCredentials.apply(new PasswordDataAndPrivateKey(data.get(), privateKey));
         logger.debug("<< obtained password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      } else {
         logger.debug("<< unable to get password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      }
      return credentials;
View Full Code Here

         computeService.destroyNode(node.getId());
         return;
      }

      // Now we can get the password data, decrypt it, and get a LoginCredentials instance
      PasswordDataAndPrivateKey dataAndKey = new PasswordDataAndPrivateKey(
         ec2Client.getWindowsServices().getPasswordDataInRegion(region, node.getProviderId()),
         node.getCredentials().getPrivateKey());
      WindowsLoginCredentialsFromEncryptedData f = context.getUtils().getInjector().getInstance(WindowsLoginCredentialsFromEncryptedData.class);
      LoginCredentials credentials = f.apply(dataAndKey);
View Full Code Here

      PasswordData passwordData = PasswordData.builder()
                                              .instanceId("i-2574e22a")
                                              .timestamp(dateService.iso8601DateParse("2012-07-30T07:27:23.000+0000"))
                                              .passwordData(ENCRYPTED_PASSWORD).build();

      LoginCredentials credentials = f.apply(new PasswordDataAndPrivateKey(passwordData, PRIVATE_KEY));

      assertEquals(credentials.getUser(), "Administrator");
      assertEquals(credentials.getOptionalPassword().get(), "u4.y9mb;nR.");
      assertFalse(credentials.getOptionalPrivateKey().isPresent());
   }
View Full Code Here

      // TODO: parameterize
      Predicate<String> passwordReadyRetryable = retry(passwordReady, 600, 10, SECONDS);

      logger.debug(">> awaiting password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      if (passwordReadyRetryable.apply(instance.getId())) {
         credentials = pwDataToLoginCredentials.apply(new PasswordDataAndPrivateKey(data.get(), privateKey));
         logger.debug("<< obtained password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      } else {
         logger.debug("<< unable to get password data for instance(%s/%s)", instance.getRegion(), instance.getId());
      }
      return credentials;
View Full Code Here

      Location location = getLocationForAvailabilityZoneOrRegion(instance);
      builder.location(location);
      builder.imageId(instance.getRegion() + "/" + instance.getImageId());

      // extract the operating system from the image
      RegionAndName regionAndName = new RegionAndName(instance.getRegion(), instance.getImageId());
      try {
         Image image = imageMap.get().getUnchecked(regionAndName);
         if (image != null)
            builder.operatingSystem(image.getOperatingSystem());
      } catch (CacheLoader.InvalidCacheLoadException e) {
View Full Code Here

      return credentials;
   }

   @VisibleForTesting
   String getPrivateKeyOrNull(RunningInstance instance) {
      KeyPair keyPair = credentialsMap.get(new RegionAndName(instance.getRegion(), instance.getKeyName()));
      return keyPair != null ? keyPair.getKeyMaterial() : null;
   }
View Full Code Here

               logger.debug("<< inUse keyPair(%s), by (%s)", keyPair.getKeyName(), instancesUsingKeyPair);
            } else {
               logger.debug(">> deleting keyPair(%s)", keyPair.getKeyName());
               client.getKeyPairServices().deleteKeyPairInRegion(region, keyPair.getKeyName());
               // TODO: test this clear happens
               credentialsMap.remove(new RegionAndName(region, keyPair.getKeyName()));
               credentialsMap.remove(new RegionAndName(region, group));
               logger.debug("<< deleted keyPair(%s)", keyPair.getKeyName());
            }
         }
      }
   }
View Full Code Here

            } catch (IllegalStateException e) {
               logger.debug("<< inUse incidentalResources(%s)", input);
               return false;
            }
         }
      }, SECONDS.toMillis(3), 50, 1000, MILLISECONDS).apply(new RegionAndName(region, group));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ec2.compute.domain.PasswordDataAndPrivateKey

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.