Browse Source

Merge pull request #459 in DESIGN/design from ~JU/design:feature/10.0 to feature/10.0

* commit 'fd7af4ca241001acef3b942cebda94baa15cae82':
  无JIRA任务 屏蔽老的collector
research/10.0
ju 6 years ago
parent
commit
5530131041
  1. 74
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

74
designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

@ -212,43 +212,43 @@ public class InformationCollector implements XMLReadable, XMLWriter {
return; return;
} }
byte[] content = ArrayUtils.EMPTY_BYTE_ARRAY; // byte[] content = ArrayUtils.EMPTY_BYTE_ARRAY;
Connection conn = null; // Connection conn = null;
Table table = new Table(TABLE_NAME); // Table table = new Table(TABLE_NAME);
try { // try {
conn = DBRecordXManager.getDB().createConnection(); // conn = DBRecordXManager.getDB().createConnection();
ResultSet rs = selectAllFromLogDB(conn, table); // ResultSet rs = selectAllFromLogDB(conn, table);
//
if(rs == null){ // if(rs == null){
return; // return;
} // }
content = getFunctionsContentAsByte(rs); // content = getFunctionsContentAsByte(rs);
} catch (Exception e) { // } catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e); // FRContext.getLogger().error(e.getMessage(), e);
} finally { // } finally {
DBUtils.closeConnection(conn); // DBUtils.closeConnection(conn);
} // }
//
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("functions.info")); // HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("functions.info"));
httpClient.setContent(content); // httpClient.setContent(content);
httpClient.setTimeout(5000); // httpClient.setTimeout(5000);
//
if (!httpClient.isServerAlive()) { // if (!httpClient.isServerAlive()) {
return; // return;
} // }
//
String res = httpClient.getResponseText(); // String res = httpClient.getResponseText();
boolean success = false; // boolean success = false;
try { // try {
success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); // success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success");
} catch (JSONException e) { // } catch (JSONException e) {
FRContext.getLogger().error(e.getMessage(), e); // FRContext.getLogger().error(e.getMessage(), e);
} // }
//服务器返回true, 说明已经获取成功, 清空当前记录的信息 // //服务器返回true, 说明已经获取成功, 清空当前记录的信息
if (success) { // if (success) {
deleteLogDB(conn, table); // deleteLogDB(conn, table);
} // }
} }

Loading…
Cancel
Save