-
Notifications
You must be signed in to change notification settings - Fork 22
/
LaunchInfo.cs
172 lines (158 loc) · 6.24 KB
/
LaunchInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/* Software License Agreement (BSD License)
*
* Copyright (c) 2010-2011, Rustici Software, LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Rustici Software, LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace RusticiSoftware.HostedEngine.Client
{
public class LaunchInfo
{
private String _id;
private String _completion;
private String _satisfaction;
private String _measureStatus;
private String _normalizedMeasure;
private String _experiencedDurationTracked;
private String _launchTime;
private String _exitTime;
private String _lastUpdated;
private String _log;
/// <summary>
/// The id associated with this launch
/// </summary>
public String Id
{
get { return _id; }
set { _id = value; }
}
/// <summary>
/// The completion value of the launch
/// </summary>
public String Completion
{
get { return _completion; }
set { _completion = value; }
}
/// <summary>
/// The satisfaction value of the launch
/// </summary>
public String Satisfaction
{
get { return _satisfaction; }
set { _satisfaction = value; }
}
/// <summary>
/// The measure status of the launch
/// </summary>
public String MeasureStatus
{
get { return _measureStatus; }
set { _measureStatus = value; }
}
/// <summary>
/// The normalized measure of the launch
/// </summary>
public String NormalizedMeasure
{
get { return _normalizedMeasure; }
set { _normalizedMeasure = value; }
}
/// <summary>
/// The experienced duration tracked for this launch
/// </summary>
public String ExperiencedDurationTracked
{
get { return _experiencedDurationTracked; }
set { _experiencedDurationTracked = value; }
}
/// <summary>
/// The launch time
/// </summary>
public String LaunchTime
{
get { return _launchTime; }
set { _launchTime = value; }
}
/// <summary>
/// The exit time
/// </summary>
public String ExitTime
{
get { return _exitTime; }
set { _exitTime = value; }
}
/// <summary>
/// The last update time for this launch
/// </summary>
public String LastUpdated
{
get { return _lastUpdated; }
set { _lastUpdated = value; }
}
/// <summary>
/// The log which contains the execution history of this launch
/// </summary>
public String Log
{
get { return _log; }
set { _log = value; }
}
/// <summary>
/// Inflate launch info object from passed in xml element
/// </summary>
/// <param name="launchInfoElem"></param>
public LaunchInfo(XmlElement launchInfoElem)
{
this.Id = launchInfoElem.GetAttribute("id");
this.Completion = XmlUtils.GetNamedElemValue(launchInfoElem, "completion");
this.Satisfaction = XmlUtils.GetNamedElemValue(launchInfoElem, "satisfaction");
this.MeasureStatus = XmlUtils.GetNamedElemValue(launchInfoElem, "measure_status");
this.NormalizedMeasure = XmlUtils.GetNamedElemValue(launchInfoElem, "normalized_measure");
this.ExperiencedDurationTracked = XmlUtils.GetNamedElemValue(launchInfoElem, "experienced_duration_tracked");
this.LaunchTime = XmlUtils.GetNamedElemValue(launchInfoElem, "launch_time");
this.ExitTime = XmlUtils.GetNamedElemValue(launchInfoElem, "exit_time");
this.LastUpdated = XmlUtils.GetNamedElemValue(launchInfoElem, "update_dt");
this.Log = XmlUtils.GetNamedElemXml(launchInfoElem, "log");
}
/// <summary>
/// Return list of launch info objects from xml element
/// </summary>
/// <param name="doc"></param>
/// <returns></returns>
public static List<LaunchInfo> ConvertToLaunchInfoList(XmlElement rootElem)
{
List<LaunchInfo> launchList = new List<LaunchInfo>();
XmlNodeList launches = rootElem.GetElementsByTagName("launch");
foreach (XmlNode launch in launches) {
launchList.Add(new LaunchInfo((XmlElement)launch));
}
return launchList;
}
}
}