Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Model/Deployment.cs @ 7326

Last change on this file since 7326 was 7326, checked in by spimming, 12 years ago

#1680:

  • New model classes
  • New service operation methods added
  • License information added
File size: 3.4 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 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
22using System;
23using System.Collections.Generic;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26namespace HeuristicLab.Clients.Hive.CloudManager.Model {
27  public class Deployment : Item {
28    public string Name { get; set; }
29    public string DeploymentSlot { get; set; }
30    public string PrivateID { get; set; }
31    public string Status { get; set; }
32    public string Label { get; set; }
33    public string Url { get; set; }
34    public string Configuration { get; set; }
35    public List<RoleInstance> RoleInstanceList { get; set; }
36    public UpgradeStatus UpgradeStatus { get; set; }
37    public int UpgradeDomainCount;
38    public List<Role> RoleList { get; set; }
39
40    public Deployment() {
41
42    }
43
44    public Deployment(Deployment original, Cloner cloner) {
45      this.Name = original.Name;
46      this.DeploymentSlot = original.DeploymentSlot;
47      this.PrivateID = original.PrivateID;
48      this.Status = original.Status;
49      this.Label = original.Label;
50      this.Url = original.Label;
51      this.Configuration = original.Configuration;
52      this.RoleInstanceList = new List<RoleInstance>(original.RoleInstanceList);
53      this.UpgradeStatus = cloner.Clone(original.UpgradeStatus);
54      this.UpgradeDomainCount = original.UpgradeDomainCount;
55      this.RoleList = new List<Role>(original.RoleList);
56
57    }
58
59    public override bool Equals(object obj) {
60      if (obj == null)
61        return false;
62      Deployment dep = obj as Deployment;
63      if ((this.Name == dep.Name))
64        return true;
65      else
66        return false;
67    }
68
69    public override string ToString() {
70      return string.Format("Deployment: Name={0}, DeploymentSlot={1}, Label={2}, Status={3}", Name, DeploymentSlot, Label, Status);
71    }
72
73    public override IDeepCloneable Clone(Cloner cloner) {
74      return new Deployment(this, cloner);
75    }
76
77    public void Merge(Deployment deployment) {
78      if (!this.Equals(deployment)) {
79        throw new ArgumentException("Objects must be equal to be merged.", "subscription");
80      }
81      this.Name = deployment.Name;
82      this.DeploymentSlot = deployment.DeploymentSlot;
83      this.PrivateID = deployment.PrivateID;
84      this.Status = deployment.Status;
85      this.Label = deployment.Label;
86      this.Url = deployment.Label;
87      this.Configuration = deployment.Configuration;
88      this.RoleInstanceList = deployment.RoleInstanceList;
89      this.UpgradeStatus = deployment.UpgradeStatus;
90      this.UpgradeDomainCount = deployment.UpgradeDomainCount;
91      this.RoleList = deployment.RoleList;
92    }
93  }
94}
Note: See TracBrowser for help on using the repository browser.