public GetHostStatusResponse GetHostStatus (WebServiceLogin login)
		{
			var response = new GetHostStatusResponse ();

			using (DB db = new DB ()) {
				Authenticate (db, login, response);

				response.UploadStatus = Global.UploadStatus;
				response.HostStatus = new List<DBHostStatusView> ();

				using (var cmd = db.CreateCommand ()) {
					cmd.CommandText = @"HostStatusView";
					cmd.CommandType = CommandType.TableDirect;

					using (var reader = cmd.ExecuteReader ()) {
						while (reader.Read ()) {
							response.HostStatus.Add (new DBHostStatusView (reader));
						}
					}
				}
			}

			return response;
		}
Exemple #2
0
		private IEnumerable<string> GetActiveHosts (GetHostStatusResponse hoststatusresponse) {
			return (hoststatusresponse.HostStatus)
				.Where (IsHostActive)
				.Select (status => status.host)
				.OrderBy(h => h);
		}
Exemple #3
0
		private IEnumerable<string> GetDownHosts (GetHostStatusResponse hoststatusresponse) {
			return hoststatusresponse.HostStatus
				.Where (IsHostDead)
				.Select (status => status.host)
				.OrderBy(h => h);
		}
		private IEnumerable<string> GetInactiveHosts (WebServiceLogin login, GetHostStatusResponse hoststatusresponse) {
			return hoststatusresponse.HostStatus
				.Where (IsHostInactive)
				.Select (status => status.host)
				.OrderBy(h => h);
		}