/*
  * Update the task with necessary information when the task is success.
  */
 private void updateSuccessTask(Task task, String vdc, String chefClientname) {
   String piResource =
       MessageFormat.format(
           propertiesProvider.getProperty(CHEF_NODE_BASE_URL), vdc, chefClientname); // the product
   task.setResult(new TaskReference(piResource));
   task.setEndTime(new Date());
   task.setStatus(TaskStates.SUCCESS);
   taskManager.updateTask(task);
 }
 /*
  * Update the task with necessary information when the task is wrong.
  */
 private void updateErrorTask(Task task, String message, Throwable t) {
   TaskError error = new TaskError(message);
   error.setMajorErrorCode(t.getMessage());
   error.setMinorErrorCode(t.getClass().getSimpleName());
   task.setEndTime(new Date());
   task.setStatus(TaskStates.ERROR);
   task.setError(error);
   taskManager.updateTask(task);
   LOGGER.info(
       "An error occurs while deleting a node fromChef Server. See task "
           + task.getHref()
           + "for more information");
 }