class NovaLauncher extends Launcher {

  public boolean uploadSshPublicKey(String keyPairName, Nova nova, boolean removeOld) {
    boolean uploadSuccesful;
    FluentIterable<KeyPair> keyPairs = novaContext.getKeyPairApi().list();
    if (keyPairs.isEmpty()) {
      logger.info(String.format("New keypair '%s' is being uploaded to Nova OpenStack", keyPairName));
      novaContext.getKeyPairApi().createWithPublicKey(keyPairName, sshKeyPair.getPublicKey());
      uploadSuccesful = true;
    } else if (removeOld) {
      logger.info(String.format("Removing the old keypair '%s' and uploading the new one ...", keyPairName));
      boolean deleteSuccesful = novaContext.getKeyPairApi().delete(keyPairName);
      KeyPair pair = novaContext.getKeyPairApi().createWithPublicKey(keyPairName, sshKeyPair.getPublicKey());
      uploadSuccesful = deleteSuccesful && pair != null;
    } else {
      uploadSuccesful = false;
    }
    return uploadSuccesful;
  }

  public  NovaLauncher(NovaContext novaContext, SshKeyPair sshKeyPair);

}