updateProps(Ice.IPropertiesAdminPrx cprops, Ice.IPropertiesAdminPrx sprops, UpdateCallbackI callback, Dictionary <string, string> props, string map) { if (sprops.GetConnection() != null) { cprops.SetProperties(getClientProps(cprops, props, map)); sprops.SetProperties(getServerProps(sprops, props, map)); } else { Dictionary <string, string> clientProps = getClientProps(cprops, props, map); Dictionary <string, string> serverProps = getClientProps(sprops, props, map); foreach (KeyValuePair <string, string> p in clientProps) { if (!serverProps.ContainsKey(p.Key)) { serverProps.Add(p.Key, p.Value); } } cprops.SetProperties(serverProps); } callback.waitForUpdate(); }
clearView(Ice.IPropertiesAdminPrx cprops, Ice.IPropertiesAdminPrx sprops, UpdateCallbackI callback) { Dictionary <string, string> dict; dict = cprops.GetPropertiesForPrefix("IceMX.Metrics"); dict["IceMX.Metrics.View.Disabled"] = "1"; cprops.SetProperties(dict); dict = sprops.GetPropertiesForPrefix("IceMX.Metrics"); dict["IceMX.Metrics.View.Disabled"] = "1"; sprops.SetProperties(dict); callback.waitForUpdate(); dict = cprops.GetPropertiesForPrefix("IceMX.Metrics"); dict["IceMX.Metrics.View.Disabled"] = ""; cprops.SetProperties(dict); dict = sprops.GetPropertiesForPrefix("IceMX.Metrics"); dict["IceMX.Metrics.View.Disabled"] = ""; sprops.SetProperties(dict); callback.waitForUpdate(); }
testAttribute(IceMX.IMetricsAdminPrx metrics, Ice.IPropertiesAdminPrx props, UpdateCallbackI update, string map, string attr, string value, System.Action func, TextWriter output) { Dictionary <string, string> dict = new Dictionary <string, string>(); dict.Add("IceMX.Metrics.View.Map." + map + ".GroupBy", attr); if (props.Identity.Category.Equals("client")) { props.SetProperties(getClientProps(props, dict, map)); update.waitForUpdate(); } else { props.SetProperties(getServerProps(props, dict, map)); props.SetProperties(new Dictionary <string, string>()); } func(); Dictionary <string, IceMX.Metrics[]> view = metrics.GetMetricsView("View").ReturnValue; if (!view.ContainsKey(map) || view[map].Length == 0) { if (value.Length > 0) { output.WriteLine("no map `" + map + "' for group by = `" + attr + "'"); test(false); } } else if (!view[map][0].Id.Equals(value)) { output.WriteLine("invalid attribute value: " + attr + " = " + value + " got " + view[map][0].Id); test(false); } dict.Clear(); if (props.Identity.Category.Equals("client")) { props.SetProperties(getClientProps(props, dict, map)); update.waitForUpdate(); } else { props.SetProperties(getServerProps(props, dict, map)); props.SetProperties(new Dictionary <string, string>()); } }