📄 constant.java
字号:
package ffcs.lbp.common;
import java.sql.SQLException;
import ffcs.config.Config;
import ffcs.lbp.dao.SystemCfgDao;
/**
* <p>Title: 小区推送LBP项目</p>
* <p>Description:
* 静态数据
* </p>
* <p>Copyright: 2007 福建福富软件技术股份有限公司 </p>
* <p>Company: 福建福富软件技术股份有限公司</p>
* @author chenxin
* @version $Rev:1.0 $Date: 2007-07-05
*/
public class Constant {
// public static final String SMSC_MODEUL_NAME = "smsc";
// public static final String ISMP_MODEUL_NAME = "ismp";
public static final String LocPrefix_MODEUL_NAME = "LocPrefix";
// public static final String SMPP_MODEUL_NAME = "smpp";
// public static final int EMSE_TYPE_SMSC = 20;//短信中心实体
// public static final int EMSE_TYPE_SMSC_RT = 45;//短信中心收发模块
// public static final int EMSE_TYPE_ISMP = 52;//ismp收发模块
public static final int EMSE_TYPE_LocPrefix= 2;//定位前置模块
// public static final int EMSE_TYPE_SYNCH = 61;//ismp定购关系同步
// public static final int EMSE_TYPE_SMPP = 25;//标准SMPP实体
public static final String ISMP_SRCDEVICETYPE = "SrcDeviceType";//
public static final String ISMP_SRCDEVICEID = "SrcDeviceId";//
public static final String ISMP_DESTDEVICETYPE = "DestDeviceType";//
public static final String ISMP_DESTDEVICEID="DestDeviceId";//
public static final String ISMP_TIMESTAMP="TimeStamp";//
public static final String ISMP_VERSION = "Version"; //
/**
* 以下信息从数据库读取
*/
//告警服务器IP
public static String UDP_ALERT_IP;
// 告警服务器端口
public static int UDP_ALERT_PORT;
//流程追踪,性能监控服务器IP
public static String UDP_SERVER_IP;
//流程追踪请求命令应答端口
public static int UDP_COMAND_PORT;
//流程追踪结果消息端口
public static int UDP_TRACE_PORT;
static SystemCfgDao cfgDao = new SystemCfgDao();
/**
* 从数据库表(cfg_info)更新配置信息
* 如果从数据库读取失败就从配置文件读取
*/
public static void readConfig(){
/*try{
readCfgFromDB();
}catch(Exception sqle){*/
readCfgFromFile();//如果读数据库出错,从配置文件读取
/* sqle.printStackTrace();
}*/
}
/**
* 从数据库读取配置信息
* @throws SQLException
*/
public static void readCfgFromDB()throws SQLException{
UDP_ALERT_IP = cfgDao.getSystemValue("AlarmServer_IP");
UDP_ALERT_PORT = Integer.parseInt(cfgDao.getSystemValue("AlarmServer_Port"));
UDP_SERVER_IP = cfgDao.getSystemValue("UDPServerIP");
UDP_COMAND_PORT= Integer.parseInt(cfgDao.getSystemValue("UDPTracePort"));
UDP_TRACE_PORT = Integer.parseInt(cfgDao.getSystemValue("UDPServerPort"));
}
/**
* 从配置文件读取配置信息
*/
public static void readCfgFromFile(){
UDP_ALERT_IP = Config.getInstance().getGlobalProp("alertHost");
UDP_ALERT_PORT = Integer.parseInt(Config.getInstance().getGlobalProp("alertPort"));
UDP_SERVER_IP = Config.getInstance().getGlobalProp("trace_dest_host");
UDP_COMAND_PORT= Integer.parseInt(Config.getInstance().getGlobalProp("trace_ack_port"));
UDP_TRACE_PORT = Integer.parseInt(Config.getInstance().getGlobalProp("trace_dest_port"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -