Search in sources :

Example 11 with Ssl

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);
}
Also used : TransactionFailure(org.jvnet.hk2.config.TransactionFailure) Protocol(org.glassfish.grizzly.config.dom.Protocol) Ssl(org.glassfish.grizzly.config.dom.Ssl)

Aggregations

Ssl (org.glassfish.grizzly.config.dom.Ssl)11 Protocol (org.glassfish.grizzly.config.dom.Protocol)5 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)5 PropertyVetoException (java.beans.PropertyVetoException)4 NetworkListener (org.glassfish.grizzly.config.dom.NetworkListener)4 CreateSsl (com.sun.enterprise.admin.commands.CreateSsl)3 DeleteSsl (com.sun.enterprise.admin.commands.DeleteSsl)3 NetworkConfig (org.glassfish.grizzly.config.dom.NetworkConfig)3 IiopListener (org.glassfish.orb.admin.config.IiopListener)3 Http (org.glassfish.grizzly.config.dom.Http)2 ThreadPool (org.glassfish.grizzly.config.dom.ThreadPool)2 Transport (org.glassfish.grizzly.config.dom.Transport)2 IiopService (org.glassfish.orb.admin.config.IiopService)2 Acceptor (com.sun.corba.ee.spi.transport.Acceptor)1 AdminService (com.sun.enterprise.config.serverbeans.AdminService)1 Config (com.sun.enterprise.config.serverbeans.Config)1 JmxConnector (com.sun.enterprise.config.serverbeans.JmxConnector)1 MonitoringService (com.sun.enterprise.config.serverbeans.MonitoringService)1 SslClientConfig (com.sun.enterprise.config.serverbeans.SslClientConfig)1 SystemProperty (com.sun.enterprise.config.serverbeans.SystemProperty)1