|
@@ -138,6 +138,12 @@ public class LoadConfigThread extends Thread {
|
|
|
excuteRulesBlackList(file);
|
|
|
excuteUploadMysql(file);
|
|
|
excuteUploadHbase(file);
|
|
|
+
|
|
|
+ /**»ñÈ¡ÏûÏ¢¶ÓÁÐbegin**/
|
|
|
+ executeActiveMQ(file);
|
|
|
+ executeActiveMqPointList(file);
|
|
|
+ /**»ñÈ¡ÏûÏ¢¶ÓÁÐend**/
|
|
|
+
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
// TODO Auto-generated catch block
|
|
@@ -624,6 +630,90 @@ public class LoadConfigThread extends Thread {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * ¼ÓÔØactiveMQÅäÖÃ
|
|
|
+ */
|
|
|
+ private static void executeActiveMQ(File file) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ int begin = 65535;
|
|
|
+ int end = 65535;
|
|
|
+ Map<String, Integer> pty = new HashMap<String, Integer>();
|
|
|
+ // Map<Integer, String> ptyValue = new HashMap<Integer, String>();
|
|
|
+
|
|
|
+ Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
|
|
|
+ for (int k = 0; k < excelData.size(); k++) {
|
|
|
+ Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
|
|
|
+ for (int i = 0; i < sheetData.size(); i++) {
|
|
|
+ Map<Integer, String> rowData = sheetData.get(i);
|
|
|
+ if ("ActiveMQ".equalsIgnoreCase(rowData.get(0))) {
|
|
|
+ begin = i;
|
|
|
+ // Constant.info("Db-Hbase begin: " + i);
|
|
|
+ for (int j = 1; j < rowData.size(); j++) {
|
|
|
+ pty.put(rowData.get(j), j);
|
|
|
+ // ptyValue.put(j, rowData.get(j));
|
|
|
+ }
|
|
|
+ } else if ((rowData.get(0).length() > 0) && !("ActiveMQ".equalsIgnoreCase(rowData.get(0)))) {
|
|
|
+ begin = 65535;
|
|
|
+ end = 65535;
|
|
|
+ pty = new HashMap<>();
|
|
|
+ // ptyValue = new HashMap<Integer, String>();
|
|
|
+ // Constant.info("Db-Hbase end: " + i);
|
|
|
+ } else if (i > begin && i < end) {
|
|
|
+ // Constant.info("Db-Hbase add: " + i);
|
|
|
+ if (rowData.get(1) == null || rowData.get(1).length() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ pty = Constant.toLower(pty);
|
|
|
+ Constant.activeMqBrokerUrl = rowData.get(pty.get("broker-url"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * ¼ÓÔØactiveMQÅäÖÃ
|
|
|
+ */
|
|
|
+ private static void executeActiveMqPointList(File file) {
|
|
|
+ int begin = 65535;
|
|
|
+ int end = 65535;
|
|
|
+ Map<String, Integer> pty = new HashMap<String, Integer>();
|
|
|
+
|
|
|
+ Map<Integer, Map<Integer, Map<Integer, String>>> excelData = ExcelUtil.readExcel(file);
|
|
|
+ for (int k = 0; k < excelData.size(); k++) {
|
|
|
+ Map<Integer, Map<Integer, String>> sheetData = excelData.get(k);
|
|
|
+ for (int i = 0; i < sheetData.size(); i++) {
|
|
|
+ Map<Integer, String> rowData = sheetData.get(i);
|
|
|
+ if ("ActiveMQ-PointList".equalsIgnoreCase(rowData.get(0))) {
|
|
|
+ begin = i;
|
|
|
+ // Constant.info("Rules-TransferList begin: " + i);
|
|
|
+ for (int j = 1; j < rowData.size(); j++) {
|
|
|
+ pty.put(rowData.get(j), j);
|
|
|
+ // ptyValue.put(j, rowData.get(j));
|
|
|
+ }
|
|
|
+ } else if ((rowData.get(0).length() > 0) && !("ActiveMQ-PointList".equalsIgnoreCase(rowData.get(0)))) {
|
|
|
+ begin = 65535;
|
|
|
+ end = 65535;
|
|
|
+ pty = new HashMap<String, Integer>();
|
|
|
+ // ptyValue = new HashMap<Integer, String>();
|
|
|
+ // Constant.info("Rules-TransferList end: " + i);
|
|
|
+ } else if (i > begin && i < end) {
|
|
|
+ // Constant.info("Rules-TransferList add: " + i);
|
|
|
+ if (rowData.get(1) == null || rowData.get(1).length() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ pty = Constant.toLower(pty);
|
|
|
+
|
|
|
+ String building = rowData.get(pty.get("building"));
|
|
|
+ String meter = rowData.get(pty.get("meter"));
|
|
|
+ String funcid = rowData.get(pty.get("funcid"));
|
|
|
+
|
|
|
+ Constant.activeMqPointSet.add(building + "-" + meter + "-" + funcid);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* ¼ÓÔØmysqlÅäÖÃ
|
|
|
*/
|
|
|
private static void excuteDbMysql(File file) {
|