Package org.tamacat.httpd.monitor

Examples of org.tamacat.httpd.monitor.MonitorConfig


    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


    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

  MonitorConfig getMonitorConfig(ReverseUrl url) {
    String key = url.getServiceUrl().getPath();
    if (key == null) {
      key = "default";
    }
    MonitorConfig config = new MonitorConfig();
    String checkUrl = monitorProps.getProperty(key + ".url");
    URL u = url.getReverse();
    if (checkUrl == null) {
      checkUrl = defaultCheckUrl;
    }
    if (checkUrl.startsWith("http://")==false
      && checkUrl.startsWith("https://")==false) {
      checkUrl = u != null ? u.toString() + checkUrl : checkUrl;
    }
    config.setUrl(checkUrl);
    config.setInterval(StringUtils.parse(
      monitorProps.getProperty(key + ".interval"), defaultInterval)
    );
    config.setTimeout(StringUtils.parse(
      monitorProps.getProperty(key + ".timeout"), defaultTimeout)
    );
    return config;
  }
View Full Code Here

TOP

Related Classes of org.tamacat.httpd.monitor.MonitorConfig

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.