protected NotifyExector(NotifyConfigItem item) { UpdateSettingCore(item); Name = item?.name; Type = item?.type; Filter = item == null || string.IsNullOrWhiteSpace(item.filter) ? null : item.filter.Trim().ToLower(); if (!string.IsNullOrWhiteSpace(Filter)) { if (Filter[0] == '!') { IsDismatchFilter = true; Filter = Filter.Substring(1); } else { IsDismatchFilter = false; } if (!Filter.StartsWith("&")) { Filter = "&" + Filter; } if (!Filter.EndsWith("&")) { Filter = Filter + "&"; } } }
protected override void UpdateSettingCore(NotifyConfigItem item) { mUser = null; mPwd = null; if (item == null || string.IsNullOrWhiteSpace(item.webapi_url)) { mUrl = null; mMethod = null; mTaskTypeId = null; mUser = null; mPwd = null; mArgs = null; mArgsTemplate = null; } else { mUrl = item.webapi_url; mMethod = item.webapi_method; if (string.IsNullOrWhiteSpace(mMethod)) { mMethod = "post"; } mTaskTypeId = item.webapi_bh_tasktypeid; if (ParseArgs4KeyValuePairs(item.args, out mArgs)) { mArgsTemplate = null; } else { mArgs = null; mArgsTemplate = item.args; } string userAndPwd = item.webapi_auth; if (!string.IsNullOrWhiteSpace(userAndPwd)) { string[] strArray = userAndPwd.Trim().Split(":".ToCharArray()); mUser = Common.CustomDecode(strArray[0]); if (strArray.Length > 1) { mPwd = Common.CustomDecode(strArray[1]); } } } }
protected override void UpdateSettingCore(NotifyConfigItem item) { if (item == null || string.IsNullOrWhiteSpace(item.db_connstring)) { mDbAccess = null; mProc = null; mArgs = null; } else { mDbAccess = new ODPDataAccess(Common.CustomDecode(item.db_connstring)); mProc = item.db_proc; if (!ParseArgs4KeyValuePairs(item.args, out mArgs)) { mArgs = null; } } }
internal static NotifyExector GetExector(NotifyConfigItem item) { if (!string.IsNullOrWhiteSpace(item.type)) { switch (item.type) { case OracleDbProcNotifyExector.TypeString: return(new OracleDbProcNotifyExector(item)); case WebapiNotifyExector.TypeString: return(new WebapiNotifyExector(item)); default: break; } } return(null); }
internal WebapiNotifyExector(NotifyConfigItem item) : base(item) { }
internal OracleDbProcNotifyExector(NotifyConfigItem item) : base(item) { }
protected abstract void UpdateSettingCore(NotifyConfigItem item);