Search in sources :

Example 21 with ServiceProxyKey

use of com.predic8.membrane.core.rules.ServiceProxyKey in project service-proxy by membrane.

the class MultipleLoadBalancersTest method createBalancingInterceptor.

private LoadBalancingInterceptor createBalancingInterceptor(int port, String name) throws Exception {
    ServiceProxy sp3 = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", port), "thomas-bayer.com", 80);
    LoadBalancingInterceptor balancingInterceptor1 = new LoadBalancingInterceptor();
    balancingInterceptor1.setName(name);
    sp3.getInterceptors().add(balancingInterceptor1);
    balancer.getRuleManager().addProxyAndOpenPortIfNew(sp3);
    balancer.init();
    return balancingInterceptor1;
}
Also used : LoadBalancingInterceptor(com.predic8.membrane.core.interceptor.balancer.LoadBalancingInterceptor) ServiceProxyKey(com.predic8.membrane.core.rules.ServiceProxyKey) ServiceProxy(com.predic8.membrane.core.rules.ServiceProxy)

Example 22 with ServiceProxyKey

use of com.predic8.membrane.core.rules.ServiceProxyKey in project service-proxy by membrane.

the class WSDLPublisherTest method before.

@Before
public void before() throws Exception {
    router = new HttpRouter();
    ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", port), "", -1);
    WSDLPublisherInterceptor wi = new WSDLPublisherInterceptor();
    wi.setWsdl(wsdlLocation);
    wi.init(router);
    sp2.getInterceptors().add(wi);
    router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
    router.init();
}
Also used : ServiceProxyKey(com.predic8.membrane.core.rules.ServiceProxyKey) ServiceProxy(com.predic8.membrane.core.rules.ServiceProxy) HttpRouter(com.predic8.membrane.core.HttpRouter) Before(org.junit.Before)

Example 23 with ServiceProxyKey

use of com.predic8.membrane.core.rules.ServiceProxyKey in project service-proxy by membrane.

the class ServiceInvocationTest method createFirstRule.

private ServiceProxy createFirstRule() {
    ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", Request.METHOD_POST, "*", 3016), "thomas-bayer.com", 80);
    rule.setTargetURL("service:log");
    rule.getInterceptors().add(new MockInterceptor("process"));
    return rule;
}
Also used : ServiceProxyKey(com.predic8.membrane.core.rules.ServiceProxyKey) ServiceProxy(com.predic8.membrane.core.rules.ServiceProxy) MockInterceptor(com.predic8.membrane.core.interceptor.MockInterceptor)

Example 24 with ServiceProxyKey

use of com.predic8.membrane.core.rules.ServiceProxyKey in project service-proxy by membrane.

the class RewriteInterceptorIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    interceptor = new RewriteInterceptor();
    interceptor.getMappings().add(new Mapping("/blz-service\\?wsdl", "/axis2/services/BLZService?wsdl", null));
    Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 3006), "thomas-bayer.com", 80);
    rule.getInterceptors().add(interceptor);
    router = new HttpRouter();
    router.getRuleManager().addProxyAndOpenPortIfNew(rule);
}
Also used : Mapping(com.predic8.membrane.core.interceptor.rewrite.RewriteInterceptor.Mapping) Rule(com.predic8.membrane.core.rules.Rule) HttpRouter(com.predic8.membrane.core.HttpRouter)

Example 25 with ServiceProxyKey

use of com.predic8.membrane.core.rules.ServiceProxyKey in project service-proxy by membrane.

the class REST2SOAPInterceptorIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "*", ".*", 3004), "www.thomas-bayer.com", 80);
    router = new HttpRouter();
    router.getRuleManager().addProxyAndOpenPortIfNew(rule);
    REST2SOAPInterceptor rest2SoapInt = new REST2SOAPInterceptor();
    rest2SoapInt.setMappings(getMappings());
    rule.getInterceptors().add(rest2SoapInt);
    router.init();
}
Also used : Rule(com.predic8.membrane.core.rules.Rule) HttpRouter(com.predic8.membrane.core.HttpRouter)

Aggregations

ServiceProxyKey (com.predic8.membrane.core.rules.ServiceProxyKey)35 ServiceProxy (com.predic8.membrane.core.rules.ServiceProxy)34 HttpRouter (com.predic8.membrane.core.HttpRouter)24 Before (org.junit.Before)18 Rule (com.predic8.membrane.core.rules.Rule)14 Exchange (com.predic8.membrane.core.exchange.Exchange)12 AbstractInterceptor (com.predic8.membrane.core.interceptor.AbstractInterceptor)11 Outcome (com.predic8.membrane.core.interceptor.Outcome)11 IOException (java.io.IOException)8 LoadBalancingInterceptor (com.predic8.membrane.core.interceptor.balancer.LoadBalancingInterceptor)3 Mapping (com.predic8.membrane.core.interceptor.rewrite.RewriteInterceptor.Mapping)3 ProxyRule (com.predic8.membrane.core.rules.ProxyRule)3 SSLParser (com.predic8.membrane.core.config.security.SSLParser)2 MockInterceptor (com.predic8.membrane.core.interceptor.MockInterceptor)2 WebServerInterceptor (com.predic8.membrane.core.interceptor.server.WebServerInterceptor)2 ProxyRuleKey (com.predic8.membrane.core.rules.ProxyRuleKey)2 DummyWebServiceInterceptor (com.predic8.membrane.core.services.DummyWebServiceInterceptor)2 HttpClientConfiguration (com.predic8.membrane.core.transport.http.client.HttpClientConfiguration)2 ProxyConfiguration (com.predic8.membrane.core.transport.http.client.ProxyConfiguration)2 MalformedURLException (java.net.MalformedURLException)2