Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.Services.Hive/3.3/DataTransfer/JobState.cs @ 16117

Last change on this file since 16117 was 16117, checked in by jkarder, 6 years ago

#2839: merged [15377-16116/branches/2839_HiveProjectManagement] into trunk

File size: 1.4 KB
RevLine 
[15630]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.