Example #1
0
 public override void ApplyToSchedulerComponent(SchedulerComponent schedulerComponent)
 {
     if (HasSomethingToDeploy(schedulerComponent))
     {
         RunArasUpdateCmdForComponent(schedulerComponent);
     }
 }
        public override void Connect(IReadOnlyCollection <Component> instanceComponents)
        {
            Logger.Instance.Log(LogLevel.Info, "\nConfiguring component ({0}) to work with component({1}):\n", DatabaseComponentId, SchedulerComponentId);

            DatabaseComponent  databaseComponent  = instanceComponents.Single(c => c.Id == DatabaseComponentId) as DatabaseComponent;
            SchedulerComponent schedulerComponent = instanceComponents.Single(c => c.Id == SchedulerComponentId) as SchedulerComponent;

            XmlDocument innovatorServiceConfig = schedulerComponent.TargetFileSystem.XmlHelper.OpenDocument(schedulerComponent.PathToConfig);

            XmlNodeList innovatorNodes = innovatorServiceConfig.SelectNodes("/innovators/innovator");

            for (int i = 0; i < innovatorNodes.Count; i++)
            {
                XmlNode innovatorNode = innovatorNodes[i];

                XmlNode serverNode   = innovatorNode.SelectSingleNode("server");
                XmlNode databaseNode = innovatorNode.SelectSingleNode("database");
                XmlNode usernameNode = innovatorNode.SelectSingleNode("username");
                XmlNode passwordNode = innovatorNode.SelectSingleNode("password");

                Logger.Instance.Log(LogLevel.Info, "\tSetting the '{0}' value for innovator[{1}]/server node.", databaseComponent.InnovatorUrl, i);

                serverNode.InnerText = databaseComponent.InnovatorUrl;

                Logger.Instance.Log(LogLevel.Info, "\tSetting the '{0}' value for innovator[{1}]/database node.", databaseComponent.DatabaseName, i);

                databaseNode.InnerText = databaseComponent.DatabaseName;

                if (string.Equals(usernameNode.InnerText, "{user}", StringComparison.OrdinalIgnoreCase))
                {
                    Logger.Instance.Log(LogLevel.Info, "\tSetting the '{0}' value for innovator[{1}]/username node.", SchedulerManagerUser, i);

                    usernameNode.InnerText = SchedulerManagerUser;
                }

                if (string.Equals(passwordNode.InnerText, "{password}", StringComparison.OrdinalIgnoreCase))
                {
                    Logger.Instance.Log(LogLevel.Info, "\tSetting the '{0}' value for innovator[{1}]/password node.", SchedulerManagerPassword.Value, i);

                    passwordNode.InnerText = SchedulerManagerPassword.Value;
                }
            }

            schedulerComponent.TargetFileSystem.XmlHelper.SaveXmlDocument(innovatorServiceConfig);
        }
 public static bool Patch_ScheduleLoad(SchedulerComponent __instance, ref ScheduleGraph __result, string path)
 {
     // 取消Dictionary Cache,性能不太可能有问题
     if (string.IsNullOrEmpty(path))
     {
         Heluo.Logger.Log("排程为空", Heluo.Logger.LogLevel.ERROR, "white", "GetScheduleGraph", "C:\\PathOfWuxia\\PathOfWuxia\\Assets\\Scripts\\Features\\SchedulerComponent.cs", 162);
         __result = null;
         return(false);
     }
     try
     {
         ScheduleGraph.Bundle bundle = ModJson.FromJsonResource <ScheduleGraph.Bundle>(path, true);
         __result = new ScheduleGraph(bundle);
     }
     catch
     {
         Heluo.Logger.Log("Path = " + path + " 解析失败", Heluo.Logger.LogLevel.ERROR, "white", "GetScheduleGraph", "C:\\PathOfWuxia\\PathOfWuxia\\Assets\\Scripts\\Features\\SchedulerComponent.cs", 162);
         __result = null;
     }
     return(false);
 }
 public override void ApplyToSchedulerComponent(SchedulerComponent schedulerComponent)
 {
     ApplyToWindowsServiceComponent(schedulerComponent);
 }
Example #5
0
 public abstract void ApplyToSchedulerComponent(SchedulerComponent schedulerComponent);