Message cont = INFO_ORACLE_ACTION_PROMPT_CONTINUE.get();
Message cancel = INFO_ORACLE_ACTION_PROMPT_CANCEL.get();
if (hasIssues()) {
List<Directive> issues = getIssues();
if (!isSupported()) {
MessageBuilder reason = new MessageBuilder();
if (issues != null) {
for (VersionIssueNotifier.Directive directive : issues) {
LOG.log(Level.INFO, "Unsupported upgrade details: " +
directive.getMessage());
reason.append(directive.getMessage());
reason.append(EOL);
}
}
throw new ApplicationException(
ReturnCode.APPLICATION_ERROR,
INFO_UPGRADE_ORACLE_UNSUPPORTED.get(
currentBuildInfo.toString(),
newBuildInfo.toString(),
reason.toMessage()),
null);
} else {
if (ui != null) {
String lineBreak = ui.isCLI() ?
Constants.LINE_SEPARATOR : Constants.HTML_LINE_BREAK;
for (VersionIssueNotifier.Directive directive : issues) {
Message title;
Message summary;
Message details;
Message defaultAction;
UserInteraction.MessageType msgType;
switch (directive.getType()) {
case ACTION:
title = INFO_GENERAL_ACTION_REQUIRED.get();
summary = INFO_UPGRADE_ORACLE_ACTION.get();
details = new MessageBuilder(directive.getMessage())
.append(lineBreak)
.append(lineBreak)
.append(INFO_ORACLE_ACTION_PROMPT.get())
.toMessage();
msgType = UserInteraction.MessageType.WARNING;
defaultAction = cancel;
break;
case INFO:
title = INFO_GENERAL_INFO.get();
summary = INFO_UPGRADE_ORACLE_INFO.get();
details = new MessageBuilder(directive.getMessage())
.append(lineBreak)
.append(lineBreak)
.append(INFO_ORACLE_INFO_PROMPT.get())
.toMessage();
msgType = UserInteraction.MessageType.INFORMATION;
defaultAction = cont;
break;
case WARNING:
title = INFO_GENERAL_WARNING.get();
summary = INFO_UPGRADE_ORACLE_WARNING.get();
details = new MessageBuilder(directive.getMessage())
.append(lineBreak)
.append(lineBreak)
.append(INFO_ORACLE_INFO_PROMPT.get())
.toMessage();
msgType = UserInteraction.MessageType.WARNING;