protected Job(string name, JobType type, Protocol protocol, JobTime time, JobOutput outp) { InitJob(); this.guid = Guid.NewGuid(); this.name = name; this.type = type; this.prot = protocol; this.outp = outp; this.time = time; this.settings = new JobNotificationSettings(); }
private string GenBrokenRulesText(JobOutput outp, List <JobRule> bRules) { string _buffer = ""; int _count = 0; foreach (JobRule _rule in bRules) { object _data = outp.GetOutputDesc(_rule.outDescName).dataObject; if (_data == null) { _data = (string)"NULL"; } _buffer += "#" + _count + ".) Broken-Rule\n"; _buffer += " -> OutDescriptor: " + _rule.outDescName + "\n"; _buffer += " -> Operation: " + _rule.oper.ToString() + "\n"; _buffer += " -> CompareValue: '" + _rule.compareValue.ToString() + "'\n"; _buffer += " => CurrentValue: '" + _data.ToString() + "'\n\n"; _count++; } return(_buffer); }
public bool CheckRuleValidity(JobOutput outp) { OutputDescriptor _desc = outp.GetOutputDesc(outDescName); if (_desc == null) { throw new Exception("OutputDescriptor '" + outDescName + "' does not exist!"); } if (!IsOperatorSupported(_desc.dataType)) { throw new Exception("OutputDescriptor-Type not supported!"); } if (_desc.dataObject != null) { if (_desc.dataType == typeof(Int32)) { return(CheckValidityInt((Int32)_desc.dataObject)); } else if (_desc.dataType == typeof(long)) { return(CheckValidityLong((long)_desc.dataObject)); } else if (_desc.dataType == typeof(string)) { return(CheckValidityString((string)_desc.dataObject)); } else { return(false); } } else { return(false); } }