Search in sources :

Example 66 with LocalizedMessage

use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.

the class ProductInfoHandlerBase method printConsoleMessage.

public void printConsoleMessage(String message, Object[] args) {
    LocalizedMessage lMessage;
    if (args != null) {
        lMessage = LocalizedMessage.get(message, args);
    } else {
        lMessage = LocalizedMessage.get(message);
    }
    Console.println();
    Console.println(lMessage);
    Console.println();
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 67 with LocalizedMessage

use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.

the class ConfigHandlerBase method printConsoleMessage.

protected void printConsoleMessage(String message, Object[] args) {
    LocalizedMessage lMessage;
    if (args != null) {
        lMessage = LocalizedMessage.get(message, args);
    } else {
        lMessage = LocalizedMessage.get(message);
    }
    Console.println();
    Console.println(lMessage);
    Console.println();
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 68 with LocalizedMessage

use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.

the class TaskRunner method writeLogSuccess.

private void writeLogSuccess(LocalizedMessage message1) {
    if (message1 != null) {
        LocalizedMessage message2 = LocalizedMessage.get(LOC_DR_MSG_TASK_EXECUTE_SUCCESS);
        Object[] args = { message1.getMessage(), message2.getMessage() };
        LocalizedMessage combinedMessage = LocalizedMessage.get(LOC_DR_MSG_TASK_LOG_COMBINED_MSG, args);
        logInstall(combinedMessage);
    }
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 69 with LocalizedMessage

use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.

the class TaskRunner method rollBackTask.

private void rollBackTask(TaskInfo taskInfo, ITask task, IStateAccess stateAccess) throws InstallException {
    LocalizedMessage message = task.getRollBackMessage(stateAccess, taskInfo.getPropertiesMap());
    printMessage(message);
    Debug.log("TaskRunner.rollBackTask() - task: " + taskInfo.getName() + " for class: " + task.getClass().getName());
    boolean result = task.rollBack(taskInfo.getName(), stateAccess, taskInfo.getPropertiesMap());
    if (!result) {
        // Task Undo failed
        printError();
        writeLogError(message);
    } else {
        // Task Undo Succeeded
        printDone();
        writeLogSuccess(message);
    }
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 70 with LocalizedMessage

use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.

the class TaskRunner method runTasks.

public void runTasks() throws InstallAbortException, InstallException {
    boolean exitStatus = false;
    boolean continueForward = true;
    int index = 0;
    int taskCount = getTaskInfoList().size();
    Debug.log("TaskRunner.runTasks() - Starting to execute tasks...");
    while (!getTaskInfoList().isEmpty() && !exitStatus) {
        TaskInfo taskInfo = (TaskInfo) getTaskInfoList().get(index);
        String handlerClass = taskInfo.getClassName();
        ITask task = (ITask) getTaskHandlers().get(handlerClass);
        // Set the PersistentStateAccess marker
        PersistentStateAccess stateAccess = getStateAccess();
        markStateAccess(stateAccess, index);
        if (continueForward) {
            // Task Execution in progress
            continueForward = executeTask(taskInfo, task, stateAccess);
        } else {
            // Undo operation in progress
            rollBackTask(taskInfo, task, stateAccess);
        }
        index = (continueForward) ? index + 1 : index - 1;
        if ((index >= taskCount) || (index < 0)) {
            exitStatus = true;
        }
    }
    if (!continueForward) {
        // We have successully done Roll back for all the tasks. So, exit
        Debug.log("TaskRunner.promptForUserAction() - Successfully " + "completed RollBack for all the tasks. Now Exiting..");
        LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_TASK_ABORT_REQUESTED);
        throw new InstallAbortException(message);
    }
}
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