// Path: diamond-utils/src/main/java/com/taobao/diamond/common/Constants.java
// public class Constants {
// 
//     public static final String DEFAULT_GROUP = "DEFAULT_GROUP";
//     
//     public static final String BASE_DIR = "config-data";
// 
//     public static final String DEFAULT_DOMAINNAME = "config.ixiaopu.com";
// 
//     public static final String DAILY_DOMAINNAME = "config.ixiaopu.com";
// 
//     public static final int DEFAULT_PORT = 54321;
// 
//     public static final String NULL = "";
// 
//     public static final String DATAID = "dataId";
// 
//     public static final String GROUP = "group";
// 
//     public static final String LAST_MODIFIED = "Last-Modified";
// 
//     public static final String ACCEPT_ENCODING = "Accept-Encoding";
// 
//     public static final String CONTENT_ENCODING = "Content-Encoding";
// 
//     public static final String PROBE_MODIFY_REQUEST = "Probe-Modify-Request";
// 
//     public static final String PROBE_MODIFY_RESPONSE = "Probe-Modify-Response";
// 
//     public static final String PROBE_MODIFY_RESPONSE_NEW = "Probe-Modify-Response-New";
// 
//     public static final String CONTENT_MD5 = "Content-MD5";
// 
//     public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
// 
//     public static final String SPACING_INTERVAL = "client-spacing-interval";
//     
//     public static final String OPAQUE = "opaque";
// 
//     public static final int POLLING_INTERVAL_TIME = 15;// 秒
// 
//     public static final int ONCE_TIMEOUT = 5000;// 毫秒
// 
//     public static final int CONN_TIMEOUT = 5000;// 毫秒
// 
//     public static final int RECV_WAIT_TIMEOUT = ONCE_TIMEOUT * 5;// 毫秒
//     
//     public static final int CLIENT_CHANNEL_MAX_IDLE_TIME_SECONDS = 120;// 秒
//     
//     public static final int MAX_CONTENT_LENGTH = 1024 * 1024;// 1MB
// 
//     public static final String HTTP_URI_FILE = "/config.co";
//     
//     public static final String HTTP_PROTOCOL_PREFIX = "http://";
// 
//     public static final String CONFIG_HTTP_URI_FILE = "/ServerNodes";
// 
//     public static final String ENCODE = "UTF-8";
//     
//     public static final String LINE_SEPARATOR = Character.toString((char) 1);
// 
//     public static final String WORD_SEPARATOR = Character.toString((char) 2);
//     
//     public static final int SC_OK = 200;
//     public static final int SC_REQUEST_TIMEOUT = 408;
// 
//     /*
//      * 批量操作时, 单条数据的状态码
//      */
//     // 发生异常
//     public static final int BATCH_OP_ERROR = -1;
//     // 查询成功, 数据存在
//     public static final int BATCH_QUERY_EXISTS = 1;
//     // 查询成功, 数据不存在
//     public static final int BATCH_QUERY_NONEXISTS = 2;
//     // 新增成功
//     public static final int BATCH_ADD_SUCCESS = 3;
//     // 更新成功
//     public static final int BATCH_UPDATE_SUCCESS = 4;
// 
// }


import java.io.File;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.taobao.diamond.common.Constants;

/*
 * (C) 2007-2012 Alibaba Group Holding Limited.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * Authors:
 *   leiwen <chrisredfield1985@126.com> , boyan <killme2008@gmail.com>
 */
package com.taobao.diamond.client;





/**
 * Diamond客户端的配置信息
 * 
 * @author aoqiong
 * 
 */
public class DiamondConfigure {

    private volatile int pollingIntervalTime = Constants.POLLING_INTERVAL_TIME;// 异步查询的间隔时间
    private volatile int onceTimeout = Constants.ONCE_TIMEOUT;// 获取对于一个DiamondServer所对应的查询一个DataID对应的配置信息的Timeout时间
    private volatile int receiveWaitTime = Constants.RECV_WAIT_TIMEOUT;// 同步查询一个DataID所花费的时间

    private volatile List<String> domainNameList = new LinkedList<String>();

    private volatile boolean useFlowControl = true;

    private boolean localFirst = false;

