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();