use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class TaskRunner method printError.
private void printError() {
if (!isSilentMode()) {
LocalizedMessage message = LocalizedMessage.get(LOC_DR_ERR_TASK_EXECUTE_FAIL);
Console.println(message);
}
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class StringValidator method isStringValid.
public ValidationResult isStringValid(String str, Map props, IStateAccess state) {
ValidationResultStatus validRes = ValidationResultStatus.STATUS_FAILED;
LocalizedMessage returnMessage = null;
if ((str != null) && (str.trim().length() >= 0)) {
returnMessage = LocalizedMessage.get(LOC_VA_MSG_VAL_STR, new Object[] { str });
validRes = ValidationResultStatus.STATUS_SUCCESS;
}
if (validRes.getIntValue() == ValidationResultStatus.INT_STATUS_FAILED) {
returnMessage = LocalizedMessage.get(LOC_VA_WRN_IN_VAL_STR, new Object[] { str });
}
Debug.log("StringValidator : Is string : " + str + " valid ? " + validRes.isSuccessful());
return new ValidationResult(validRes, null, returnMessage);
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class TaskRunner method executeTask.
private boolean executeTask(TaskInfo taskInfo, ITask task, IStateAccess stateAccess) throws InstallAbortException, InstallException {
boolean continueForward = true;
LocalizedMessage message = task.getExecutionMessage(stateAccess, taskInfo.getPropertiesMap());
printMessage(message);
Debug.log("TaskRunner.executeTask() - task: " + taskInfo.getName() + " for class: " + task.getClass().getName());
boolean result = task.execute(taskInfo.getName(), stateAccess, taskInfo.getPropertiesMap());
if (!result) {
// Task Execution failed
printError();
writeLogError(message);
continueForward = promptForUserAction();
if (!continueForward) {
// Need to roll back!
rollBackTask(taskInfo, task, stateAccess);
}
} else {
printDone();
writeLogSuccess(message);
}
return continueForward;
}
Aggregations