    // 以下参数不支持运行后动态更新
    private int maxHostConnections = 1;
    private boolean connectionStaleCheckingEnabled = true;
    private int maxTotalConnections = 20;

// Path: diamond-utils/src/main/java/com/taobao/diamond/common/Constants.java
// public class Constants {
// 
//     public static final String DEFAULT_GROUP = "DEFAULT_GROUP";
//     
//     public static final String BASE_DIR = "config-data";
// 
//     public static final String DEFAULT_DOMAINNAME = "config.ixiaopu.com";
// 
//     public static final String DAILY_DOMAINNAME = "config.ixiaopu.com";
// 
//     public static final int DEFAULT_PORT = 54321;
// 
//     public static final String NULL = "";
// 
//     public static final String DATAID = "dataId";
// 
//     public static final String GROUP = "group";
// 
//     public static final String LAST_MODIFIED = "Last-Modified";
// 
//     public static final String ACCEPT_ENCODING = "Accept-Encoding";
// 
//     public static final String CONTENT_ENCODING = "Content-Encoding";
// 
//     public static final String PROBE_MODIFY_REQUEST = "Probe-Modify-Request";
// 
//     public static final String PROBE_MODIFY_RESPONSE = "Probe-Modify-Response";
// 
//     public static final String PROBE_MODIFY_RESPONSE_NEW = "Probe-Modify-Response-New";
// 
//     public static final String CONTENT_MD5 = "Content-MD5";
// 
//     public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
// 
//     public static final String SPACING_INTERVAL = "client-spacing-interval";
//     
//     public static final String OPAQUE = "opaque";
// 
//     public static final int POLLING_INTERVAL_TIME = 15;// 秒
// 
//     public static final int ONCE_TIMEOUT = 5000;// 毫秒
// 
//     public static final int CONN_TIMEOUT = 5000;// 毫秒
// 
//     public static final int RECV_WAIT_TIMEOUT = ONCE_TIMEOUT * 5;// 毫秒
//     
//     public static final int CLIENT_CHANNEL_MAX_IDLE_TIME_SECONDS = 120;// 秒
//     
//     public static final int MAX_CONTENT_LENGTH = 1024 * 1024;// 1MB
// 
//     public static final String HTTP_URI_FILE = "/config.co";
//     
//     public static final String HTTP_PROTOCOL_PREFIX = "http://";
// 
//     public static final String CONFIG_HTTP_URI_FILE = "/ServerNodes";
// 
//     public static final String ENCODE = "UTF-8";
//     
//     public static final String LINE_SEPARATOR = Character.toString((char) 1);
// 
//     public static final String WORD_SEPARATOR = Character.toString((char) 2);
//     
//     public static final int SC_OK = 200;
//     public static final int SC_REQUEST_TIMEOUT = 408;
// 
//     /*
//      * 批量操作时, 单条数据的状态码
//      */
//     // 发生异常
//     public static final int BATCH_OP_ERROR = -1;
//     // 查询成功, 数据存在
//     public static final int BATCH_QUERY_EXISTS = 1;
//     // 查询成功, 数据不存在
//     public static final int BATCH_QUERY_NONEXISTS = 2;
//     // 新增成功
//     public static final int BATCH_ADD_SUCCESS = 3;
//     // 更新成功
//     public static final int BATCH_UPDATE_SUCCESS = 4;
// 
// }


// Path: diamond-client/src/main/java/com/taobao/diamond/client/DiamondConfigure.java
import java.io.File;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.taobao.diamond.common.Constants;

/*
 * (C) 2007-2012 Alibaba Group Holding Limited.
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 * Authors:
 *   leiwen <chrisredfield1985@126.com> , boyan <killme2008@gmail.com>
 */
package com.taobao.diamond.client;





/**
 * Diamond客户端的配置信息
 * 
 * @author aoqiong
 * 
 */
public class DiamondConfigure {

    private volatile int pollingIntervalTime = Constants.POLLING_INTERVAL_TIME;// 异步查询的间隔时间
    private volatile int onceTimeout = Constants.ONCE_TIMEOUT;// 获取对于一个DiamondServer所对应的查询一个DataID对应的配置信息的Timeout时间
    private volatile int receiveWaitTime = Constants.RECV_WAIT_TIMEOUT;// 同步查询一个DataID所花费的时间

    private volatile List<String> domainNameList = new LinkedList<String>();

    private volatile boolean useFlowControl = true;

    private boolean localFirst = false;

    // 以下参数不支持运行后动态更新
    private int maxHostConnections = 1;
    private boolean connectionStaleCheckingEnabled = true;
    private int maxTotalConnections = 20;

    private int connectionTimeout = Constants.CONN_TIMEOUT;
