Search in sources :

Example 71 with LocalizedMessage

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);
    }
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 72 with LocalizedMessage

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);
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 73 with LocalizedMessage

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;
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Aggregations

LocalizedMessage (com.sun.identity.install.tools.util.LocalizedMessage)73 Map (java.util.Map)9 File (java.io.File)8 ArrayList (java.util.ArrayList)8 IOException (java.io.IOException)6 HashMap (java.util.HashMap)5 Iterator (java.util.Iterator)5 ConnectException (java.net.ConnectException)4 UnknownHostException (java.net.UnknownHostException)4 StringTokenizer (java.util.StringTokenizer)4 FileNotFoundException (java.io.FileNotFoundException)3 RESTUtils (com.sun.identity.install.tools.util.RESTUtils)2 BufferedReader (java.io.BufferedReader)2 MalformedURLException (java.net.MalformedURLException)2 URL (java.net.URL)2 URLConnection (java.net.URLConnection)2 TreeMap (java.util.TreeMap)2 Audit (com.sun.identity.install.tools.util.Audit)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1