Package com.dianping.cat.configuration.client.entity

Examples of com.dianping.cat.configuration.client.entity.Domain


  @BeforeClass
  public static void beforeClass() throws IOException {
    ClientConfig clientConfig = new ClientConfig();

    clientConfig.setMode("client");
    clientConfig.addDomain(new Domain("Test").setEnabled(true));

    File configFile = new File("/data/appdatas/cat/client.xml").getCanonicalFile();

    configFile.getParentFile().mkdirs();
View Full Code Here


  @BeforeClass
  public static void beforeClass() throws IOException {
    ClientConfig clientConfig = new ClientConfig();

    clientConfig.setMode("client");
    clientConfig.addDomain(new Domain("Test").setEnabled(true));

    File configFile = new File("target/client.xml").getCanonicalFile();

    configFile.getParentFile().mkdirs();
View Full Code Here

  protected File getConfigurationFile() {
    try {
      ClientConfig config = new ClientConfig();

      config.setMode("client");
      config.addDomain(new Domain("cat").setMaxMessageSize(8));
      config.addServer(new Server("localhost"));

      File file = new File("target/cat-config.xml");

      Files.forIO().writeTo(file, config.toString());
View Full Code Here

    if (isCatServerAlive()) {
      try {
        ClientConfig config = new ClientConfig();

        config.setMode("client");
        config.addDomain(new Domain("cat"));
        config.addServer(new Server("localhost").setPort(2280));

        File file = new File("target/cat-config.xml");

        Files.forIO().writeTo(file, config.toString());
View Full Code Here

        to.getServers().addAll(from.getServers());
      }

      // only configured domain in client configure will be merged
      for (Domain source : from.getDomains().values()) {
        Domain target = to.findDomain(source.getId());

        if (target == null) {
          target = new Domain(source.getId());
          to.addDomain(target);
        }

        if (to.getDomains().containsKey(source.getId())) {
          objs.push(target);
View Full Code Here

  public ClientConfig getClientConfig() {
    return m_config;
  }

  public Domain getDomain() {
    Domain domain = null;

    if (m_config != null) {
      Map<String, Domain> domains = m_config.getDomains();

      domain = domains.isEmpty() ? null : domains.values().iterator().next();
    }

    if (domain != null) {
      return domain;
    } else {
      return new Domain("UNKNOWN").setEnabled(false);
    }
  }
View Full Code Here

        String appName = prop.getProperty("app.name");

        if (appName != null) {
          ClientConfig config = new ClientConfig();

          config.addDomain(new Domain(appName));
          m_logger.info(String.format("Find domain name %s from app.properties.", appName));
          return config;
        } else {
          m_logger.info(String.format("Can't find app.name from app.properties."));
          return null;
View Full Code Here

TOP

Related Classes of com.dianping.cat.configuration.client.entity.Domain

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.