Skip to content

Commit

Permalink
Merge pull request #381 from experdb/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
swbyun authored May 28, 2024
2 parents a124a68 + 7d57b9b commit ee7ef0a
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public ModelAndView keyManageRegReForm(@ModelAttribute("historyVO") HistoryVO hi
JSONObject jsrow = (JSONObject) rows01.get(i);
key.setBinUid(jsrow.get("binuid").toString());
key.setBinStatusCode(jsrow.get("binstatuscode").toString());
key.setValidEndDateTime(jsrow.get("validEndDateTime").toString());
key.setValidEndDateTime(jsrow.get("validEndDateTime").toString()+".999");
param2.add(key.toJSONString());
}
try{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public JSONArray selectSystemStatus(String restIp, int restPort, String strTocke
ArrayList list = (ArrayList) resultJson.get("list");
if(list != null) {
for (int j = 0; j < list.size(); j++) {


JSONObject jsonObj = (JSONObject) list.get(j);

Gson gson = new Gson();
Expand Down Expand Up @@ -102,10 +104,85 @@ public JSONArray selectSystemStatus(String restIp, int restPort, String strTocke
jsonArray.add(jObj);
}

if(targetType.equals("LICENSE") && targetName.equals("LICENSE")){
JSONObject jObj = new JSONObject();
jObj.put("monitoredName", monitoredName);
jObj.put("logMessage", logMessage);
// if(targetType.equals("LICENSE") && targetName.equals("LICENSE")){
// JSONObject jObj = new JSONObject();
// jObj.put("monitoredName", monitoredName);
// jObj.put("logMessage", logMessage);
// jObj.put("status", "licenseCheck");
// jsonArray.add(jObj);
// }

}
}
}else{
JSONObject jObj = new JSONObject();
jObj.put("resultCode", resultCode);
jObj.put("resultMessage", resultMessage);
jsonArray.add(jObj);
}


return jsonArray;
}



public JSONArray selectLicense(String restIp, int restPort, String strTocken, String loginId, String entityId) throws Exception {

JSONObject result = new JSONObject();
JSONArray jsonArray = new JSONArray();

EncryptCommonService api = new EncryptCommonService(restIp, restPort);

String strService = SystemCode.ServiceName.MONITOR_SERVICE;
String strCommand = SystemCode.ServiceCommand.SELECTSYSTEMSTATUS;

SystemStatus param = new SystemStatus();

param.setMonitoredUid(""); //전체


//JSONObject parameters = new JSONObject();
//parameters.put("profile", vo);

HashMap body = new HashMap();
body.put(TypeUtility.getJustClassName(param.getClass()), param.toJSONString());

String parameters = TypeUtility.makeRequestBody(body);

HashMap header = new HashMap();
//header.put(SystemCode.FieldName.LOGIN_ID, loginId);
//header.put(SystemCode.FieldName.ENTITY_UID, entityId);
header.put(SystemCode.FieldName.LOGIN_ID, loginId);
header.put(SystemCode.FieldName.ENTITY_UID, entityId);
header.put(SystemCode.FieldName.TOKEN_VALUE, strTocken);

JSONObject resultJson = api.callService(strService, strCommand, header, parameters);


String resultCode = (String) resultJson.get("resultCode");
String resultMessage = (String) resultJson.get("resultMessage");
resultMessage = new String(resultMessage.getBytes("iso-8859-1"),"UTF-8");

System.out.println("resultCode : " + resultCode + " resultMessage : " + resultMessage);

if(resultCode.equals(SystemCode.ResultCode.SUCCESS)) {

ArrayList list = (ArrayList) resultJson.get("list");
if(list != null) {
for (int j = 0; j < list.size(); j++) {


JSONObject jsonObj = (JSONObject) list.get(j);

Gson gson = new Gson();
SystemStatus systemStatus = new SystemStatus();
systemStatus = gson.fromJson(jsonObj.toJSONString(), systemStatus.getClass());

if(systemStatus.getTargetType().equals("LICENSE") && systemStatus.getTargetName().equals("LICENSE")){
JSONObject jObj = new JSONObject();
jObj.put("monitoredName", systemStatus.getMonitoredName());
jObj.put("logMessage", systemStatus.getLogMessage());
jObj.put("status", "licenseCheck");
jsonArray.add(jObj);
}
Expand All @@ -122,4 +199,5 @@ public JSONArray selectSystemStatus(String restIp, int restPort, String strTocke

return jsonArray;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ public ModelAndView aboutTcontrol(@ModelAttribute("historyVO") HistoryVO history
String entityId = loginVo.getEctityUid();

AgentMonitoringServiceCall amsc = new AgentMonitoringServiceCall();
list = amsc.selectSystemStatus(restIp, restPort, strTocken, loginId, entityId);
list = amsc.selectLicense(restIp, restPort, strTocken, loginId, entityId);
listResult = (List<Map<String, Object>>) list;
for(int i=0; i<listResult.size(); i++){

for(int i=0; i<listResult.size(); i++){
if(listResult.get(i).get("status").equals("licenseCheck")){
license = listResult.get(i).get("logMessage").toString();
System.out.println(license);
Expand Down

0 comments on commit ee7ef0a

Please sign in to comment.