Exemple #1
0
        public static string ExecutorCancelPlan()
        {
            BoundCommand bound = new BoundCommand(EXECUTOR_CONTROL_PLAN_CANCEL);

            string result = bound.ToString();

            return(result);
        }
Exemple #2
0
        public static string Register(string name)
        {
            BoundCommand bound = new BoundCommand(SRV_REGISTER)
                                 .BindArgument("clientName", name);
            string result = bound.ToString();

            return(result);
        }
Exemple #3
0
        public static string WrapToRoute(string targetName, string message)
        {
            BoundCommand bound = new BoundCommand(SRV_ROUTE);

            bound.BindArgument <string>("targetName", targetName);
            bound.BindArgument <string>("message", message);
            string result = bound.ToString();

            return(result);
        }
Exemple #4
0
        public static string ServerKillPlan(string planType, Int32 planId)
        {
            if (!IsValidPlanType(planType))
            {
                throw new ArgumentException("Invalid plan type", "planType");
            }

            BoundCommand bound = new BoundCommand(SRV_CONTROL_PLAN_KILL)
                                 .BindArgument("planType", planType)
                                 .BindArgument("planId", planId);

            string result = bound.ToString();

            return(result);
        }
Exemple #5
0
        public static string GuiReportOperationProgress(string planType, Int32 planId, GuiReportPlanProgress progress)
        {
            if (!IsValidPlanType(planType))
            {
                throw new ArgumentException("Invalid plan type", "planType");
            }

            BoundCommand bound = new BoundCommand(GUI_REPORT_PLAN_PROGRESS);

            bound.BindArgument <string>("planType", planType);
            bound.BindArgument <Int32>("planId", planId);
            bound.BindArgument <GuiReportPlanProgress>("progress", progress);

            string result = bound.ToString();

            return(result);
        }
Exemple #6
0
        public static string GuiReportOperationStatus(string planType, Int32 planId, GuiReportPlanStatus report)
        {
            if (!IsValidPlanType(planType))
            {
                throw new ArgumentException("Invalid plan type", "planType");
            }

            BoundCommand bound = new BoundCommand(GUI_REPORT_PLAN_STATUS);

            bound.BindArgument <string>("planType", planType);
            bound.BindArgument <Int32>("planId", planId);
#if true
            bound.BindArgument <GuiReportPlanStatus>("report", report);
#else
            bound.BindArgument <string>("status", status.ToString());

            string startedAtStr = startedAt.HasValue
                                ? startedAt.Value.ToLocalTime().ToString("o") // Convert to ISO (doesn't contain whitespace)
                                : null;
            string lastRunAtStr = lastRunAt.HasValue
                                ? lastRunAt.Value.ToLocalTime().ToString("o") // Convert to ISO (doesn't contain whitespace)
                                : "Never";
            string lastSuccessfulRunAtStr = lastSuccessfulRunAt.HasValue
                                ? lastSuccessfulRunAt.Value.ToLocalTime().ToString("o") // Convert to ISO (doesn't contain whitespace)
                                : "Never";

            string sourcesStr = EncodeString(sources);

            bound.BindArgument <string>("report", startedAtStr);
            bound.BindArgument <string>("lastRunAt", lastRunAtStr);
            bound.BindArgument <string>("lastSuccessfulRunAt", lastSuccessfulRunAtStr);
            bound.BindArgument <string>("scheduleType", scheduleType);
            bound.BindArgument <string>("sources", sourcesStr);
#endif

            string result = bound.ToString();
            return(result);
        }