/** * Add an incoming transport description (i.e. receiver) to our configuration. * * @param transport TransportInDescription to add. * @throws AxisFault */ public void addTransportIn(TransportInDescription transport) throws AxisFault { if (transport.getReceiver() == null) { throw new AxisFault( "Transport Receiver can not be null for the transport " + transport.getName()); } transportsIn.put(transport.getName(), transport); }
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 TransportInDescription createTransportInDescription() throws Exception { TransportInDescription trpInDesc = new TransportInDescription(name); trpInDesc.setReceiver(listenerClass.newInstance()); return trpInDesc; }
/** * 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); } }
public String getTransportName() { return transportIn.getName(); }
/** * 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 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; }
public TransportListener getTransportListener() { return trpInDesc.getReceiver(); }
public TransportInDescription createTransportInDescription() throws Exception { TransportInDescription desc = new TransportInDescription("http"); desc.setReceiver(new LifecycleFixTransportListenerProxy(new SimpleHTTPServer(), port)); desc.addParameter(new Parameter(SimpleHTTPServer.PARAM_PORT, String.valueOf(port))); return desc; }
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"; } }
Parameter profilePathParam = transportIn.getParameter("dynamicSSLProfilesConfig"); if (transportIn.getParameter("SSLProfiles") != null) { return transportIn; } else { profileParam.setValue(profileEl); transportIn.addParameter(profileParam); log.info("SSLProfile configuration is loaded from path: " + fullPath);
/** * Create a sample synapse message context with a simple payload * * @param payload payload of the envelope of message context * @return Axis2MessageContext with payload and parameters * @throws Exception on creating the context */ private Axis2MessageContext getMessageContext(String payload) throws Exception { Map<String, Entry> properties = new HashMap<>(); Axis2MessageContext messageContext = TestUtils.getAxis2MessageContext(payload, properties); messageContext.getAxis2MessageContext().setTransportIn(new TransportInDescription("http")); return messageContext; }
public TransportDetails getTransportDetails(String transportProtocol) throws AxisFault { TransportInDescription transportIn = getAxisConfig().getTransportIn(transportProtocol); TransportDetails details = new TransportDetails(); List params = new ArrayList(); details.setActive(true); // Transport parameters for (Iterator paramIter = transportIn.getParameters().iterator(); paramIter.hasNext();) { Parameter param = (Parameter) paramIter.next(); TransportParameter paramDO = new TransportParameter(); paramDO.setName(param.getName()); OMElement paramEle = param.getParameterElement(); if (paramEle != null) { paramDO.setValue(paramEle.toString()); } else { paramDO.setValue((String) param.getValue()); } params.add(paramDO); } details.setParameters((TransportParameter[]) params. toArray(new TransportParameter[params.size()])); return details; } }
defaultConnectionFactory.addChild(connectionFactoryName); transportIn.addParameter(new Parameter(JMSConstants.DEFAULT_CONFAC_NAME, defaultConnectionFactory)); } else {
public String getTransportName() { return trpInDesc.getName(); }
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; }
public TransportListener getTransportListener() { return trpInDesc.getReceiver(); }
(TransportListener) service; TransportInDescription txInDes = new TransportInDescription(protocol); txInDes.setReceiver(txListener); String[] keys = reference.getPropertyKeys(); if (keys != null) { String value = (String) propObj; Parameter param = new Parameter(key, value); txInDes.addParameter(param);
/** * 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); } }
/** * Method for return ServerConnectionFactory by building ServerConnectionFactory with given SSL Configurations * * @param endpointName Endpoint Name * @param configuration PassThroughSharedListenerConfiguration * @return ServerConnectionFactory * @throws AxisFault */ public static ServerConnFactory getServerConnectionFactory(String endpointName, PassThroughSharedListenerConfiguration configuration, SSLConfiguration sslConfiguration) throws AxisFault { TransportInDescription transportInDescription = new TransportInDescription(endpointName); HttpHost host = new HttpHost( configuration.getSourceConfiguration().getHostname(), configuration.getSourceConfiguration().getPort(), configuration.getSourceConfiguration().getScheme().getName()); SSLServerConnFactoryBuilder sslServerConnFactoryBuilder = new SSLServerConnFactoryBuilder(transportInDescription, host); return sslServerConnFactoryBuilder. parseSSL(sslConfiguration.getKeyStoreElement(), sslConfiguration.getTrustStoreElement(), sslConfiguration.getClientAuthElement(), sslConfiguration.getHttpsProtocolElement(), sslConfiguration.getSslProtocol(), sslConfiguration.getRevocationVerifierElement(), sslConfiguration.getPreferredCiphersElement()). build(configuration.getSourceConfiguration().getHttpParams()); }