Search in sources :

Example 16 with IiopService

use of org.glassfish.orb.admin.config.IiopService 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

IiopService (org.glassfish.orb.admin.config.IiopService)16 IiopListener (org.glassfish.orb.admin.config.IiopListener)11 PropertyVetoException (java.beans.PropertyVetoException)6 TransactionFailure (org.jvnet.hk2.config.TransactionFailure)6 Config (com.sun.enterprise.config.serverbeans.Config)4 ParameterMap (org.glassfish.api.admin.ParameterMap)4 PropsFileActionReporter (com.sun.enterprise.admin.report.PropsFileActionReporter)3 ActionReport (org.glassfish.api.ActionReport)3 AdminCommandContextImpl (org.glassfish.api.admin.AdminCommandContextImpl)3 CommandRunner (org.glassfish.api.admin.CommandRunner)3 CommandTarget (org.glassfish.config.support.CommandTarget)3 Target (org.glassfish.internal.api.Target)3 Before (org.junit.Before)3 CreateSsl (com.sun.enterprise.admin.commands.CreateSsl)2 DeleteSsl (com.sun.enterprise.admin.commands.DeleteSsl)2 List (java.util.List)2 NetworkListener (org.glassfish.grizzly.config.dom.NetworkListener)2 Ssl (org.glassfish.grizzly.config.dom.Ssl)2 ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)1 SocketInfo (com.sun.corba.ee.spi.folb.SocketInfo)1