Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Services.Hive/3.3/DataTransfer/JobState.cs @ 17842

Last change on this file since 17842 was 17059, checked in by mkommend, 5 years ago

#2839: Merged 16117, 16122, 16173, 16184, 16185, 16186, 16187, 16202, 16203, 16204, 16205, 16208, 16211, 16209, 16211, 16219, 16257, 16247 into stable.

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.