1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System;
|
---|
23 | using System.Collections.Generic;
|
---|
24 | using System.Linq;
|
---|
25 | using System.Text;
|
---|
26 | using System.Runtime.Serialization;
|
---|
27 | using HeuristicLab.Common;
|
---|
28 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
29 |
|
---|
30 | namespace HeuristicLab.Hive.Contracts.BusinessObjects {
|
---|
31 |
|
---|
32 | public enum State { NullState, Idle, Calculating, Offline, Finished, Abort, RequestSnapshot, RequestSnapshotSent, Pending, Failed };
|
---|
33 | public enum CalendarState { Fetch, ForceFetch, Fetching, Fetched, NotAllowedToFetch };
|
---|
34 |
|
---|
35 | [StorableClass]
|
---|
36 | [DataContract]
|
---|
37 | [Serializable]
|
---|
38 | public class ClientDto : ResourceDto {
|
---|
39 | [Storable]
|
---|
40 | [DataMember]
|
---|
41 | public int NrOfCores { get; set; }
|
---|
42 | [Storable]
|
---|
43 | [DataMember]
|
---|
44 | public int NrOfFreeCores { get; set; }
|
---|
45 | [Storable]
|
---|
46 | [DataMember]
|
---|
47 | public int? CpuSpeedPerCore { get; set; }
|
---|
48 | [Storable]
|
---|
49 | [DataMember]
|
---|
50 | public int Memory { get; set; }
|
---|
51 | [Storable]
|
---|
52 | [DataMember]
|
---|
53 | public int FreeMemory { get; set; }
|
---|
54 | [Storable]
|
---|
55 | [DataMember]
|
---|
56 | public DateTime? Login { get; set; }
|
---|
57 | [Storable]
|
---|
58 | [DataMember]
|
---|
59 | public State State { get; set; }
|
---|
60 | [Storable]
|
---|
61 | [DataMember]
|
---|
62 | public CalendarState CalendarSyncStatus { get; set; }
|
---|
63 | [Storable]
|
---|
64 | [DataMember]
|
---|
65 | public ClientConfigDto Config { get; set; }
|
---|
66 |
|
---|
67 | public override string ToString() {
|
---|
68 | return base.ToString() + ", NrOfCores: " + NrOfCores + ", NrOfFreeCores " + NrOfFreeCores + ", Login: " + Login + ", State: " + State;
|
---|
69 | }
|
---|
70 |
|
---|
71 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
72 | ClientDto clone = (ClientDto)base.Clone(cloner);
|
---|
73 | clone.CalendarSyncStatus = this.CalendarSyncStatus;
|
---|
74 | clone.Config = (ClientConfigDto)cloner.Clone(this.Config);
|
---|
75 | clone.CpuSpeedPerCore = this.CpuSpeedPerCore;
|
---|
76 | clone.FreeMemory = this.FreeMemory;
|
---|
77 | clone.Login = this.Login;
|
---|
78 | clone.Memory = this.Memory;
|
---|
79 | clone.NrOfCores = this.NrOfCores;
|
---|
80 | clone.NrOfFreeCores = this.NrOfFreeCores;
|
---|
81 | clone.State = this.State;
|
---|
82 | return clone;
|
---|
83 | }
|
---|
84 | }
|
---|
85 | }
|
---|