Search in sources :

Example 1 with SslClientConfig

use of com.sun.enterprise.config.serverbeans.SslClientConfig in project Payara by payara.

the class IiopServiceSslConfigHandler method create.

@Override
public void create(final CreateSsl command, ActionReport report) {
    IiopService iiopSvc = command.config.getExtensionByType(IiopService.class);
    if (iiopSvc.getSslClientConfig() != null) {
        report.setMessage(localStrings.getLocalString("create.ssl.iiopsvc.alreadyExists", "IIOP Service " + "already has been configured with SSL configuration."));
        report.setActionExitCode(ActionReport.ExitCode.FAILURE);
        return;
    }
    try {
        ConfigSupport.apply(new SingleConfigCode<IiopService>() {

            public Object run(IiopService param) throws PropertyVetoException, TransactionFailure {
                SslClientConfig newSslClientCfg = param.createChild(SslClientConfig.class);
                Ssl newSsl = newSslClientCfg.createChild(Ssl.class);
                command.populateSslElement(newSsl);
                newSslClientCfg.setSsl(newSsl);
                param.setSslClientConfig(newSslClientCfg);
                return newSsl;
            }
        }, iiopSvc);
    } catch (TransactionFailure e) {
        command.reportError(report, e);
    }
    command.reportSuccess(report);
}
Also used : PropertyVetoException(java.beans.PropertyVetoException) TransactionFailure(org.jvnet.hk2.config.TransactionFailure) SslClientConfig(com.sun.enterprise.config.serverbeans.SslClientConfig) IiopService(org.glassfish.orb.admin.config.IiopService) CreateSsl(com.sun.enterprise.admin.commands.CreateSsl) DeleteSsl(com.sun.enterprise.admin.commands.DeleteSsl) Ssl(org.glassfish.grizzly.config.dom.Ssl)

Aggregations

CreateSsl (com.sun.enterprise.admin.commands.CreateSsl)1 DeleteSsl (com.sun.enterprise.admin.commands.DeleteSsl)1 SslClientConfig (com.sun.enterprise.config.serverbeans.SslClientConfig)1 PropertyVetoException (java.beans.PropertyVetoException)1 Ssl (org.glassfish.grizzly.config.dom.Ssl)1 IiopService (org.glassfish.orb.admin.config.IiopService)1 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)1