|
|
@ -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);
|
|
|
|
} |
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|