@Override
public void delete(DeleteSsl command, ActionReport report) {
NetworkConfig netConfig = command.config.getNetworkConfig();
NetworkListener networkListener =
netConfig.getNetworkListener(command.listenerId);
if (networkListener == null) {
report.setMessage(localStrings.getLocalString(
"delete.ssl.http.listener.notfound",
"HTTP Listener named {0} not found", command.listenerId));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
Protocol protocol = networkListener.findHttpProtocol();
if (protocol.getSsl() == null) {
report.setMessage(localStrings.getLocalString(
"delete.ssl.element.doesnotexist", "Ssl element does " +
"not exist for Listener named {0}", 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);
}
}