source: branches/2931_OR-Tools_LP_MIP/HeuristicLab.Services.Hive/3.3/DataTransfer/JobState.cs @ 16139

Last change on this file since 16139 was 16139, checked in by ddorfmei, 15 months ago

#2931: Merged [16046-16138/trunk] into branch

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6
7namespace HeuristicLab.Services.Hive.DataTransfer {
8  [Serializable]
9  public enum JobState {
10    /// <summary>
11    /// A job is online as long as he is no other state.
12    /// </summary>
13    Online,
14
15    /// <summary>
16    /// A job is in StatisticsPending if its deletion has been requested,
17    /// but the final generation of statistics hasn't been performed yet.
18    /// </summary>
19    StatisticsPending,
20
21    /// <summary>
22    /// A job is in DeletionPending if its deletion has been requested,
23    /// the final generation of statistics has already been performed,
24    /// but the eventual deletion of the job is still pending.
25    /// </summary>
26    DeletionPending
27  };
28
29  public static class JobStateExtensions {
30    /// <summary>
31    /// This job is online
32    /// </summary>
33    public static bool IsOnline(this JobState jobState) {
34      return jobState == JobState.Online;
35    }
36
37    /// <summary>
38    /// This job is still existent, but already flagged for deletion.
39    /// Usually the flag is set by a user, not a resource or the janitor or something else.
40    /// </summary>
41    public static bool IsFlaggedForDeletion(this JobState jobState) {
42      return jobState == JobState.StatisticsPending || jobState == JobState.DeletionPending;
43    }
44  }
45}
Note: See TracBrowser for help on using the repository browser.