/// <summary>
        /// @see IJobOperator#GetRunningExecutions .
        /// </summary>
        /// <param name="jobName"></param>
        /// <returns></returns>
        /// <exception cref="NoSuchJobException">&nbsp;</exception>
        public ICollection <long?> GetRunningExecutions(string jobName)
        {
            // SLE: OrderedSet is not a ISet: must return a Collection (Interface changed for that purpose)
            ICollection <long?> set = new OrderedSet <long?>();

            foreach (JobExecution jobExecution in JobExplorer.FindRunningJobExecutions(jobName))
            {
                set.Add(jobExecution.Id);
            }
            if (!set.Any() && !JobRegistry.GetJobNames().Contains(jobName))
            {
                throw new NoSuchJobException(string.Format("No such job (either in registry or in historical data): {0}", jobName));
            }
            return(set);
        }
Esempio n. 2
0
        static void GetPowerUnits(int count)
        {
            IEnumerable <Unit> range = unitsByPower.Take(count);

            result.Append("RESULT: ");

            foreach (var unit in range)
            {
                result.AppendFormat("{0}, ", unit);
            }

            if (unitsByPower.Any())
            {
                result.Remove(result.Length - 2, 2);
            }

            result.AppendLine();
        }
 /// <summary>
 /// @see IJobOperator#GetRunningExecutions .
 /// </summary>
 /// <param name="jobName"></param>
 /// <returns></returns>
 /// <exception cref="NoSuchJobException">&nbsp;</exception>
 public ICollection<long?> GetRunningExecutions(string jobName)
 {
     // SLE: OrderedSet is not a ISet: must return a Collection (Interface changed for that purpose)
     ICollection<long?> set = new OrderedSet<long?>();
     foreach (JobExecution jobExecution in JobExplorer.FindRunningJobExecutions(jobName))
     {
         set.Add(jobExecution.Id);
     }
     if (!set.Any() && !JobRegistry.GetJobNames().Contains(jobName))
     {
         throw new NoSuchJobException(string.Format("No such job (either in registry or in historical data): {0}", jobName));
     }
     return set;
 }