Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.SSLConfigContainer


        public static void getSSLProperties(HandlerContext handlerCtx) {
            String oName = ((String)handlerCtx.getInputValue("Name"));
            ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
            String selectedCiphers = null;
            String type = (String)handlerCtx.getInputValue("Type");
            SSLConfigContainer sslContainerConfig = null;
            boolean ssl3Prop = false;
            boolean ssl2Prop = false;
            boolean tlsProp = false;
            boolean clientAuth = false;
            boolean isEdit = ((Boolean)handlerCtx.getInputValue("Edit")).booleanValue();
            Map sslProps = (Map)handlerCtx.getFacesContext().getExternalContext().getSessionMap().get("sslProps");
            if(isEdit){
                if(type.equals("jmx")){
                    JMXConnectorConfig jmxConfig = config.getAdminServiceConfig().getJMXConnectorConfigMap().get(oName);
                    sslContainerConfig = (SSLConfigContainer)jmxConfig;
                }else if(type.equals("iiop")){
                    IIOPListenerConfig iiopConfig = config.getIIOPServiceConfig().getIIOPListenerConfigMap().get(oName);
                    sslContainerConfig = (SSLConfigContainer)iiopConfig;
                }else if(type.equals("http")){
                    HTTPListenerConfig httpConfig = config.getHTTPServiceConfig().getHTTPListenerConfigMap().get(oName);
                    sslContainerConfig = (SSLConfigContainer)httpConfig;
                }else if(type.equals("nodeagent")){
                    NodeAgentConfig agentConfig = AMXUtil.getDomainConfig().getNodeAgentConfigMap().get(oName);
                    JMXConnectorConfig jmxConfig = agentConfig.getJMXConnectorConfig();
                    sslContainerConfig = (SSLConfigContainer)jmxConfig;
                }
               
                SSLConfig sslConfig = sslContainerConfig.getSSLConfig();
                if(sslConfig != null){
                    clientAuth = sslConfig.getClientAuthEnabled();
                    handlerCtx.setOutputValue("CertNickname", sslConfig.getCertNickname());
                    ssl3Prop = sslConfig.getSSL3Enabled();
                    ssl2Prop = sslConfig.getSSL2Enabled();
View Full Code Here


                String oName = (String)handlerCtx.getInputValue("Name");
                String configName = (String)handlerCtx.getInputValue("ConfigName");
                ConfigConfig config = AMXUtil.getConfig(configName);
                String certNickname = (String)handlerCtx.getInputValue("CertNickname");
                String type = (String)handlerCtx.getInputValue("Type");
                SSLConfigContainer sslContainerConfig = null;
                boolean isEdit = ((Boolean)handlerCtx.getInputValue("Edit")).booleanValue();
                if(isEdit){
                    if(type.equals("jmx")){
                        JMXConnectorConfig jmxConfig = config.getAdminServiceConfig().getJMXConnectorConfigMap().get(oName);
                        sslContainerConfig = (SSLConfigContainer)jmxConfig;
                    }else if(type.equals("iiop")){
                        IIOPListenerConfig iiopConfig = config.getIIOPServiceConfig().getIIOPListenerConfigMap().get(oName);
                        sslContainerConfig = (SSLConfigContainer)iiopConfig;
                    }else if(type.equals("http")){
                        HTTPListenerConfig httpConfig = config.getHTTPServiceConfig().getHTTPListenerConfigMap().get(oName);
                        sslContainerConfig = (SSLConfigContainer)httpConfig;
                    }else if(type.equals("nodeagent")){
                        NodeAgentConfig agentConfig = AMXUtil.getDomainConfig().getNodeAgentConfigMap().get(oName);
                        JMXConnectorConfig jmxConfig = agentConfig.getJMXConnectorConfig();
                        sslContainerConfig = (SSLConfigContainer)jmxConfig;
                    }
                    if((sslContainerConfig != null) && (sslContainerConfig.getSSLConfig() != null)){
                        sslContainerConfig.removeSSLConfig();
                    }
                }else{
                    if(type.equals("iiop")){
                        Map props = (Map) handlerCtx.getFacesContext().getExternalContext().getSessionMap().get("iiopProps");
                        Map options = AMXUtil.convertToPropertiesOptionMap((Map)props.get("options"), null);
                        IIOPListenerConfig iiopConfig = config.getIIOPServiceConfig().createIIOPListenerConfig(
                                (String) props.get("iiopName"),
                                (String) props.get("address"),
                                options);
                        iiopConfig.setPort((String) props.get("port"));
                        iiopConfig.setEnabled((Boolean)props.get("listener"));
                        iiopConfig.setSecurityEnabled((Boolean)props.get("security"));
                        sslContainerConfig = (SSLConfigContainer)iiopConfig;
                    }else if(type.equals("http")){
                        Map props = (Map) handlerCtx.getFacesContext().getExternalContext().getSessionMap().get("httpProps");
                        Map options = AMXUtil.convertToPropertiesOptionMap((Map)props.get("options"), null);
                        int port = Integer.parseInt((String)props.get("port"));
                        String vs = (String) props.get("virtualServer");
                        String httpName = (String) props.get("httpName");
                        String serverName = (String)props.get("serverName");
                        //issue 3714. we need to pass in a String with a space, instead of empty string so backend will take it.
                        //server-name is allowed to be empty. see admin-core/admin/dtds/admin-mbeans-descriptors.xml
                        if (GuiUtil.isEmpty(serverName))serverName = " ";
                       
                        HTTPListenerConfig httpConfig = config.getHTTPServiceConfig().createHTTPListenerConfig(
                                httpName,
                                (String) props.get("address"),
                                port,
                                vs,
                                serverName,
                                options);
                        httpConfig.setEnabled((Boolean)props.get("enabled"));
                        httpConfig.setSecurityEnabled((Boolean)props.get("securityEnabled"));
                        httpConfig.setRedirectPort((String)props.get("redirectPort"));
                        httpConfig.setAcceptorThreads((String)props.get("acceptor-threads"));
                        httpConfig.setXpoweredBy((Boolean)props.get("xpowered-by"));
                        httpConfig.setBlockingEnabled((Boolean)props.get("blocking-enabled"));
                        VirtualServerConfig vsConfig= config.getHTTPServiceConfig().getVirtualServerConfigMap().get(vs);
                        String listeners = vsConfig.getHTTPListeners();
                        if (GuiUtil.isEmpty(listeners))
                            vsConfig.setHTTPListeners(httpName);
                        else
                            vsConfig.setHTTPListeners(listeners+","+httpName);
                        sslContainerConfig = (SSLConfigContainer)httpConfig;
                    }
                }
               
                if((certNickname != null) && (!certNickname.equals(""))){
                    SSLConfig sslConfig = sslContainerConfig.getSSLConfig();
                    if(sslConfig == null){
                        sslConfig = sslContainerConfig.createSSLConfig(certNickname, new HashMap());
                    }else{
                        sslConfig.setCertNickname(certNickname);
                    }
                    sslConfig.setClientAuthEnabled((Boolean)handlerCtx.getInputValue("ClientAuth"));
                    boolean ssl3Prop = ((Boolean)handlerCtx.getInputValue("SSL3Prop")).booleanValue();
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.SSLConfigContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.