@Override
public void delete(DeleteSsl command, ActionReport report) {
NetworkConfig netConfig = command.config.getNetworkConfig();
NetworkListener networkListener =
netConfig.getNetworkListener(command.listenerId);
if (networkListener == null) {
report.setMessage(
WebContainer.rb.getString(
MessageFormat.format(DELETE_SSL_HTTP_LISTENER_NOT_FOUND, command.listenerId)));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
Protocol protocol = networkListener.findHttpProtocol();
if (protocol.getSsl() == null) {
report.setMessage(
WebContainer.rb.getString(
MessageFormat.format(DELETE_SSL_ELEMENT_DOES_NOT_EXIST, command.listenerId)));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
try {
ConfigSupport.apply(new SingleConfigCode<Protocol>() {
public Object run(Protocol param) {
param.setSsl(null);
return null;
}
}, networkListener.findHttpProtocol());
} catch(TransactionFailure e) {
command.reportError(report, e);
}
}