in src/main/java/com/aliyun/openservices/log/common/CommonConfigInputDetail.java [209:270]
protected void CommonConfigFromJsonObject(JSONObject inputDetail) throws LogException {
try {
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_ADJUSTTIMEZONE)) {
this.adjustTimezone = inputDetail.getBoolean(Consts.CONST_CONFIG_INPUTDETAIL_ADJUSTTIMEZONE);
} else {
this.adjustTimezone = false;
}
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_LOGTIMEZONE)) {
this.logTimezone = inputDetail.getString(Consts.CONST_CONFIG_INPUTDETAIL_LOGTIMEZONE);
} else {
this.logTimezone = "";
}
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_PRIORITY))
this.priority = inputDetail.getIntValue(Consts.CONST_CONFIG_INPUTDETAIL_PRIORITY);
else
this.priority = 0;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_MERGETYPE))
this.mergeType = inputDetail.getString(Consts.CONST_CONFIG_INPUTDETAIL_MERGETYPE);
else
this.mergeType = "topic";
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_SENDRATEEXPIRE))
this.sendRateExpire = inputDetail.getIntValue(Consts.CONST_CONFIG_INPUTDETAIL_SENDRATEEXPIRE);
else
this.sendRateExpire = 0;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_MAXSENDRATE))
this.maxSendRate = inputDetail.getIntValue(Consts.CONST_CONFIG_INPUTDETAIL_MAXSENDRATE);
else
this.maxSendRate = -1;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_LOCALSTORAGE))
this.localStorage = inputDetail.getBoolean(Consts.CONST_CONFIG_INPUTDETAIL_LOCALSTORAGE);
else
this.localStorage = true;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_ENABLETAG))
this.enableTag = inputDetail.getBoolean(Consts.CONST_CONFIG_INPUTDETAIL_ENABLETAG);
else
this.enableTag = false;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_ENABLERAWLOG))
this.enableRawLog = inputDetail.getBoolean(Consts.CONST_CONFIG_INPUTDETAIL_ENABLERAWLOG);
else
this.enableRawLog = false;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_DELAYALARMBYTES))
this.delayAlarmBytes = inputDetail.getLong(Consts.CONST_CONFIG_INPUTDETAIL_DELAYALARMBYTES);
else
this.delayAlarmBytes = 0;
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_FILTERREGEX))
SetFilterRegex(inputDetail.getJSONArray(Consts.CONST_CONFIG_INPUTDETAIL_FILTERREGEX));
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_FILTERKEY))
SetFilterKey(inputDetail.getJSONArray(Consts.CONST_CONFIG_INPUTDETAIL_FILTERKEY));
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_SHARDHASHKEY))
SetShardHashKey(inputDetail.getJSONArray(Consts.CONST_CONFIG_INPUTDETAIL_SHARDHASHKEY));
if (inputDetail.containsKey(Consts.CONST_CONFIG_INPUTDETAIL_SENSITIVEKEYS)) {
JSONArray sensitiveKeysArray = inputDetail.getJSONArray(Consts.CONST_CONFIG_INPUTDETAIL_SENSITIVEKEYS);
for (int index = 0; index < sensitiveKeysArray.size(); index++) {
SensitiveKey sensitiveKey = new SensitiveKey();
sensitiveKey.FromJsonString(sensitiveKeysArray.getJSONObject(index).toString());
sensitiveKeys.add(sensitiveKey);
}
}
} catch (JSONException e) {
throw new LogException("FailToGenerateInputDetail", e.getMessage(), e, "");
}
}