コード例 #1
0
  public void callService(
      ProductInstance productInstance,
      VM vm,
      List<Attribute> attributes,
      String action,
      String token)
      throws InstallatorException, NodeExecutionException {

    String process = productInstance.getProductRelease().getProduct().getName();

    String recipe = "";

    if ("install".equals(action)) {
      recipe = recipeNamingGenerator.getInstallRecipe(productInstance);
    } else if ("uninstall".equals(action)) {
      recipe = recipeNamingGenerator.getUninstallRecipe(productInstance);
    } else if ("configure".equals(action)) {
      recipe = recipeNamingGenerator.getConfigureRecipe(productInstance);
    } else if ("deployArtifact".equals(action)) {
      recipe = recipeNamingGenerator.getDeployArtifactRecipe(productInstance);
    } else if ("undeployArtifact".equals(action)) {
      recipe = recipeNamingGenerator.getUnDeployArtifactRecipe(productInstance);
    } else {
      throw new InstallatorException("Missing Action");
    }

    configureNode(vm, attributes, process, recipe, token);
    try {
      log.info("Updating node with recipe " + recipe + " in " + vm.getIp());
      if (isSdcClientInstalled()) {
        executeRecipes(vm);
        // unassignRecipes(vm, recipe);
      } else {
        isRecipeExecuted(vm, process, recipe, token);
        //  unassignRecipes(vm, recipe);
        // eliminate the attribute

      }
    } catch (NodeExecutionException e) {
      // even if execution fails want to unassign the recipe
      throw new NodeExecutionException(e.getMessage());
    }
  }
コード例 #2
0
  @Override
  public void callService(ProductInstance productInstance, String action, String token)
      throws InstallatorException, NodeExecutionException {
    VM vm = productInstance.getVm();
    String recipe = "";
    if ("uninstall".equals(action)) {
      recipe = recipeNamingGenerator.getUninstallRecipe(productInstance);
    } else {

    }

    assignRecipes(vm, recipe, token);
    try {
      executeRecipes(vm);
      // unassignRecipes(vm, recipe);
    } catch (NodeExecutionException e) {
      // unassignRecipes(vm, recipe);
      // even if execution fails want to unassign the recipe
      throw new NodeExecutionException(e.getMessage());
    }
  }