use of org.glassfish.grizzly.config.dom.Ssl in project Payara by payara.
the class ProtocolSslConfigHandler method create.
// ------------------------------------------- Methods from SslConfigHandler
@Override
public void create(final CreateSsl command, final ActionReport report) {
try {
final Protocol protocol = command.findOrCreateProtocol(command.listenerId, false);
if (protocol == null) {
report.setMessage(localStrings.getLocalString("create.ssl.protocol.notfound.fail", "Unable to find protocol {0}.", command.listenerId));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
} else {
ConfigSupport.apply(new SingleConfigCode<Protocol>() {
public Object run(Protocol param) throws TransactionFailure {
Ssl newSsl = param.createChild(Ssl.class);
param.setSecurityEnabled("true");
command.populateSslElement(newSsl);
param.setSsl(newSsl);
return newSsl;
}
}, protocol);
}
} catch (TransactionFailure transactionFailure) {
command.reportError(report, transactionFailure);
return;
}
command.reportSuccess(report);
}
Aggregations