Ejemplo n.º 1
0
        public void UpdateService(string serviceName, OverlayData[] addInfo, string[] removeAttr)
        {
            // 0. check if the executing node is the owner of the service
            if (!CheckServiceOwner(serviceName)) {
                return;
            }

            // 1. do remove
            if (removeAttr != null && removeAttr.Any()) {
                RemoveService(serviceName, removeAttr);
            }

            // 2. do add
            if (addInfo != null && addInfo.Any()) {
                // add service name for full info
                addInfo = addInfo.Select(d => new OverlayData(d) { ServiceName = serviceName }).ToArray();
                PutService(addInfo, serviceName, PutStorageBehavior.Update);
            }
        }