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;
defaultAction = cont;
break;
default:
LOG.log(Level.INFO, "Unexpected issue type " +
directive.getType());
title = Message.EMPTY;
summary = Message.EMPTY;
details = directive.getMessage();
msgType = UserInteraction.MessageType.WARNING;
defaultAction = cont;
}
if (cancel.equals(ui.confirm(
summary,
details,
title,
msgType,
new Message[]{cont, cancel},
defaultAction))) {
throw new ApplicationException(
ReturnCode.CANCELED,
INFO_UPGRADE_CANCELED.get(), null);
}
}
} else {
throw new ApplicationException(
ReturnCode.APPLICATION_ERROR,
INFO_ORACLE_NO_SILENT.get(), null);
}
}
}