Package org.tamacat.httpd.config

Examples of org.tamacat.httpd.config.DefaultReverseUrl


    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setHandlerName("ReverseHandler");
    serviceUrl.setPath("/test2/");
    serviceUrl.setType(ServiceType.REVERSE);
   
    reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/test/"));
    serviceUrl.setReverseUrl(reverseUrl);
    serviceConfig.addServiceUrl(serviceUrl);
   
    url = serviceConfig.getServiceUrl("/test2/");
View Full Code Here


    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setHandlerName("ReverseHandler");
    serviceUrl.setPath("/test2/");
    serviceUrl.setType(ServiceType.REVERSE);
   
    reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/test/"));
    serviceUrl.setReverseUrl(reverseUrl);
    serviceConfig.addServiceUrl(serviceUrl);

    serviceUrl = serviceConfig.getServiceUrl("/test2/");
View Full Code Here

  @Test
  public void testGetMonitorConfigDefault() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    serviceUrl.setPath("/");
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/"));
    MonitorConfig config = url.getMonitorConfig(reverseUrl);
    assertNotNull(config);
    assertEquals("http://localhost:8080/check.html", config.getUrl());
    assertEquals(30000, config.getInterval());
    assertEquals(10000, config.getTimeout());
View Full Code Here

 
  @Test
  public void testGetReverseUrls() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    url.setReverseUrl(reverseUrl);
    assertEquals(1, url.getReverseUrls().size());
  }
View Full Code Here

      fail();
    } catch (ServiceUnavailableException e) {
    }

    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.setReverseUrl(reverseUrl);
    assertNotNull(url.getReverseUrl());
   
    DefaultReverseUrl reverseUrl2 = new DefaultReverseUrl(serviceUrl);
    reverseUrl2.setReverse(new URL("http://192.168.1.12:8080/test/"));
    url.setReverseUrl(reverseUrl2);

    assertEquals("http://192.168.1.11:8080/test/", url.getReverseUrl().getReverse().toString());
    assertEquals("http://192.168.1.12:8080/test/", url.getReverseUrl().getReverse().toString());
    assertEquals("http://192.168.1.11:8080/test/", url.getReverseUrl().getReverse().toString());
View Full Code Here

    } catch (ServiceUnavailableException e) {
      //OK
    }

    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.addTarget(reverseUrl);
    assertNotNull(url.getReverseUrl());
   
    DefaultReverseUrl reverseUrl2 = new DefaultReverseUrl(serviceUrl);
    reverseUrl2.setReverse(new URL("http://192.168.1.12:8080/test/"));
    url.addTarget(reverseUrl2);

    assertEquals("http://192.168.1.11:8080/test/", url.getReverseUrl().getReverse().toString());
    assertEquals("http://192.168.1.12:8080/test/", url.getReverseUrl().getReverse().toString());
    assertEquals("http://192.168.1.11:8080/test/", url.getReverseUrl().getReverse().toString());
View Full Code Here

 
  @Test
  public void testGetMonitorConfig() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    serviceUrl.setPath("/lb/");

    reverseUrl.setReverse(new URL("http://localhost:8080/lb1/"));
    MonitorConfig config = url.getMonitorConfig(reverseUrl);
    assertNotNull(config);
    assertEquals("http://localhost:8080/lb1/test/check.html", config.getUrl());
    assertEquals(60000, config.getInterval());
    assertEquals(15000, config.getTimeout());
View Full Code Here

  public void testStartHealthCheck() throws Exception {
    LbRoundRobinServiceUrl url = new LbRoundRobinServiceUrl(serverConfig);
    url.startHealthCheck();
   
    ServiceUrl serviceUrl = new ServiceUrl(serverConfig);
    DefaultReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://192.168.1.11:8080/test/"));
    url.addTarget(reverseUrl);
   
    url.startHealthCheck();
  }
View Full Code Here

    ServerConfig config = new ServerConfig();
    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setPath("/examples/");
    serviceUrl.setType(ServiceType.REVERSE);
    serviceUrl.setHost(new URL("http://localhost/examples/servlets"));
    ReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/examples/"));
   
    HttpResponse response = new BasicHttpResponse(
        new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 302, "Moved Temporarily"))
    response.setHeader("Location", "http://localhost:8080/examples/servlets/");
    ReverseUtils.rewriteLocationHeader(null, response, reverseUrl);
View Full Code Here

    ServerConfig config = new ServerConfig();
    ServiceUrl serviceUrl = new ServiceUrl(config);
    serviceUrl.setPath("/examples/");
    serviceUrl.setType(ServiceType.REVERSE);
    serviceUrl.setHost(new URL("http://localhost/examples/servlets"));
    ReverseUrl reverseUrl = new DefaultReverseUrl(serviceUrl);
    reverseUrl.setReverse(new URL("http://localhost:8080/examples/"));
   
    HttpResponse response = new BasicHttpResponse(
        new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 302, "Moved Temporarily"))
    response.setHeader("Content-Location", "http://localhost/examples/servlets/");
    ReverseUtils.rewriteContentLocationHeader(null, response, reverseUrl);
View Full Code Here

TOP

Related Classes of org.tamacat.httpd.config.DefaultReverseUrl

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.