private String getStringParam(String name, String def) { Parameter param = httpConfiguration.getParameter(name); if (param != null) { // assert param.getParameterType() == Parameter.TEXT_PARAMETER; String config = (String) param.getValue(); if (config != null) { return config; } } return def; }
private String getStringParam(String name, String def) { Parameter param = httpConfiguration.getParameter(name); if (param != null) { // assert param.getParameterType() == Parameter.TEXT_PARAMETER; String config = (String) param.getValue(); if (config != null) { return config; } } return def; }
/** * Reload SSL profiles and reset connections * * @param transportInDescription TransportInDescription of the configuration * @throws AxisFault */ public void reloadDynamicSSLConfig(TransportInDescription transportInDescription) throws AxisFault { log.info("HttpCoreNIOListener reloading SSL Config.."); Parameter oldParameter = transportInDescription.getParameter("SSLProfiles"); Parameter profilePathParam = transportInDescription.getParameter("dynamicSSLProfilesConfig"); if (oldParameter != null && profilePathParam != null) { transportInDescription.removeParameter(oldParameter); this.reloadSpecificEndpoints(transportInDescription); } }
/** * Reload SSL configurations from configurations and reset all connections * * @param transportInDescription TransportInDescription of the configuration * @throws AxisFault */ public void reloadDynamicSSLConfig(TransportInDescription transportInDescription) throws AxisFault { log.info("PassThroughHttpListener reloading SSL Config.."); Parameter oldParameter = transportInDescription.getParameter("SSLProfiles"); Parameter profilePathParam = transportInDescription.getParameter("dynamicSSLProfilesConfig"); if (oldParameter != null && profilePathParam != null) { transportInDescription.removeParameter(oldParameter); this.reloadSpecificEndPoints(transportInDescription); } }
public void init(ConfigurationContext configurationContext, TransportInDescription transportInDescription) throws AxisFault { this.configurationContext = configurationContext; this.transportInDescription = transportInDescription; scheme = transportInDescription.getName(); if (!"http".equals(scheme) && !"https".equals(scheme)) { throw new AxisFault(AxisServletListener.class.getName() + " can only be used for http or https"); } Parameter param = transportInDescription.getParameter(PARAM_PORT); if (param != null) { try { port = Integer.parseInt((String) param.getValue()); } catch (NumberFormatException ex) { throw new AxisFault("Invalid port number"); } } else { port = -1; } }
public void init(ConfigurationContext configurationContext, TransportInDescription transportInDescription) throws AxisFault { this.configurationContext = configurationContext; this.transportInDescription = transportInDescription; scheme = transportInDescription.getName(); if (!"http".equals(scheme) && !"https".equals(scheme)) { throw new AxisFault(AxisServletListener.class.getName() + " can only be used for http or https"); } Parameter param = transportInDescription.getParameter(PARAM_PORT); if (param != null) { try { port = Integer.parseInt((String) param.getValue()); } catch (NumberFormatException ex) { throw new AxisFault("Invalid port number"); } } else { port = -1; } }
if(transportInDetails.getParameter(SMSTransportConstents.SYSTEM_TYPE) != null){ smppTransportInDetails.setSystemType((String)transportInDetails.getParameter( SMSTransportConstents.SYSTEM_TYPE).getValue()); if (transportInDetails.getParameter(SMSTransportConstents.SYSTEM_ID) != null) { smppTransportInDetails.setSystemId((String)transportInDetails.getParameter(SMSTransportConstents.SYSTEM_ID). getValue()); } else { if (transportInDetails.getParameter(SMSTransportConstents.PASSWORD) != null) { smppTransportInDetails.setPassword((String)transportInDetails.getParameter(SMSTransportConstents.PASSWORD). getValue()); } else { if(transportInDetails.getParameter(SMSTransportConstents.HOST) != null) { smppTransportInDetails.setHost((String)transportInDetails.getParameter(SMSTransportConstents.HOST). getValue()); if(transportInDetails.getParameter(SMSTransportConstents.PORT) != null) { smppTransportInDetails.setPort(Integer.parseInt((String)transportInDetails.getParameter( SMSTransportConstents.PORT).getValue())); if(transportInDetails.getParameter(SMSTransportConstents.PHONE_NUMBER) != null) { smppTransportInDetails.setPhoneNumber((String)transportInDetails.getParameter( SMSTransportConstents.PHONE_NUMBER).getValue());
try { new Integer(port); trsIn.getParameter("port").setValue(port); } catch (NumberFormatException e) { log.error("Given port is not a valid integer. Using 9000 for port."); trsIn.getParameter("port").setValue("9000"); trsIn.getParameter("port").setValue("9000"); try { new Integer(port); httpsTrsIn.getParameter("port").setValue(port); } catch (NumberFormatException e) { log.error("Given port is not a valid integer. Using 9000 for port."); httpsTrsIn.getParameter("port").setValue("9002"); httpsTrsIn.getParameter("port").setValue("9002");
try { new Integer(port); trsIn.getParameter("port").setValue(port); } catch (NumberFormatException e) { log.error("Given port is not a valid integer. Using 9000 for port."); trsIn.getParameter("port").setValue("9000"); trsIn.getParameter("port").setValue("9000"); try { new Integer(port); httpsTrsIn.getParameter("port").setValue(port); } catch (NumberFormatException e) { log.error("Given port is not a valid integer. Using 9000 for port."); httpsTrsIn.getParameter("port").setValue("9002"); httpsTrsIn.getParameter("port").setValue("9002");
return this; Parameter profileParam = transportIn.getParameter("SSLProfiles"); OMElement profilesEl = profileParam.getParameterElement(); Iterator<?> profiles = profilesEl.getChildrenWithName(new QName("profile")); OMElement httpsProtocolsEl = profileEl.getFirstChildWithName(new QName("HttpsProtocols")); OMElement preferredCiphersEl = profileEl.getFirstChildWithName(new QName(NhttpConstants.PREFERRED_CIPHERS)); final Parameter sslpParameter = transportIn.getParameter("SSLProtocol"); final String sslProtocol = sslpParameter != null ? sslpParameter.getValue().toString() : "TLS"; SSLContextDetails ssl = createSSLContext(keyStoreEl, trustStoreEl, clientAuthEl, httpsProtocolsEl,
public ServerConnFactoryBuilder parseSSL() throws AxisFault { Parameter keyParam = transportIn.getParameter("keystore"); Parameter trustParam = transportIn.getParameter("truststore"); Parameter clientAuthParam = transportIn.getParameter("SSLVerifyClient"); Parameter httpsProtocolsParam = transportIn.getParameter("HttpsProtocols"); final Parameter sslpParameter = transportIn.getParameter("SSLProtocol"); Parameter preferredCiphersParam = transportIn.getParameter(NhttpConstants.PREFERRED_CIPHERS); final String sslProtocol = sslpParameter != null ? sslpParameter.getValue().toString() : "TLS"; OMElement keyStoreEl = keyParam != null ? keyParam.getParameterElement().getFirstElement() : null; OMElement preferredCiphersEl = preferredCiphersParam != null ? preferredCiphersParam.getParameterElement() : null; final Parameter cvp = transportIn.getParameter("CertificateRevocationVerifier"); final String cvEnable = cvp != null ? cvp.getParameterElement().getAttribute(new QName("enable")).getAttributeValue() : null;
/** * init method in TransportListener * * @param axisConf * @param transprtIn * @throws AxisFault */ public void init(ConfigurationContext axisConf, TransportInDescription transprtIn) throws AxisFault { try { this.configurationContext = axisConf; this.trpInDesc = transprtIn; Parameter param = transprtIn.getParameter(PARAM_PORT); if (param != null) { this.port = Integer.parseInt((String) param.getValue()); } if (httpFactory == null) { httpFactory = new HttpFactory(configurationContext, port); } } catch (Exception e1) { throw AxisFault.makeFault(e1); } }
public String reloadSSLProfileConfig() throws AxisFault { Parameter oldParameter = transportInDescription.getParameter("SSLProfiles"); Parameter profilePathParam = transportInDescription.getParameter("SSLProfilesConfigPath"); if(oldParameter!=null && profilePathParam!=null) { transportInDescription.removeParameter(oldParameter); ServerConnFactoryBuilder builder = new ServerConnFactoryBuilder(transportInDescription, null); TransportInDescription loadedTransportIn = builder.loadMultiProfileSSLConfig(); if (loadedTransportIn != null) { transportInDescription=loadedTransportIn; httpCoreNIOMultiSSLListener.reload(transportInDescription); return "SSLProfiles reloaded Successfully"; } //add old value back transportInDescription.addParameter(oldParameter); } return "Failed to reload SSLProfiles"; } }
/** * init method in TransportListener * * @param axisConf * @param transprtIn * @throws AxisFault */ public void init(ConfigurationContext axisConf, TransportInDescription transprtIn) throws AxisFault { try { this.configurationContext = axisConf; this.trpInDesc = transprtIn; Parameter param = transprtIn.getParameter(PARAM_PORT); if (param != null) { this.port = Integer.parseInt((String) param.getValue()); } if (httpFactory == null) { httpFactory = new HttpFactory(configurationContext, port); } } catch (Exception e1) { throw AxisFault.makeFault(e1); } }
Parameter builderClass = transportInDescription.getParameter(SMSTransportConstents.BUILDER_CLASS); Parameter phoneNum = transportInDescription.getParameter(SMSTransportConstents.PHONE_NUMBER); if(phoneNum != null) { this.phoneNumber = (String)phoneNum.getValue();
@Override protected void doInit() throws AxisFault { super.doInit(); try { StandardFileSystemManager fsm = new StandardFileSystemManager(); fsm.setConfiguration(getClass().getClassLoader().getResource("providers.xml")); fsm.init(); this.workerPool = super.workerPool; fsManager = fsm; Parameter lockFlagParam = getTransportInDescription().getParameter(VFSConstants.TRANSPORT_FILE_LOCKING); if (lockFlagParam != null) { String strLockingFlag = lockFlagParam.getValue().toString(); // by-default enabled, if explicitly specified as "disable" make it disable if (VFSConstants.TRANSPORT_FILE_LOCKING_DISABLED.equals(strLockingFlag)) { globalFileLockingFlag = false; } } } catch (FileSystemException e) { handleException("Error initializing the file transport : " + e.getMessage(), e); } }
Parameter hostParameter = inDescription.getParameter(TransportListener.HOST_ADDRESS); if (hostParameter != null) { host = ((String) hostParameter.getValue()).trim(); Parameter param = inDescription.getParameter(PassThroughConstants.WSDL_EPR_PREFIX); if (param != null) { serviceEPRPrefix = getServiceEPRPrefix(configurationContext, (String) param.getValue()); param = inDescription.getParameter(NhttpConstants.HTTP_GET_PROCESSOR); if (param != null && param.getValue() != null) { httpGetRequestProcessor = createHttpGetProcessor(param.getValue().toString());
/** * Initialize the transport description for Axis * * @param transprtInDesc * the transport description * * @throws AxisFault */ public void initTransportListenerForAxis(TransportInDescription transprtInDesc) throws AxisFault { // These values are defined by the component and not by the Axis2 // configuration file so we set them if Axis2 do something with them... Parameter portParam = transprtInDesc.getParameter(PARAM_PORT); if (portParam == null) { int port = getPortForTransport(transprtInDesc.getName()); portParam = new Parameter(PARAM_PORT, Integer.toString(port)); } transprtInDesc.addParameter(portParam); Parameter hostParam = transprtInDesc.getParameter(HOST_ADDRESS); if (hostParam == null) { hostParam = new Parameter(HOST_ADDRESS, this.getHostAddress()); } transprtInDesc.addParameter(hostParam); ((SOAPTransportListener) transprtInDesc.getReceiver()).setServerConfig(this); }
private void addServerIPAndHostEntries() { String hostName = serverConfigurationInformation.getHostName(); String ipAddress = serverConfigurationInformation.getIpAddress(); if (hostName != null && !"".equals(hostName)) { Entry entry = new Entry(SynapseConstants.SERVER_HOST); entry.setValue(hostName); synapseConfiguration.addEntry(SynapseConstants.SERVER_HOST, entry); } if (ipAddress != null && !"".equals(ipAddress)) { Entry entry = new Entry(SynapseConstants.SERVER_IP); entry.setValue(ipAddress); if (synapseConfiguration.getAxisConfiguration().getTransportsIn() != null) { Map<String, TransportInDescription> transportInConfigMap = synapseConfiguration.getAxisConfiguration().getTransportsIn(); if (transportInConfigMap != null) { TransportInDescription transportInDescription = transportInConfigMap.get("http"); if (transportInDescription != null) { Parameter bindAddressParam = transportInDescription.getParameter("bind-address"); if (bindAddressParam != null) { entry.setValue(bindAddressParam.getValue()); } } } } synapseConfiguration.addEntry(SynapseConstants.SERVER_IP, entry); } }
private void addServerIPAndHostEntries() { String hostName = serverConfigurationInformation.getHostName(); String ipAddress = serverConfigurationInformation.getIpAddress(); if (hostName != null && !"".equals(hostName)) { Entry entry = new Entry(SynapseConstants.SERVER_HOST); entry.setValue(hostName); synapseConfiguration.addEntry(SynapseConstants.SERVER_HOST, entry); } if (ipAddress != null && !"".equals(ipAddress)) { Entry entry = new Entry(SynapseConstants.SERVER_IP); entry.setValue(ipAddress); if (synapseConfiguration.getAxisConfiguration().getTransportsIn() != null) { Map<String, TransportInDescription> transportInConfigMap = synapseConfiguration.getAxisConfiguration().getTransportsIn(); if (transportInConfigMap != null) { TransportInDescription transportInDescription = transportInConfigMap.get("http"); if (transportInDescription != null) { Parameter bindAddressParam = transportInDescription.getParameter("bind-address"); if (bindAddressParam != null) { entry.setValue(bindAddressParam.getValue()); } } } } synapseConfiguration.addEntry(SynapseConstants.SERVER_IP, entry); } }