コード例 #1
0
 /// <summary>
 /// An event handler called when a PlanetLab node is skipped.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodeSkipped(object sender, PlManagerNodeEventArgs e)
 {
     this.Invoke(() =>
         {
             // Find the progress item corresponding to this node.
             ProgressItem item = this.managerProgressItems.FirstOrDefault((ProgressItem it) =>
             {
                 return object.ReferenceEquals(it.Tag, e.Node);
             });
             // If the item is not null.
             if (null != item)
             {
                 item.Subtext = "Node skipped";
                 item.Enabled = false;
             }
             // Log an event.
             this.controlLog.Add(this.config.Log.Add(
                 LogEventLevel.Verbose,
                 LogEventType.Canceled,
                 ControlSliceRun.logSource.FormatWith(this.slice.Id),
                 "The PlanetLab node {0} ({1}) has been skipped for running commands because a previous node in the same slice was successful.",
                 new object[] { e.Node.Id, e.Node.Hostname }));
         });
 }
コード例 #2
0
 /// <summary>
 /// An event handler called when a PlanetLab node finished the commands successfully.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodeFinishedSuccess(object sender, PlManagerNodeEventArgs e)
 {
     this.Invoke(() =>
     {
         // Log an event.
         this.controlLog.Add(this.config.Log.Add(
             LogEventLevel.Verbose,
             LogEventType.Success,
             ControlSliceRun.logSource.FormatWith(this.slice.Id),
             "The PlanetLab node {0} ({1}) finished running the PlanetLab commands successfully.",
             new object[] { e.Node.Id, e.Node.Hostname }));
     });
 }
コード例 #3
0
 /// <summary>
 /// An event handler called when a PlanetLab node is enabled to run commands.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodeEnabled(object sender, PlManagerNodeEventArgs e)
 {
     this.Invoke(() =>
         {
             // Find the progress item corresponding to this node.
             ProgressItem item = this.managerProgressItems.FirstOrDefault((ProgressItem it) =>
             {
                 return object.ReferenceEquals(it.Tag, e.Node);
             });
             // If the item is not null.
             if (null != item)
             {
                 item.Progress.Count = e.Count;
                 item.Enabled = true;
             }
             // Log an event.
             this.controlLog.Add(this.config.Log.Add(
                 LogEventLevel.Verbose,
                 LogEventType.Information,
                 ControlSliceRun.logSource.FormatWith(this.slice.Id),
                 "The PlanetLab node {0} ({1}) is enabled for running commands.",
                 new object[] { e.Node.Id, e.Node.Hostname }));
         });
 }
コード例 #4
0
 /// <summary>
 /// An event handler called when a PlanetLab node failed in executing the commands.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodeFinishedFail(object sender, PlManagerNodeEventArgs e)
 {
     this.Invoke(() =>
     {
         // Find the progress item corresponding to this node.
         ProgressItem item = this.managerProgressItems.FirstOrDefault((ProgressItem it) =>
         {
             return object.ReferenceEquals(it.Tag, e.Node);
         });
         // If the item is not null.
         if (null != item)
         {
             item.Subtext = "Node failed";
             item.Enabled = false;
         }
         // Log an event.
         this.controlLog.Add(this.config.Log.Add(
             LogEventLevel.Normal,
             LogEventType.Error,
             ControlSliceRun.logSource.FormatWith(this.slice.Id),
             "The PlanetLab node {0} ({1}) failed while running the PlanetLab commands. {2}",
             new object[] { e.Node.Id, e.Node.Hostname, e.Exception.Message },
             e.Exception));
     });
 }
コード例 #5
0
 /// <summary>
 /// An event handler called when a PlanetLab node is disabled to run commands.
 /// </summary>
 /// <param name="sender">The sender object.</param>
 /// <param name="e">The event arguments.</param>
 private void OnNodeDisabled(object sender, PlManagerNodeEventArgs e)
 {
     this.Invoke(() =>
         {
             // Find the progress item corresponding to this node.
             ProgressItem item = this.managerProgressItems.FirstOrDefault((ProgressItem it) =>
             {
                 return object.ReferenceEquals(it.Tag, e.Node);
             });
             // If the item is not null.
             if (null != item)
             {
                 item.Subtext = "Not in boot state";
                 item.Enabled = false;
             }
             // Log an event.
             this.controlLog.Add(this.config.Log.Add(
                 LogEventLevel.Normal,
                 LogEventType.Warning,
                 ControlSliceRun.logSource.FormatWith(this.slice.Id),
                 "The PlanetLab node {0} ({1}) is disabled for running commands because it is not in the boot state.",
                 new object[] { e.Node.Id, e.Node.Hostname }));
         });
 }