private IReadOnlyList <MAImportFlowSet> GetImportFlows() { List <MAImportFlowSet> sets = new List <MAImportFlowSet>(); XmlNode n1 = SyncServer.GetImportAttributeFlows(); if (n1 == null) { return(sets.AsReadOnly()); } foreach (XmlNode n2 in n1.SelectNodes("import-flow-set")) { List <MAImportFlow> flows = new List <MAImportFlow>(); string mvObjectType = n2.SelectSingleNode("@mv-object-type").InnerText; foreach (XmlNode n3 in n2.SelectNodes("import-flows")) { string mvAttribute = n3.SelectSingleNode("@mv-attribute").InnerText; foreach (XmlNode n4 in n3.SelectNodes(string.Format("import-flow[@src-ma='{0}']", this.ID.ToMmsGuid()))) { MAImportFlow f = new MAImportFlow(n4, mvObjectType, mvAttribute); flows.Add(f); } } foreach (IGrouping <string, MAImportFlow> g in flows.GroupBy(t => t.CSObjectType)) { MAImportFlowSet set = new MAImportFlowSet(g.Key, mvObjectType, g.ToList().AsReadOnly()); sets.Add(set); } } return(sets.AsReadOnly()); }
public static void SaveRunHistory(DateTime beforeDate, string filename) { XmlDocument doc = new XmlDocument(); XmlElement parent = doc.CreateElement("execution-histories"); int count = 0; foreach (RunSummary item in SyncServer.GetRunSummary()) { if (!item.StartTime.HasValue || !item.EndTime.HasValue) { continue; } if (item.EndTime < beforeDate) { count++; RunDetails d = SyncServer.GetRunDetail(item); parent.AppendChild(doc.ImportNode(d.XmlNode, true)); } } doc.AppendChild(parent); if (count == 0) { return; } using (XmlWriter w = XmlWriter.Create(filename, new XmlWriterSettings() { Indent = true })) { doc.WriteTo(w); w.Close(); } }
public void Stop() { string result = this.WebService.StopMA(this.ID.ToMmsGuid()); SyncServer.ThrowExceptionOnReturnError(result); }
public static void ClearRunHistory(string filename) { SyncServer.ClearRunHistory(DateTime.UtcNow, filename); }
public static void ClearRunHistory(DateTime clearBeforeDate, string filename) { SyncServer.SaveRunHistory(clearBeforeDate, filename); SyncServer.ClearRunHistory(clearBeforeDate); }
public static RunDetails GetRunDetail(RunSummary summary) { return(SyncServer.GetRunDetail(summary.MAID, summary.RunNumber)); }
public static void ClearRunHistory() { SyncServer.ClearRunHistory(DateTime.UtcNow); }
public static IEnumerable <CSObjectRef> GetCSObjectReferences(this CounterDetail detail) { return(SyncServer.GetStepDetailCSObjectRefs(detail.StepId, detail.XmlNode.Name)); }