Search in sources :

Example 16 with LocalizedMessage

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

the class TaskRunner method printDone.

private void printDone() {
    if (!isSilentMode()) {
        LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_TASK_EXECUTE_DONE);
        Console.println(message);
    }
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 17 with LocalizedMessage

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

the class TaskRunner method writeLogError.

private void writeLogError(LocalizedMessage message1) {
    if (message1 != null) {
        LocalizedMessage message2 = LocalizedMessage.get(LOC_DR_ERR_TASK_EXECUTE_FAIL);
        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 18 with LocalizedMessage

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

the class Driver method writeVersionInfoToLog.

public void writeVersionInfoToLog(InstallLogger installLog, String descriptionLocKey, String descrptionFmtLineLocKey) {
    BufferedReader br = null;
    try {
        InputStream is = this.getClass().getResourceAsStream(STR_VERSION_FILE_NAME);
        br = new BufferedReader(new InputStreamReader(is));
        String line = null;
        // First write the headers
        Object[] formatArgs = { STR_BEGIN_END_LINE_MARKER };
        LocalizedMessage formatMessage = LocalizedMessage.get(LOC_DR_MSG_VERSION_INFO, formatArgs);
        LocalizedMessage descriptionMsg = LocalizedMessage.get(descriptionLocKey);
        LocalizedMessage descriptionFmtLineMsg = LocalizedMessage.get(descrptionFmtLineLocKey);
        installLog.getLogger().log(formatMessage);
        installLog.getLogger().log(descriptionMsg);
        installLog.getLogger().log(descriptionFmtLineMsg);
        while ((line = br.readLine()) != null) {
            // Print only the non hashed lines
            if (!line.startsWith("#")) {
                Object[] args = { line };
                LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_VERSION_INFO, args);
                installLog.getLogger().log(message);
            }
        }
        installLog.getLogger().log(formatMessage);
    } catch (Exception ex) {
        Debug.log("Driver: An exception occurred while reading " + "version file: ", ex);
    } finally {
        if (br != null) {
            try {
                br.close();
            } catch (IOException io) {
                // Ignore
                Debug.log("Driver: An exception occurred while closing " + "version file stream: ", io);
            }
        }
    }
}
Also used : InputStreamReader(java.io.InputStreamReader) InputStream(java.io.InputStream) BufferedReader(java.io.BufferedReader) IOException(java.io.IOException) IOException(java.io.IOException) LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 19 with LocalizedMessage

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

the class Driver method printConsoleMessageWithMarkers.

/*
     *  Used to print the welcome and exit message for console mode
     */
public void printConsoleMessageWithMarkers(I18NInfo messageInfo) {
    //Only in console mode
    if (!isSilentMode()) {
        LocalizedMessage message = LocalizedMessage.get(messageInfo.getKey(), messageInfo.getGroup());
        Console.println();
        Console.println();
        Console.println(STR_BEGIN_END_LINE_MARKER);
        Console.println(message);
        Console.println(STR_BEGIN_END_LINE_MARKER);
    }
}
Also used : LocalizedMessage(com.sun.identity.install.tools.util.LocalizedMessage)

Example 20 with LocalizedMessage

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

the class Driver method writeSummDispMessToInstLog.

public void writeSummDispMessToInstLog(ArrayList summMessages, InstallLogger installLog) {
    if (summMessages != null && !summMessages.isEmpty()) {
        // Write headers            
        LocalizedMessage headerMsg = LocalizedMessage.get(LOC_DR_MSG_SUMM_INFO_BEGIN);
        LocalizedMessage lineMsg = LocalizedMessage.get(LOC_DR_MSG_SUMM_INFO_BEGIN_LINE);
        installLog.getLogger().logEmptyLine();
        installLog.getLogger().log(headerMsg);
        installLog.getLogger().log(lineMsg);
        // Write Summary
        for (int i = 0; i < summMessages.size(); i++) {
            LocalizedMessage message = (LocalizedMessage) summMessages.get(i);
            if (message != null) {
                installLog.getLogger().log(message);
            }
        }
        installLog.getLogger().logEmptyLine();
    }
}
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