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);
}
}
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);
}
}
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);
}
}
}
}
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);
}
}
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();
}
}
Aggregations