//Gets the receiving urls of each replica, i.e the urls which will send to the each replica private void GetUrlsFrom() { foreach (string operator_id in config.Keys) { ArrayList array; repServices.TryGetValue(operator_id, out array); for (int i = 0; i < array.Count; i++) { RepServices repS = (RepServices)array[i]; RepInfo ri = repS.getRepInfoFromRep(); ArrayList getFrom = getFromUrls(ri.OperatorId); ri.ReceiveInfoUrls = getFrom; repS.updateRepInfo(ri); } } RepInfos.Clear(); foreach (string operator_id in config.Keys) { ArrayList array; repServices.TryGetValue(operator_id, out array); for (int i = 0; i < array.Count; i++) { RepServices repS = (RepServices)array[i]; RepInfo ri = repS.getRepInfoFromRep(); RepInfos.Add(ri); } } }
//Gives the repInfo to each replica private void StartRepInfo() { foreach (string operator_id in config.Keys) { ConfigInfo c; config.TryGetValue(operator_id, out c); ArrayList urls = c.Urls; string url; RepServices repS; ArrayList array; repServices.TryGetValue(operator_id, out array); for (int i = 0; i < array.Count; i++) { repS = (RepServices)array[i]; url = (string)urls[i]; string urlOnly = getIPFromUrl(url); RepInfo info = new RepInfo(c.SourceInput, c.Routing, c.Routing_param, c.Next_routing, c.Next_routing_param, c.Operation, c.OperationParam, getUrlsToSend(operator_id), getPortFromUrl(url), loggingLvl, "tcp://" + GetLocalIPAddress() + ":" + PM_PORT + "/" + PMSERVICE_NAME, urls, url, Semantics, operator_id); repS.updateRepInfo(info); RepInfos.Add(info); } } }