package com.zhiweidata.bjfzxWebapp.conf;

import java.util.Properties;

import com.zhiweidata.bjfzxWebapp.util.PropertiesUtil;

/**
 * 
 * @Description: 数据库配置参数类
 * @author Tou Tang
 * @date 2014-11-14 下午3:02:26
 */

public class EsConfig
{
    public static String es_ip1;
    public static String es_wechat_indexName;
    
    public static String es_wechat_type;
    public static String es_wechat_type1;
    public static String es_wechat_type2;
    public static String es_wechat_type3;
    
    public static String es_weibo_indexName;
    public static String es_weibo_type;
    
    public static String es_meida_indexName;
    public static String es_media_type;

    public static int esPort = 9300;// 9301
    public static int esPort2 = 9301;// 9301

    static
    {
        initProperties("es.properties");
    }

    private static void initProperties(String dbConfigName)
    {
        Properties pro = PropertiesUtil.getProperties(dbConfigName);
        if (null != pro)
        {
            es_ip1 = pro.getProperty("es.ip1");
            esPort = Integer.parseInt(pro.getProperty("es.esPort"));
            esPort2 = Integer.parseInt(pro.getProperty("es.esPort2"));
            
            es_wechat_indexName = pro.getProperty("es.wechat.indexName");
            es_wechat_type = pro.getProperty("es.wechat.type");
            es_wechat_type1 = pro.getProperty("es.wechat.type1");
            es_wechat_type2 = pro.getProperty("es.wechat.type2");
            es_wechat_type3 = pro.getProperty("es.wechat.type3");
            
            es_weibo_indexName = pro.getProperty("es.weibo.indexName");
            es_weibo_type = pro.getProperty("es.weibo.type");
            
            es_meida_indexName = pro.getProperty("es.media.indexName");
            es_media_type = pro.getProperty("es.media.type");
            
        }
    }
}
