Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/27/11 15:20:23 (13 years ago)
Author:
cneumuel
Message:

#1233

  • finished experiment sharing
  • added role for executing privileged jobs
  • refreshing experiments in experimentManager does not delete already downloaded jobs
  • moved some properties from HiveExperiment into RefreshableHiveExperiment
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/MenuItems/AdministrationMenuItem.cs

    r6373 r6479  
    2727  public class AdministrationMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2828    public override string Name {
    29       get { return "&Administration (dev)"; }
     29      get { return "&Administration"; }
    3030    }
    3131    public override IEnumerable<string> Structure {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/MenuItems/ExperimentManagerMenuItem.cs

    r6373 r6479  
    2727  public class ExperimentManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2828    public override string Name {
    29       get { return "&Experiment Manager (dev)"; }
     29      get { return "&Experiment Manager"; }
    3030    }
    3131    public override IEnumerable<string> Structure {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.Designer.cs

    r6463 r6479  
    6161      this.usernameTextBox.TabIndex = 3;
    6262      this.usernameTextBox.Validated += new System.EventHandler(this.usernameTextBox_Validated);
     63      this.usernameTextBox.Validating += new System.ComponentModel.CancelEventHandler(usernameTextBox_Validating);
    6364      //
    6465      // permissionComboBox
     
    7374      this.permissionComboBox.TabIndex = 4;
    7475      this.permissionComboBox.Validated += new System.EventHandler(this.permissionComboBox_Validated);
     76      this.permissionComboBox.Validating += new System.ComponentModel.CancelEventHandler(permissionComboBox_Validating);
    7577      //
    7678      // HiveExperimentPermissionView
     
    9294
    9395    }
    94 
    9596    #endregion
    9697
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/HiveExperimentPermissionView.cs

    r6465 r6479  
    2020#endregion
    2121
     22using System.ComponentModel;
    2223using HeuristicLab.Clients.Hive.Views;
    2324using HeuristicLab.MainForm;
     
    6263
    6364    #region Child Control Events
    64     private void usernameTextBox_Validated(object sender, System.EventArgs e) {
     65
     66    private void usernameTextBox_Validating(object sender, CancelEventArgs e) {
    6567      Content.GrantedUserName = usernameTextBox.Text;
    6668    }
     69    private void usernameTextBox_Validated(object sender, System.EventArgs e) {
     70     
     71    }
    6772
     73    private void permissionComboBox_Validating(object sender, CancelEventArgs e) {
     74      Content.Permission = (Permission)permissionComboBox.SelectedItem;
     75    }
    6876    private void permissionComboBox_Validated(object sender, System.EventArgs e) {
    69       Content.Permission = (Permission)permissionComboBox.SelectedItem;
     77     
    7078    }
    7179    #endregion
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentListView.cs

    r6465 r6479  
    3939      this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable;
    4040      this.itemsListView.FullRowSelect = true;
     41      this.itemsListView.Sorting = SortOrder.Ascending;
     42      this.itemsListView.Sort();
    4143    }
    4244
    4345    protected override RefreshableHiveExperiment CreateItem() {
    44       return new RefreshableHiveExperiment();
     46      return new RefreshableHiveExperiment() { IsAllowedPrivileged = HiveClient.Instance.IsAllowedPrivileged };
    4547    }
    4648
     
    5254    }
    5355
     56    protected override void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<RefreshableHiveExperiment> e) {
     57      base.Content_ItemsAdded(sender, e);
     58
     59    }
     60
    5461    protected override ListViewItem CreateListViewItem(RefreshableHiveExperiment item) {
    5562      ListViewItem listViewItem = base.CreateListViewItem(item);
     
    5966      listViewItem.Group = GetListViewGroup(item.HiveExperiment.OwnerUsername);
    6067      return listViewItem;
     68    }
     69
     70    protected override void UpdateListViewItemText(ListViewItem listViewItem) {
     71      if (listViewItem == null) throw new ArgumentNullException();
     72      var item = listViewItem.Tag as RefreshableHiveExperiment;
     73      listViewItem.SubItems[0].Text = item == null ? "null" : item.HiveExperiment.DateCreated.ToString("dd.MM.yyyy HH:mm");
     74      listViewItem.SubItems[1].Text = item == null ? "null" : item.HiveExperiment.Name;
     75      listViewItem.Group = GetListViewGroup(item.HiveExperiment.OwnerUsername);
     76      listViewItem.ToolTipText = item == null ? string.Empty : item.ItemName + ": " + item.ItemDescription;
    6177    }
    6278
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.Designer.cs

    r6463 r6479  
    5555      this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5656      this.sharingTabPage = new System.Windows.Forms.TabPage();
     57      this.refreshPermissionsButton = new System.Windows.Forms.Button();
    5758      this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.ExperimentManager.Views.HiveExperimentPermissionListView();
    5859      this.logTabPage = new System.Windows.Forms.TabPage();
     
    7980      this.calculatingLabel = new System.Windows.Forms.Label();
    8081      this.jobsLabel = new System.Windows.Forms.Label();
    81       this.refreshPermissionsButton = new System.Windows.Forms.Button();
    8282      this.tabControl.SuspendLayout();
    8383      this.jobsTabPage.SuspendLayout();
     
    102102      this.tabControl.Size = new System.Drawing.Size(717, 452);
    103103      this.tabControl.TabIndex = 4;
     104      this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
    104105      //
    105106      // jobsTabPage
     
    165166      this.sharingTabPage.UseVisualStyleBackColor = true;
    166167      //
     168      // refreshPermissionsButton
     169      //
     170      this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image")));
     171      this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3);
     172      this.refreshPermissionsButton.Name = "refreshPermissionsButton";
     173      this.refreshPermissionsButton.Size = new System.Drawing.Size(24, 24);
     174      this.refreshPermissionsButton.TabIndex = 23;
     175      this.toolTip.SetToolTip(this.refreshPermissionsButton, "Refresh Data");
     176      this.refreshPermissionsButton.UseVisualStyleBackColor = true;
     177      this.refreshPermissionsButton.Click += new System.EventHandler(this.refreshPermissionsButton_Click);
     178      //
    167179      // hiveExperimentPermissionListView
    168180      //
     
    172184      this.hiveExperimentPermissionListView.Caption = "HiveExperimentPermissionList View";
    173185      this.hiveExperimentPermissionListView.Content = null;
     186      this.hiveExperimentPermissionListView.HiveExperimentId = new System.Guid("00000000-0000-0000-0000-000000000000");
    174187      this.hiveExperimentPermissionListView.Location = new System.Drawing.Point(3, 33);
    175188      this.hiveExperimentPermissionListView.Name = "hiveExperimentPermissionListView";
     
    410423      this.jobsLabel.TabIndex = 0;
    411424      this.jobsLabel.Text = "Jobs:";
    412       //
    413       // refreshPermissionsButton
    414       //
    415       this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image")));
    416       this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3);
    417       this.refreshPermissionsButton.Name = "refreshPermissionsButton";
    418       this.refreshPermissionsButton.Size = new System.Drawing.Size(24, 24);
    419       this.refreshPermissionsButton.TabIndex = 23;
    420       this.toolTip.SetToolTip(this.refreshPermissionsButton, "Refresh Data");
    421       this.refreshPermissionsButton.UseVisualStyleBackColor = true;
    422       this.refreshPermissionsButton.Click += new System.EventHandler(this.refreshPermissionsButton_Click);
    423425      //
    424426      // RefreshableHiveExperimentView
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.ExperimentManager/3.4/Views/RefreshableHiveExperimentView.cs

    r6463 r6479  
    6363      Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    6464      Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged);
     65      Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);
     66      Content.HiveJobsChanged += new EventHandler(Content_HiveJobChanged);
     67      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
     68      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
     69      Content.IsAllowedPrivilegedChanged += new EventHandler(Content_IsAllowedPrivilegedChanged);
    6570    }
    6671
     
    7277      Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    7378      Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged);
     79      Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);
     80      Content.HiveJobsChanged -= new EventHandler(Content_HiveJobChanged);
     81      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
     82      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    7483      base.DeregisterContentEvents();
    7584    }
    7685
    7786    private void RegisterHiveExperimentEvents() {
    78       Content.HiveExperiment.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    79       Content.HiveExperiment.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    80       Content.HiveExperiment.HiveJobsChanged += new EventHandler(Content_HiveJobChanged);
    81       Content.HiveExperiment.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);
    8287      Content.HiveExperiment.PropertyChanged += new PropertyChangedEventHandler(HiveExperiment_PropertyChanged);
    8388    }
    8489   
    8590    private void DeregisterHiveExperimentEvents() {
    86       Content.HiveExperiment.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
    87       Content.HiveExperiment.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    88       Content.HiveExperiment.HiveJobsChanged -= new EventHandler(Content_HiveJobChanged);
    89       Content.HiveExperiment.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);
    9091      Content.HiveExperiment.PropertyChanged -= new PropertyChangedEventHandler(HiveExperiment_PropertyChanged);
    9192    }
    9293
    9394    private void RegisterHiveJobEvents() {
    94       Content.HiveExperiment.HiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    95       Content.HiveExperiment.HiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    96       Content.HiveExperiment.HiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     95      Content.HiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     96      Content.HiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     97      Content.HiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    9798    }
    9899    private void DeregisterHiveJobEvents() {
    99       Content.HiveExperiment.HiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    100       Content.HiveExperiment.HiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    101       Content.HiveExperiment.HiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     100      Content.HiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     101      Content.HiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
     102      Content.HiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(HiveJobs_ItemsAdded_Removed_Reset);
    102103    }
    103104
     
    114115      } else {
    115116        nameTextBox.Text = Content.HiveExperiment.Name;
    116         executionTimeTextBox.Text = Content.HiveExperiment.ExecutionTime.ToString();
     117        executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    117118        resourceNamesTextBox.Text = Content.HiveExperiment.ResourceNames;
    118119        isPrivilegedCheckBox.Checked = Content.HiveExperiment.IsPrivileged;
     
    139140      if (Content != null) {
    140141        bool alreadyUploaded = Content.Id != Guid.Empty;
    141         bool jobsLoaded = Content.HiveExperiment.HiveJobs != null && Content.HiveExperiment.HiveJobs.All(x => x.Job.Id != Guid.Empty);
    142 
    143         this.nameTextBox.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    144         this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    145         this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    146 
    147         this.isPrivilegedCheckBox.Enabled = Content.IsControllable && !(Content.HiveExperiment.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this       
    148         this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.HiveExperiment.ExecutionState == ExecutionState.Started;
    149         this.refreshButton.Enabled = Content.IsControllable && alreadyUploaded;
    150         this.Locked = !Content.IsControllable || Content.HiveExperiment.ExecutionState == ExecutionState.Started;
    151 
     142        bool jobsLoaded = Content.HiveJobs != null && Content.HiveJobs.All(x => x.Job.Id != Guid.Empty);
     143
     144        this.nameTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
     145        this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
     146        this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
     147
     148        this.isPrivilegedCheckBox.Enabled = Content.IsAllowedPrivileged && Content.IsControllable && !(Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded); // TODO: check if user has the rights to do this       
     149        this.refreshAutomaticallyCheckBox.Enabled = Content.IsControllable && alreadyUploaded && jobsLoaded && Content.ExecutionState == ExecutionState.Started;
     150        this.refreshButton.Enabled = Content.IsDownloadable && alreadyUploaded;
     151        this.Locked = !Content.IsControllable || Content.ExecutionState == ExecutionState.Started;
    152152      }
    153153      SetEnabledStateOfExecutableButtons();
     154      tabControl_SelectedIndexChanged(this, EventArgs.Empty); // ensure sharing tabpage is disabled
    154155    }
    155156
     
    214215        Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);
    215216      else
    216         executionTimeTextBox.Text = Content.HiveExperiment.ExecutionTime.ToString();
     217        executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    217218    }
    218219    private void Content_RefreshAutomaticallyChanged(object sender, EventArgs e) {
     
    228229        Invoke(new EventHandler(Content_HiveJobChanged), sender, e);
    229230      else {
    230         if (Content != null && Content.HiveExperiment.HiveJobs != null) {
    231           jobsTreeView.Content = Content.HiveExperiment.HiveJobs;
     231        if (Content != null && Content.HiveJobs != null) {
     232          jobsTreeView.Content = Content.HiveJobs;
    232233          RegisterHiveJobEvents();
    233234        } else {
     
    263264    }
    264265    private void Content_ExceptionOccured(object sender, EventArgs<Exception> e) {
    265       if (Content.IsControllable) {
    266         // show error dialog only if Controllable (otherwise it should continue trying without an error dialog (e.g. HiveEngine))
    267         ErrorHandling.ShowErrorDialog(this, e.Value);
    268       }
     266      // don't show exception, it is logged anyway
    269267    }
    270268    private void Content_StateLogListChanged(object sender, EventArgs e) {
     
    275273      }
    276274    }
     275    private void Content_IsAllowedPrivilegedChanged(object sender, EventArgs e) {
     276      if (InvokeRequired)
     277        Invoke(new EventHandler(Content_IsAllowedPrivilegedChanged), sender, e);
     278      else {
     279        SetEnabledStateOfControls();
     280      }
     281    }
     282
    277283
    278284    private void UpdateStateLogList() {
    279285      if (Content != null && this.Content.HiveExperiment != null) {
    280         stateLogViewHost.Content = this.Content.HiveExperiment.StateLogList;
     286        stateLogViewHost.Content = this.Content.StateLogList;
    281287      } else {
    282288        stateLogViewHost.Content = null;
     
    294300    }
    295301    private void pauseButton_Click(object sender, EventArgs e) {
    296       HiveClient.PauseExperiment(Content.HiveExperiment);
     302      HiveClient.PauseExperiment(Content);
    297303    }
    298304    private void stopButton_Click(object sender, EventArgs e) {
    299       HiveClient.StopExperiment(Content.HiveExperiment);
     305      HiveClient.StopExperiment(Content);
    300306    }
    301307    private void resetButton_Click(object sender, EventArgs e) { }
     
    320326
    321327    private void refreshButton_Click(object sender, EventArgs e) {
    322       var invoker = new Action<HiveExperiment>(HiveClient.LoadExperiment);
    323       invoker.BeginInvoke(Content.HiveExperiment, (ar) => {
     328      var invoker = new Action<RefreshableHiveExperiment>(HiveClient.LoadExperiment);
     329      invoker.BeginInvoke(Content, (ar) => {
    324330        try {
    325331          invoker.EndInvoke(ar);
     
    343349        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
    344350      } else {
    345         startButton.Enabled = Content.IsControllable && Content.HiveExperiment.HiveJobs != null && Content.HiveExperiment.HiveJobs.Count > 0 && Content.HiveExperiment.ExecutionState == ExecutionState.Prepared;
    346         pauseButton.Enabled = Content.IsControllable && Content.HiveExperiment.ExecutionState == ExecutionState.Started;
    347         stopButton.Enabled = Content.IsControllable && Content.HiveExperiment.ExecutionState == ExecutionState.Started;
     351        startButton.Enabled = Content.IsControllable && Content.HiveJobs != null && Content.HiveJobs.Count > 0 && Content.ExecutionState == ExecutionState.Prepared;
     352        pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started;
     353        stopButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started;
    348354        resetButton.Enabled = false;
    349355      }
     
    356362        Invoke(new EventHandler(Content_IsProgressingChanged), sender, e);
    357363      } else {
    358         if (Content != null && Content.HiveExperiment.IsProgressing) {
     364        if (Content != null && Content.IsProgressing) {
    359365          SetProgressView();
    360366        } else {
     
    366372    private void SetProgressView() {
    367373      if (progressView == null) {
    368         progressView = new ProgressView(this, Content.HiveExperiment.Progress);
    369       }
    370       progressView.Progress = Content.HiveExperiment.Progress;
     374        progressView = new ProgressView(this, Content.Progress);
     375      }
     376      progressView.Progress = Content.Progress;
    371377    }
    372378
     
    389395      var obj = e.Data.GetData(Constants.DragDropDataFormat);
    390396      if (obj is IOptimizer) {
    391         e.Effect = DragDropEffects.Copy;
     397        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     398        else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy;
    392399      }
    393400    }
     
    399406        var optimizer = obj as IOptimizer;
    400407        if (optimizer != null) {
    401           Content.HiveExperiment.HiveJobs.Add(new OptimizerHiveJob(optimizer));
     408          Content.HiveJobs.Add(new OptimizerHiveJob(e.Effect.HasFlag(DragDropEffects.Copy) ? (IOptimizer)optimizer.Clone() : optimizer));
    402409        }
    403410      }
    404411    }
    405412    #endregion
     413
     414    private void tabControl_SelectedIndexChanged(object sender, EventArgs e) {
     415      if (tabControl.SelectedTab == sharingTabPage) {
     416        if (!Content.IsSharable) {
     417          MessageBox.Show("Unable to load tab. You have insufficient access privileges.");
     418          tabControl.SelectedTab = jobsTabPage;
     419        }
     420      }
     421    }
    406422  }
    407423}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/app.config

    r6359 r6479  
    2424      </service>
    2525    </services>
    26  
     26
    2727   <client>
    2828     <endpoint name="SlaveCommunicationServiceEndpoint" address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication"/>
    29     <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc"
     29    <endpoint address="http://localhost/Hive-3.4/HiveService.svc"
    3030              binding="wsHttpBinding"
    3131              bindingConfiguration="wsHttpBinding_Hive"
    3232              contract="HeuristicLab.Clients.Hive.IHiveService"
    3333              name="wsHttpBinding_IHiveService">
    34       <identity>
    35         <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" />
    36       </identity>
     34              <identity>
     35                <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac=" />
     36              </identity>
     37
    3738    </endpoint>
    3839   </client>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Tests/ExperimentManagerTests.cs

    r6452 r6479  
    4545      var rhc = new RefreshableHiveExperiment();
    4646      var optimizer = CreateOptimizer();
    47       rhc.HiveExperiment.HiveJobs.Add(new OptimizerHiveJob(optimizer));
     47      rhc.HiveJobs.Add(new OptimizerHiveJob(optimizer));
    4848     
    4949      HiveClient.StartExperiment((Exception ex) => TestContext.WriteLine(ex.ToString()), rhc, new CancellationToken());
    5050
    51       while (rhc.HiveExperiment.ExecutionState != Core.ExecutionState.Stopped) {
     51      while (rhc.ExecutionState != Core.ExecutionState.Stopped) {
    5252        Thread.Sleep(500);
    5353      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HiveJobs/OptimizerHiveJobView.cs

    r6381 r6479  
    4949    }
    5050    #region Content Events
     51    protected override void RegisterContentEvents() {
     52      base.RegisterContentEvents();
     53      Content.IsControllableChanged += new EventHandler(Content_IsControllableChanged);
     54    }
     55
     56    protected override void DeregisterContentEvents() {
     57      Content.IsControllableChanged -= new EventHandler(Content_IsControllableChanged);
     58      base.DeregisterContentEvents();
     59    }
     60
     61    protected virtual void Content_IsControllableChanged(object sender, EventArgs e) {
     62      SetEnabledStateOfControls();
     63    }
     64
    5165    #endregion
    5266
     
    6882      base.SetEnabledStateOfControls();
    6983
    70       this.restartButton.Enabled = Content != null && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted);
    71       this.pauseButton.Enabled = Content != null && !Content.Job.Command.HasValue && Content.Job.State == JobState.Calculating;
    72       this.stopButton.Enabled = Content != null && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused);
     84      this.restartButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted);
     85      this.pauseButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && Content.Job.State == JobState.Calculating;
     86      this.stopButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused);
    7387    }
    7488  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/TreeView/HiveJobItemTreeView.cs

    r6382 r6479  
    2424using System.Windows.Forms;
    2525using HeuristicLab.Clients.Hive.Jobs;
    26 using HeuristicLab.Clients.Hive.Views.ExperimentManager.TreeView;
    2726using HeuristicLab.Core;
    2827using HeuristicLab.MainForm;
     
    9897            experiment.Optimizers.Remove(((OptimizerJob)selectedItem.ItemJob).Item);
    9998          }
    100         }       
     99        }
    101100      }
    102101    }
     
    104103
    105104    protected override ICollection<IItemTreeNodeAction<HiveJob>> GetTreeNodeItemActions(HiveJob selectedItem) {
    106       var actions = base.GetTreeNodeItemActions(selectedItem);
    107       if (selectedItem != null) {
    108         if (selectedItem.ItemJob.Item is Experiment) {
    109 
    110         }
    111         actions.Add(new DeleteJobTreeNodeAction(Content));
    112       }
    113      
    114       return actions;
     105      return base.GetTreeNodeItemActions(selectedItem);
    115106    }
    116107  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveClient.cs

    r6463 r6479  
    6666      set { alreadyUploadedPlugins = value; }
    6767    }
     68
     69    private bool isAllowedPrivileged;
     70    public bool IsAllowedPrivileged {
     71      get { return isAllowedPrivileged; }
     72      set { isAllowedPrivileged = value; }
     73    }
    6874    #endregion
    6975
     
    7581
    7682      try {
     83        this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
     84
     85        var oldExperiments = hiveExperiments ?? new ItemCollection<RefreshableHiveExperiment>();
    7786        hiveExperiments = new HiveItemCollection<RefreshableHiveExperiment>();
    78         var he = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments());
    79         hiveExperiments.AddRange(he.Select(x => new RefreshableHiveExperiment(x)).OrderBy(x => x.HiveExperiment.Name));
     87        var experimentsLoaded = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments());
     88
     89        foreach (var he in experimentsLoaded) {
     90          var hiveExperiment = oldExperiments.SingleOrDefault(x => x.Id == he.Id);
     91          if (hiveExperiment == null) {
     92            // new
     93            hiveExperiments.Add(new RefreshableHiveExperiment(he) { IsAllowedPrivileged = this.isAllowedPrivileged });
     94          } else {
     95            // update
     96            hiveExperiment.HiveExperiment = he;
     97            hiveExperiment.IsAllowedPrivileged = this.isAllowedPrivileged;
     98            hiveExperiments.Add(hiveExperiment);
     99          }
     100        }
     101        // remove those which were not in the list of loaded hiveexperiments
     102        foreach (var experiment in oldExperiments) {
     103          if (experiment.Id == Guid.Empty) {
     104            // experiment not uploaded... keep
     105            hiveExperiments.Add(experiment);
     106          } else {
     107            experiment.RefreshAutomatically = false; // stop results polling
     108          }
     109        }
    80110      }
    81111      catch {
     
    175205      HiveClient.StoreAsync(
    176206        new Action<Exception>((Exception ex) => {
    177           refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Prepared;
     207          refreshableHiveExperiment.ExecutionState = ExecutionState.Prepared;
    178208          exceptionCallback(ex);
    179209        }), refreshableHiveExperiment, cancellationToken);
    180       refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Started;
    181     }
    182 
    183     public static void PauseExperiment(HiveExperiment hiveExperiment) {
     210      refreshableHiveExperiment.ExecutionState = ExecutionState.Started;
     211    }
     212
     213    public static void PauseExperiment(RefreshableHiveExperiment refreshableHiveExperiment) {
    184214      ServiceLocator.Instance.CallHiveService(service => {
    185         foreach (HiveJob job in hiveExperiment.GetAllHiveJobs()) {
     215        foreach (HiveJob job in refreshableHiveExperiment.GetAllHiveJobs()) {
    186216          if (job.Job.State != JobState.Finished && job.Job.State != JobState.Aborted && job.Job.State != JobState.Failed)
    187217            service.PauseJob(job.Job.Id);
    188218        }
    189219      });
    190       hiveExperiment.ExecutionState = ExecutionState.Paused;
    191     }
    192 
    193     public static void StopExperiment(HiveExperiment hiveExperiment) {
     220      refreshableHiveExperiment.ExecutionState = ExecutionState.Paused;
     221    }
     222
     223    public static void StopExperiment(RefreshableHiveExperiment refreshableHiveExperiment) {
    194224      ServiceLocator.Instance.CallHiveService(service => {
    195         foreach (HiveJob job in hiveExperiment.GetAllHiveJobs()) {
     225        foreach (HiveJob job in refreshableHiveExperiment.GetAllHiveJobs()) {
    196226          if (job.Job.State != JobState.Finished && job.Job.State != JobState.Aborted && job.Job.State != JobState.Failed)
    197227            service.StopJob(job.Job.Id);
     
    207237    private void UploadExperiment(RefreshableHiveExperiment refreshableHiveExperiment, CancellationToken cancellationToken) {
    208238      try {
    209         refreshableHiveExperiment.HiveExperiment.Progress = new Progress("Connecting to server...");
    210         refreshableHiveExperiment.HiveExperiment.IsProgressing = true;
     239        refreshableHiveExperiment.Progress = new Progress("Connecting to server...");
     240        refreshableHiveExperiment.IsProgressing = true;
    211241
    212242        IEnumerable<string> resourceNames = ToResourceNameList(refreshableHiveExperiment.HiveExperiment.ResourceNames);
     
    220250        }
    221251
    222         foreach (OptimizerHiveJob hiveJob in refreshableHiveExperiment.HiveExperiment.HiveJobs.OfType<OptimizerHiveJob>()) {
     252        foreach (OptimizerHiveJob hiveJob in refreshableHiveExperiment.HiveJobs.OfType<OptimizerHiveJob>()) {
    223253          hiveJob.SetIndexInParentOptimizerList(null);
    224254        }
    225255
    226256        // upload HiveExperiment
    227         refreshableHiveExperiment.HiveExperiment.Progress.Status = "Uploading HiveExperiment...";
     257        refreshableHiveExperiment.Progress.Status = "Uploading HiveExperiment...";
    228258        refreshableHiveExperiment.HiveExperiment.Id = ServiceLocator.Instance.CallHiveService((s) => s.AddHiveExperiment(refreshableHiveExperiment.HiveExperiment));
    229         cancellationToken.ThrowIfCancellationRequested();
    230 
    231         int totalJobCount = refreshableHiveExperiment.HiveExperiment.GetAllHiveJobs().Count();
     259        refreshableHiveExperiment.HiveExperiment = ServiceLocator.Instance.CallHiveService((s) => s.GetHiveExperiment(refreshableHiveExperiment.HiveExperiment.Id)); // update owner and permissions
     260        cancellationToken.ThrowIfCancellationRequested();
     261
     262        int totalJobCount = refreshableHiveExperiment.GetAllHiveJobs().Count();
    232263        int[] jobCount = new int[1]; // use a reference type (int-array) instead of value type (int) in order to pass the value via a delegate to task-parallel-library
    233264        cancellationToken.ThrowIfCancellationRequested();
    234265
    235266        // upload plugins
    236         refreshableHiveExperiment.HiveExperiment.Progress.Status = "Uploading plugins...";
     267        refreshableHiveExperiment.Progress.Status = "Uploading plugins...";
    237268        this.OnlinePlugins = ServiceLocator.Instance.CallHiveService((s) => s.GetPlugins());
    238269        this.AlreadyUploadedPlugins = new List<Plugin>();
     
    244275
    245276        // upload jobs
    246         refreshableHiveExperiment.HiveExperiment.Progress.Status = "Uploading jobs...";
     277        refreshableHiveExperiment.Progress.Status = "Uploading jobs...";
    247278
    248279        var tasks = new List<Task>();
    249         foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveExperiment.HiveJobs) {
     280        foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveJobs) {
    250281          tasks.Add(Task.Factory.StartNew((hj) => {
    251             UploadJobWithChildren(refreshableHiveExperiment.HiveExperiment.Progress, (HiveJob)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged, cancellationToken);
     282            UploadJobWithChildren(refreshableHiveExperiment.Progress, (HiveJob)hj, null, resourceIds, jobCount, totalJobCount, configFilePlugin.Id, refreshableHiveExperiment.HiveExperiment.Id, refreshableHiveExperiment.Log, refreshableHiveExperiment.HiveExperiment.IsPrivileged, cancellationToken);
    252283          }, hiveJob)
    253284          .ContinueWith((x) => refreshableHiveExperiment.Log.LogException(x.Exception), TaskContinuationOptions.OnlyOnFaulted));
     
    259290          if (!ae.InnerExceptions.All(e => e is TaskCanceledException)) throw ae; // for some reason the WaitAll throws a AggregateException containg a TaskCanceledException. i don't know where it comes from, however the tasks all finish properly, so for now just ignore it
    260291        }
     292        refreshableHiveExperiment.HiveExperiment.Modified = false;
    261293      }
    262294      finally {
    263         refreshableHiveExperiment.HiveExperiment.IsProgressing = false;
     295        refreshableHiveExperiment.IsProgressing = false;
    264296      }
    265297    }
     
    364396      }
    365397      finally {
    366         if(!semaphoreReleased) jobUploadSemaphore.Release();
     398        if (!semaphoreReleased) jobUploadSemaphore.Release();
    367399      }
    368400    }
     
    370402
    371403    #region Download Experiment
    372     public static void LoadExperiment(HiveExperiment hiveExperiment) {
    373       hiveExperiment.Progress = new Progress();
     404    public static void LoadExperiment(RefreshableHiveExperiment refreshableHiveExperiment) {
     405      var hiveExperiment = refreshableHiveExperiment.HiveExperiment;
     406      refreshableHiveExperiment.Progress = new Progress();
     407
    374408      try {
    375         hiveExperiment.IsProgressing = true;
     409        refreshableHiveExperiment.IsProgressing = true;
    376410        int totalJobCount = 0;
    377411        IEnumerable<LightweightJob> allJobs;
    378412
    379         hiveExperiment.Progress.Status = "Connecting to Server...";
     413        refreshableHiveExperiment.Progress.Status = "Connecting to Server...";
    380414        // fetch all Job objects to create the full tree of tree of HiveJob objects
    381         hiveExperiment.Progress.Status = "Downloading list of jobs...";
     415        refreshableHiveExperiment.Progress.Status = "Downloading list of jobs...";
    382416        allJobs = ServiceLocator.Instance.CallHiveService(s => s.GetLightweightExperimentJobs(hiveExperiment.Id));
    383417        totalJobCount = allJobs.Count();
     
    387421
    388422        while (!downloader.IsFinished) {
    389           hiveExperiment.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount;
    390           hiveExperiment.Progress.Status = string.Format("Downloading/deserializing jobs... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount);
     423          refreshableHiveExperiment.Progress.ProgressValue = downloader.FinishedCount / (double)totalJobCount;
     424          refreshableHiveExperiment.Progress.Status = string.Format("Downloading/deserializing jobs... ({0}/{1} finished)", downloader.FinishedCount, totalJobCount);
    391425          Thread.Sleep(500);
    392426
     
    397431        IDictionary<Guid, HiveJob> allHiveJobs = downloader.Results;
    398432
    399         hiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue));
    400 
    401         if (hiveExperiment.IsFinished()) {
    402           hiveExperiment.ExecutionState = Core.ExecutionState.Stopped;
     433        refreshableHiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue));
     434
     435        if (refreshableHiveExperiment.IsFinished()) {
     436          refreshableHiveExperiment.ExecutionState = Core.ExecutionState.Stopped;
    403437        } else {
    404           hiveExperiment.ExecutionState = Core.ExecutionState.Started;
     438          refreshableHiveExperiment.ExecutionState = Core.ExecutionState.Started;
    405439        }
    406440
    407441        // build child-job tree
    408         foreach (HiveJob hiveJob in hiveExperiment.HiveJobs) {
     442        foreach (HiveJob hiveJob in refreshableHiveExperiment.HiveJobs) {
    409443          BuildHiveJobTree(hiveJob, allJobs, allHiveJobs);
    410444        }
    411445
    412         hiveExperiment.OnLoaded();
     446        refreshableHiveExperiment.OnLoaded();
    413447      }
    414448      finally {
    415         hiveExperiment.IsProgressing = false;
     449        refreshableHiveExperiment.IsProgressing = false;
    416450      }
    417451    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HiveJobs/HiveJob.cs

    r6419 r6479  
    108108    public bool IsDownloading { get; set; }
    109109
     110    // if true, all control buttons should be enabled. otherwise disabled
     111    private bool isControllable = true;
     112    public bool IsControllable {
     113      get { return isControllable; }
     114      set {
     115        if (value != isControllable) {
     116          isControllable = value;
     117          OnIsControllableChanged();
     118          childHiveJobsLock.EnterReadLock();
     119          try {
     120            foreach (var hiveJob in childHiveJobs) {
     121              hiveJob.IsControllable = value;
     122            }
     123          }
     124          finally {
     125            childHiveJobsLock.ExitReadLock();
     126          }
     127        }
     128      }
     129    }
     130
    110131    [Storable]
    111132    protected ItemList<HiveJob> childHiveJobs;
     
    296317    }
    297318
     319    public event EventHandler IsControllableChanged;
     320    private void OnIsControllableChanged() {
     321      var handler = IsControllableChanged;
     322      if (handler != null) handler(this, EventArgs.Empty);
     323    }
     324
    298325    private void RegisterJobEvents() {
    299326      if (job != null)
     
    303330    private void DeregisterJobEvents() {
    304331      if (job != null)
    305         job.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(job_PropertyChanged);
     332        job.PropertyChanged += new PropertyChangedEventHandler(job_PropertyChanged);
    306333    }
    307334
     
    397424      foreach (var item in e.Items) {
    398425        item.Value.StateLogChanged += new EventHandler(ChildHiveJob_StateLogChanged);
     426        item.Value.IsControllable = this.IsControllable;
    399427      }
    400428      var handler = ItemsAdded;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/RefreshableHiveExperiment.cs

    r6478 r6479  
    2525using System.Drawing;
    2626using System.Linq;
     27using HeuristicLab.Collections;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Core;
    2930
    3031namespace HeuristicLab.Clients.Hive {
    31   public class RefreshableHiveExperiment : IHiveItem, IDeepCloneable, IContent, IProgressReporter {
     32  public class RefreshableHiveExperiment : IHiveItem, IDeepCloneable, IContent, IProgressReporter, IComparable<RefreshableHiveExperiment> {
    3233    private JobResultPoller jobResultPoller;
    3334    private ConcurrentJobDownloader<ItemJob> jobDownloader;
     
    4445          if (hiveExperiment != null) DergisterHiveExperimentEvents();
    4546          hiveExperiment = value;
    46           if (hiveExperiment != null) RegisterHiveExperimentEvents();
     47          if (hiveExperiment != null) {
     48            RegisterHiveExperimentEvents();
     49            hiveExperiment_PropertyChanged(hiveExperiment, new PropertyChangedEventArgs("Id"));
     50          }
    4751          OnHiveExperimentChanged();
     52          OnToStringChanged(this, EventArgs.Empty);
     53        }
     54      }
     55    }
     56
     57    private ItemCollection<HiveJob> hiveJobs;
     58    public ItemCollection<HiveJob> HiveJobs {
     59      get { return hiveJobs; }
     60      set {
     61        if (hiveJobs != value) {
     62          if (hiveJobs != null) DeregisterHiveJobsEvents();
     63          hiveJobs = value;
     64          if (hiveJobs != null) RegisterHiveJobsEvents();
     65          OnHiveJobsChanged();
     66        }
     67      }
     68    }
     69
     70    private ExecutionState executionState;
     71    public ExecutionState ExecutionState {
     72      get { return executionState; }
     73      internal set {
     74        if (executionState != value) {
     75          executionState = value;
     76          OnExecutionStateChanged();
     77        }
     78      }
     79    }
     80
     81    private TimeSpan executionTime;
     82    public TimeSpan ExecutionTime {
     83      get { return executionTime; }
     84      internal set {
     85        if (executionTime != value) {
     86          executionTime = value;
     87          OnExecutionTimeChanged();
    4888        }
    4989      }
     
    60100          }
    61101          if (RefreshAutomatically) {
    62             if (hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) {
     102            if (this.HiveJobs != null && this.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) {
    63103              StartResultPolling();
    64104            }
     
    70110    }
    71111
    72     // if true, all control buttons should be enabled. otherwise disabled (used for HiveEngine)
     112    // indicates if download button is enabled
     113    private bool isDownloadable = true;
     114    public bool IsDownloadable {
     115      get { return isDownloadable; }
     116      set {
     117        if (value != isDownloadable) {
     118          isDownloadable = value;
     119          OnIsDownloadableChanged();
     120        }
     121      }
     122    }
     123
     124    // if true, all control buttons should be enabled. otherwise disabled
    73125    private bool isControllable = true;
    74126    public bool IsControllable {
    75127      get { return isControllable; }
    76       set {
     128      private set {
    77129        if (value != isControllable) {
    78130          isControllable = value;
    79131          OnIsControllableChanged();
    80         }
    81       }
     132          if (this.hiveJobs != null) {
     133            foreach (var hiveJob in this.hiveJobs) {
     134              hiveJob.IsControllable = value;
     135            }
     136          }
     137        }
     138      }
     139    }
     140
     141    // indicates if a user is allowed to share this experiment
     142    private bool isSharable = true;
     143    public bool IsSharable {
     144      get { return isSharable; }
     145      private set {
     146        if (value != isSharable) {
     147          isSharable = value;
     148          OnIsSharableChanged();
     149        }
     150      }
     151    }
     152
     153    // may execute jobs with privileged permissions on slaves
     154    private bool isAllowedPrivileged = true;
     155    public bool IsAllowedPrivileged {
     156      get { return isAllowedPrivileged; }
     157      set {
     158        if (value != isAllowedPrivileged) {
     159          isAllowedPrivileged = value;
     160          OnIsAllowedPrivilegedChanged();
     161        }
     162      }
     163    }
     164
     165    private bool isProgressing;
     166    public bool IsProgressing {
     167      get { return isProgressing; }
     168      set {
     169        if (isProgressing != value) {
     170          isProgressing = value;
     171          OnIsProgressingChanged();
     172        }
     173      }
     174    }
     175
     176    private IProgress progress;
     177    public IProgress Progress {
     178      get { return progress; }
     179      set { this.progress = value; }
    82180    }
    83181
     
    85183    public ILog Log {
    86184      get { return log; }
     185    }
     186
     187    public StateLogListList StateLogList {
     188      get { return new StateLogListList(this.GetAllHiveJobs().Select(x => x.StateLog)); }
    87189    }
    88190
     
    94196      this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2);
    95197      this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
     198      this.HiveJobs = new ItemCollection<HiveJob>();
    96199    }
    97200    public RefreshableHiveExperiment(HiveExperiment hiveExperiment) {
     
    101204      this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2);
    102205      this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
     206      this.HiveJobs = new ItemCollection<HiveJob>();
    103207    }
    104208    protected RefreshableHiveExperiment(RefreshableHiveExperiment original, Cloner cloner) {
     
    110214      this.jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2);
    111215      this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
     216      this.HiveJobs = cloner.Clone(original.HiveJobs);
     217      this.ExecutionTime = original.ExecutionTime;
     218      this.ExecutionState = original.ExecutionState;
    112219    }
    113220    public IDeepCloneable Clone(Cloner cloner) {
     
    118225    }
    119226    #endregion
    120 
    121     private void hiveExperiment_HiveJobsChanged(object sender, EventArgs e) {
    122       if (jobResultPoller != null && jobResultPoller.IsPolling) {
    123         jobResultPoller.Stop();
    124         DeregisterResultPollingEvents();
    125       }
    126       if (hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && hiveExperiment.GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) {
    127         if (this.RefreshAutomatically)
    128           StartResultPolling();
    129       }
    130     }
    131 
     227   
    132228    #region JobResultPoller Events
    133229
     
    212308      GC.Collect(); // force GC, because .NET is too lazy here (deserialization takes a lot of memory)
    213309      if (AllJobsFinished()) {
    214         hiveExperiment.ExecutionState = Core.ExecutionState.Stopped;
     310        this.ExecutionState = Core.ExecutionState.Stopped;
    215311        StopResultPolling();
    216312      }
     
    221317
    222318    public HiveJob GetHiveJobById(Guid jobId) {
    223       foreach (HiveJob job in hiveExperiment.HiveJobs) {
     319      foreach (HiveJob job in this.HiveJobs) {
    224320        var hj = job.GetHiveJobByJobId(jobId);
    225321        if (hj != null)
     
    229325    }
    230326    private void UpdateStatistics() {
    231       var jobs = hiveExperiment.GetAllHiveJobs();
     327      var jobs = this.GetAllHiveJobs();
    232328      hiveExperiment.JobCount = jobs.Count();
    233329      hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating);
     
    237333
    238334    public bool AllJobsFinished() {
    239       return hiveExperiment.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished
     335      return this.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished
    240336                                                   || j.Job.State == JobState.Aborted
    241337                                                   || j.Job.State == JobState.Failed)
     
    250346    }
    251347    public void UpdateTotalExecutionTime() {
    252       hiveExperiment.ExecutionTime = TimeSpan.FromMilliseconds(hiveExperiment.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.TotalMilliseconds));
     348      this.ExecutionTime = TimeSpan.FromMilliseconds(this.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.TotalMilliseconds));
    253349    }
    254350    #endregion
     
    256352    #region HiveExperiment Events
    257353    private void RegisterHiveExperimentEvents() {
    258       hiveExperiment.HiveJobsChanged += new EventHandler(hiveExperiment_HiveJobsChanged);
    259       hiveExperiment.ToStringChanged += new EventHandler(hiveExperiment_ToStringChanged);
     354      hiveExperiment.ToStringChanged += new EventHandler(OnToStringChanged);
    260355      hiveExperiment.PropertyChanged += new PropertyChangedEventHandler(hiveExperiment_PropertyChanged);
    261356      hiveExperiment.ItemImageChanged += new EventHandler(hiveExperiment_ItemImageChanged);
    262357      hiveExperiment.ModifiedChanged += new EventHandler(hiveExperiment_ModifiedChanged);
    263       hiveExperiment.IsProgressingChanged += new EventHandler(hiveExperiment_IsProgressingChanged);
    264       hiveExperiment.Loaded += new EventHandler(hiveExperiment_Loaded);
    265358    }
    266359
    267360    private void DergisterHiveExperimentEvents() {
    268       hiveExperiment.HiveJobsChanged -= new EventHandler(hiveExperiment_HiveJobsChanged);
    269       hiveExperiment.ToStringChanged -= new EventHandler(hiveExperiment_ToStringChanged);
     361      hiveExperiment.ToStringChanged -= new EventHandler(OnToStringChanged);
    270362      hiveExperiment.PropertyChanged -= new PropertyChangedEventHandler(hiveExperiment_PropertyChanged);
    271363      hiveExperiment.ItemImageChanged -= new EventHandler(hiveExperiment_ItemImageChanged);
    272364      hiveExperiment.ModifiedChanged -= new EventHandler(hiveExperiment_ModifiedChanged);
    273       hiveExperiment.IsProgressingChanged -= new EventHandler(hiveExperiment_IsProgressingChanged);
    274       hiveExperiment.Loaded -= new EventHandler(hiveExperiment_Loaded);
    275     }
    276 
    277     private void hiveExperiment_Loaded(object sender, EventArgs e) {
    278       this.UpdateTotalExecutionTime();
    279 
    280       if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {
    281         this.RefreshAutomatically = true;
    282       }
    283365    }
    284366    #endregion
     
    311393    public event PropertyChangedEventHandler PropertyChanged;
    312394    private void hiveExperiment_PropertyChanged(object sender, PropertyChangedEventArgs e) {
     395      this.IsSharable = hiveExperiment.Permission == Permission.Full;
     396      this.IsControllable = hiveExperiment.Permission == Permission.Full;
     397
    313398      var handler = PropertyChanged;
    314399      if (handler != null) handler(sender, e);
     
    316401
    317402    public event EventHandler ToStringChanged;
    318     private void hiveExperiment_ToStringChanged(object sender, EventArgs e) {
     403    private void OnToStringChanged(object sender, EventArgs e) {
    319404      var handler = ToStringChanged;
    320405      if (handler != null) handler(this, e);
     
    322407
    323408    public event EventHandler IsProgressingChanged;
    324     private void hiveExperiment_IsProgressingChanged(object sender, EventArgs e) {
     409    protected virtual void OnIsProgressingChanged() {
    325410      var handler = IsProgressingChanged;
    326       if (handler != null) handler(sender, e);
     411      if (handler != null) handler(this, EventArgs.Empty);
     412    }
     413
     414    public event EventHandler IsDownloadableChanged;
     415    private void OnIsDownloadableChanged() {
     416      var handler = IsDownloadableChanged;
     417      if (handler != null) handler(this, EventArgs.Empty);
    327418    }
    328419
     
    330421    private void OnIsControllableChanged() {
    331422      var handler = IsControllableChanged;
     423      if (handler != null) handler(this, EventArgs.Empty);
     424    }
     425
     426    public event EventHandler IsSharableChanged;
     427    private void OnIsSharableChanged() {
     428      var handler = IsSharableChanged;
     429      if (handler != null) handler(this, EventArgs.Empty);
     430    }
     431
     432    public event EventHandler IsAllowedPrivilegedChanged;
     433    private void OnIsAllowedPrivilegedChanged() {
     434      var handler = IsAllowedPrivilegedChanged;
    332435      if (handler != null) handler(this, EventArgs.Empty);
    333436    }
     
    351454      if (handler != null) handler(this, EventArgs.Empty);
    352455    }
     456
     457    public event EventHandler ExecutionTimeChanged;
     458    protected virtual void OnExecutionTimeChanged() {
     459      var handler = ExecutionTimeChanged;
     460      if (handler != null) handler(this, EventArgs.Empty);
     461    }
     462
     463    public event EventHandler ExecutionStateChanged;
     464    protected virtual void OnExecutionStateChanged() {
     465      var handler = ExecutionStateChanged;
     466      if (handler != null) handler(this, EventArgs.Empty);
     467    }
    353468    #endregion
     469
     470    #region HiveJobs Events
     471    private void RegisterHiveJobsEvents() {
     472      this.hiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);
     473      this.hiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);
     474      this.hiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);
     475    }
     476
     477    private void DeregisterHiveJobsEvents() {
     478      this.hiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);
     479      this.hiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);
     480      this.hiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);
     481    }
     482
     483    private void hiveJobs_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
     484      foreach (var item in e.Items) {
     485        item.StateLogChanged -= new EventHandler(item_StateLogChanged);
     486      }
     487      OnHiveJobsReset(e);
     488    }
     489
     490    private void hiveJobs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
     491      foreach (var item in e.Items) {
     492        item.StateLogChanged -= new EventHandler(item_StateLogChanged);
     493      }
     494      OnHiveJobsRemoved(e);
     495    }
     496
     497    private void hiveJobs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
     498      foreach (var item in e.Items) {
     499        item.StateLogChanged += new EventHandler(item_StateLogChanged);
     500        item.IsControllable = this.IsControllable;
     501      }
     502      OnHiveJobsAdded(e);
     503    }
     504
     505    private void item_StateLogChanged(object sender, EventArgs e) {
     506      OnStateLogListChanged();
     507    }
     508    #endregion
     509
     510    public event EventHandler HiveJobsChanged;
     511    protected virtual void OnHiveJobsChanged() {
     512      if (jobResultPoller != null && jobResultPoller.IsPolling) {
     513        jobResultPoller.Stop();
     514        DeregisterResultPollingEvents();
     515      }
     516      if (this.HiveJobs != null && this.HiveJobs.Count > 0 && this.GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) {
     517        if (this.RefreshAutomatically)
     518          StartResultPolling();
     519      }
     520
     521      var handler = HiveJobsChanged;
     522      if (handler != null) handler(this, EventArgs.Empty);
     523    }
     524
     525    public event EventHandler Loaded;
     526    public virtual void OnLoaded() {
     527      this.UpdateTotalExecutionTime();
     528
     529      if (this.ExecutionState != ExecutionState.Stopped) {
     530        this.RefreshAutomatically = true;
     531      }
     532
     533      var handler = Loaded;
     534      if (handler != null) handler(this, EventArgs.Empty);
     535    }
     536
     537    public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsAdded;
     538    private void OnHiveJobsAdded(CollectionItemsChangedEventArgs<HiveJob> e) {
     539      var handler = HiveJobsAdded;
     540      if (handler != null) handler(this, e);
     541    }
     542
     543    public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsRemoved;
     544    private void OnHiveJobsRemoved(CollectionItemsChangedEventArgs<HiveJob> e) {
     545      var handler = HiveJobsRemoved;
     546      if (handler != null) handler(this, e);
     547    }
     548
     549    public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsReset;
     550    private void OnHiveJobsReset(CollectionItemsChangedEventArgs<HiveJob> e) {
     551      var handler = HiveJobsReset;
     552      if (handler != null) handler(this, e);
     553    }
    354554
    355555    public Guid Id {
     
    375575      get { return hiveExperiment.ItemVersion; }
    376576    }
    377    
    378     #region IProgressReporter Members
    379     public IProgress Progress {
    380       get { return HiveExperiment.Progress; }
    381     }
    382 
    383     public bool IsProgressing {
    384       get { return HiveExperiment.IsProgressing; }
    385     }
    386     #endregion
    387577
    388578    public override string ToString() {
    389579      return string.Format("{0} {1}", HiveExperiment.DateCreated.ToString("MM.dd.yyyy HH:mm"), HiveExperiment.ToString());
    390580    }
     581
     582    public bool IsFinished() {
     583      return HiveJobs != null
     584        && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue);
     585    }
     586
     587    public IEnumerable<HiveJob> GetAllHiveJobs() {
     588      if (hiveJobs == null) return Enumerable.Empty<HiveJob>();
     589
     590      var jobs = new List<HiveJob>();
     591      foreach (HiveJob job in HiveJobs) {
     592        jobs.AddRange(job.GetAllHiveJobs());
     593      }
     594      return jobs;
     595    }
     596
     597    public int CompareTo(RefreshableHiveExperiment other) {
     598      return this.ToString().CompareTo(other.ToString());
     599    }
    391600  }
    392601}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs

    r6426 r6479  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.ComponentModel;
    25 using System.Linq;
    26 using HeuristicLab.Collections;
    2724using HeuristicLab.Common;
    28 using HeuristicLab.Core;
    2925
    3026namespace HeuristicLab.Clients.Hive {
    31   public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter {
     27  public partial class HiveExperiment : IDeepCloneable, IContent {
    3228
    3329    private bool isPrivileged;
     
    3733    }
    3834
    39     private ExecutionState executionState;
    40     public ExecutionState ExecutionState {
    41       get { return executionState; }
    42       internal set {
    43         if (executionState != value) {
    44           executionState = value;
    45           OnExecutionStateChanged();
    46         }
    47       }
    48     }
    49 
    50     private TimeSpan executionTime;
    51     public TimeSpan ExecutionTime {
    52       get { return executionTime; }
    53       internal set {
    54         if (executionTime != value) {
    55           executionTime = value;
    56           OnExecutionTimeChanged();
    57         }
    58       }
    59     }
    60 
    61     private ItemCollection<HiveJob> hiveJobs;
    62     public ItemCollection<HiveJob> HiveJobs {
    63       get { return hiveJobs; }
    64       set {
    65         if (hiveJobs != value) {
    66           if (hiveJobs != null) DeregisterHiveJobsEvents();
    67           hiveJobs = value;
    68           if (hiveJobs != null) RegisterHiveJobsEvents();
    69           OnHiveJobsChanged();
    70         }
    71       }
    72     }
    73 
    74     private bool isProgressing;
    75     public bool IsProgressing {
    76       get { return isProgressing; }
    77       set {
    78         if (isProgressing != value) {
    79           isProgressing = value;
    80           OnIsProgressingChanged();
    81         }
    82       }
    83     }
    84 
    85     private IProgress progress;
    86     public IProgress Progress {
    87       get { return progress; }
    88       set { this.progress = value; }
    89     }
    90 
    91     public StateLogListList StateLogList {
    92       get { return new StateLogListList(this.GetAllHiveJobs().Select(x => x.StateLog)); }
    93     }
    94 
    9535    #region Constructors and Cloning
    9636    public HiveExperiment() {
    9737      this.ResourceNames = "HEAL";
    98       this.HiveJobs = new ItemCollection<HiveJob>();
    9938      this.DateCreated = DateTime.Now;
     39      this.Permission = Permission.Full;
    10040    }
    10141
     
    10949      this.Description = original.Description;
    11050      this.Id = original.Id;
    111       this.HiveJobs = cloner.Clone(original.HiveJobs);
    112       this.ExecutionTime = original.ExecutionTime;
    11351      this.IsPrivileged = original.IsPrivileged;
     52      this.Permission = original.Permission;
    11453    }
    11554    public override IDeepCloneable Clone(Cloner cloner) {
     
    11958
    12059    #region Events
    121     public event EventHandler ExecutionTimeChanged;
    122     protected virtual void OnExecutionTimeChanged() {
    123       var handler = ExecutionTimeChanged;
    124       if (handler != null) handler(this, EventArgs.Empty);
    125     }
    126 
    127     public event EventHandler ExecutionStateChanged;
    128     protected virtual void OnExecutionStateChanged() {
    129       var handler = ExecutionStateChanged;
    130       if (handler != null) handler(this, EventArgs.Empty);
    131     }
    132 
    133     public event EventHandler HiveJobsChanged;
    134     protected virtual void OnHiveJobsChanged() {
    135       var handler = HiveJobsChanged;
    136       if (handler != null) handler(this, EventArgs.Empty);
    137     }
    138 
    139     public event EventHandler IsProgressingChanged;
    140     protected virtual void OnIsProgressingChanged() {
    141       var handler = IsProgressingChanged;
    142       if (handler != null) handler(this, EventArgs.Empty);
    143     }
    144 
    145     public event EventHandler Loaded;
    146     public virtual void OnLoaded() {
    147       var handler = Loaded;
    148       if (handler != null) handler(this, EventArgs.Empty);
    149     }
    150 
    151     public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsAdded;
    152     private void OnHiveJobsAdded(CollectionItemsChangedEventArgs<HiveJob> e) {
    153       var handler = HiveJobsAdded;
    154       if (handler != null) handler(this, e);
    155     }
    156 
    157     public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsRemoved;
    158     private void OnHiveJobsRemoved(CollectionItemsChangedEventArgs<HiveJob> e) {
    159       var handler = HiveJobsRemoved;
    160       if (handler != null) handler(this, e);
    161     }
    162 
    163     public event EventHandler<CollectionItemsChangedEventArgs<HiveJob>> HiveJobsReset;
    164     private void OnHiveJobsReset(CollectionItemsChangedEventArgs<HiveJob> e) {
    165       var handler = HiveJobsReset;
    166       if (handler != null) handler(this, e);
    167     }
    168 
    16960    public event EventHandler StateLogListChanged;
    17061    private void OnStateLogListChanged() {
    17162      var handler = StateLogListChanged;
    17263      if (handler != null) handler(this, EventArgs.Empty);
    173     }
    174     #endregion
    175 
    176     #region HiveJobs Events
    177     private void RegisterHiveJobsEvents() {
    178       this.hiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);
    179       this.hiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);
    180       this.hiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);
    181     }
    182 
    183     private void DeregisterHiveJobsEvents() {
    184       this.hiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsAdded);
    185       this.hiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_ItemsRemoved);
    186       this.hiveJobs.CollectionReset -= new CollectionItemsChangedEventHandler<HiveJob>(hiveJobs_CollectionReset);
    187     }
    188 
    189     private void hiveJobs_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
    190       foreach (var item in e.Items) {
    191         item.StateLogChanged -= new EventHandler(item_StateLogChanged);
    192       }
    193       OnHiveJobsReset(e);
    194     }
    195 
    196     private void hiveJobs_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
    197       foreach (var item in e.Items) {
    198         item.StateLogChanged -= new EventHandler(item_StateLogChanged);
    199       }
    200       OnHiveJobsRemoved(e);
    201     }
    202 
    203     private void hiveJobs_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveJob> e) {
    204       foreach (var item in e.Items) {
    205         item.StateLogChanged += new EventHandler(item_StateLogChanged);
    206       }
    207       OnHiveJobsAdded(e);
    208     }
    209 
    210     private void item_StateLogChanged(object sender, EventArgs e) {
    211       OnStateLogListChanged();
    21264    }
    21365    #endregion
     
    22981    }
    23082
    231     public bool IsFinished() {
    232       return HiveJobs != null
    233         && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue);
    234     }
    235 
    236     public IEnumerable<HiveJob> GetAllHiveJobs() {
    237       if (hiveJobs == null) return Enumerable.Empty<HiveJob>();
    238 
    239       var jobs = new List<HiveJob>();
    240       foreach (HiveJob job in HiveJobs) {
    241         jobs.AddRange(job.GetAllHiveJobs());
    242       }
    243       return jobs;
    244     }
    245 
    24683    public override string ToString() {
    24784      return Name;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperimentPermission.cs

    r6465 r6479  
    2828    private string grantedUserName;
    2929    public string GrantedUserName {
    30       get { return this.grantedUserName; }
    31       set {
    32         this.grantedUserName = value;
    33         this.OnPropertyChanged(new PropertyChangedEventArgs("GrantedUserName"));
     30      get { return grantedUserName; }
     31      set {
     32        if (value != grantedUserName) {
     33          grantedUserName = value;
     34          RaisePropertyChanged("GrantedUserName");
     35        }
    3436      }
    3537    }
     
    3739    #region Constructors and Cloning
    3840    public HiveExperimentPermission() {
    39       this.Permission = Hive.Permission.Read;
     41      this.Permission = Permission.Read;
    4042      this.PropertyChanged += new PropertyChangedEventHandler(HiveExperimentPermission_PropertyChanged);
    4143    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveItem.cs

    r6444 r6479  
    5050    public bool Modified {
    5151      get { return modified; }
    52       private set {
     52      internal set {
    5353        if (value != modified) {
    5454          modified = value;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs

    r6465 r6479  
    1414  [System.Diagnostics.DebuggerStepThroughAttribute()]
    1515    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    16     [System.Runtime.Serialization.DataContractAttribute(Name="Job", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    17         "nsfer")]
    18     [System.SerializableAttribute()]
    19     public partial class Job : HeuristicLab.Clients.Hive.LightweightJob
    20     {
    21        
    22         [System.Runtime.Serialization.OptionalFieldAttribute()]
    23         private int CoresNeededField;
    24        
    25         [System.Runtime.Serialization.OptionalFieldAttribute()]
    26         private bool FinishWhenChildJobsFinishedField;
    27        
    28         [System.Runtime.Serialization.OptionalFieldAttribute()]
    29         private System.Guid HiveExperimentIdField;
    30        
    31         [System.Runtime.Serialization.OptionalFieldAttribute()]
    32         private bool IsParentJobField;
    33        
    34         [System.Runtime.Serialization.OptionalFieldAttribute()]
    35         private bool IsPrivilegedField;
    36        
    37         [System.Runtime.Serialization.OptionalFieldAttribute()]
    38         private System.Nullable<System.DateTime> LastHeartbeatField;
    39        
    40         [System.Runtime.Serialization.OptionalFieldAttribute()]
    41         private int MemoryNeededField;
    42        
    43         [System.Runtime.Serialization.OptionalFieldAttribute()]
    44         private System.Collections.Generic.List<System.Guid> PluginsNeededIdsField;
    45        
    46         [System.Runtime.Serialization.OptionalFieldAttribute()]
    47         private int PriorityField;
    48        
    49         [System.Runtime.Serialization.DataMemberAttribute()]
    50         public int CoresNeeded
    51         {
    52             get
    53             {
    54                 return this.CoresNeededField;
    55             }
    56             set
    57             {
    58                 if ((this.CoresNeededField.Equals(value) != true))
    59                 {
    60                     this.CoresNeededField = value;
    61                     this.RaisePropertyChanged("CoresNeeded");
    62                 }
    63             }
    64         }
    65        
    66         [System.Runtime.Serialization.DataMemberAttribute()]
    67         public bool FinishWhenChildJobsFinished
    68         {
    69             get
    70             {
    71                 return this.FinishWhenChildJobsFinishedField;
    72             }
    73             set
    74             {
    75                 if ((this.FinishWhenChildJobsFinishedField.Equals(value) != true))
    76                 {
    77                     this.FinishWhenChildJobsFinishedField = value;
    78                     this.RaisePropertyChanged("FinishWhenChildJobsFinished");
    79                 }
    80             }
    81         }
    82        
    83         [System.Runtime.Serialization.DataMemberAttribute()]
    84         public System.Guid HiveExperimentId
    85         {
    86             get
    87             {
    88                 return this.HiveExperimentIdField;
    89             }
    90             set
    91             {
    92                 if ((this.HiveExperimentIdField.Equals(value) != true))
    93                 {
    94                     this.HiveExperimentIdField = value;
    95                     this.RaisePropertyChanged("HiveExperimentId");
    96                 }
    97             }
    98         }
    99        
    100         [System.Runtime.Serialization.DataMemberAttribute()]
    101         public bool IsParentJob
    102         {
    103             get
    104             {
    105                 return this.IsParentJobField;
    106             }
    107             set
    108             {
    109                 if ((this.IsParentJobField.Equals(value) != true))
    110                 {
    111                     this.IsParentJobField = value;
    112                     this.RaisePropertyChanged("IsParentJob");
    113                 }
    114             }
    115         }
    116        
    117         [System.Runtime.Serialization.DataMemberAttribute()]
    118         public bool IsPrivileged
    119         {
    120             get
    121             {
    122                 return this.IsPrivilegedField;
    123             }
    124             set
    125             {
    126                 if ((this.IsPrivilegedField.Equals(value) != true))
    127                 {
    128                     this.IsPrivilegedField = value;
    129                     this.RaisePropertyChanged("IsPrivileged");
    130                 }
    131             }
    132         }
    133        
    134         [System.Runtime.Serialization.DataMemberAttribute()]
    135         public System.Nullable<System.DateTime> LastHeartbeat
    136         {
    137             get
    138             {
    139                 return this.LastHeartbeatField;
    140             }
    141             set
    142             {
    143                 if ((this.LastHeartbeatField.Equals(value) != true))
    144                 {
    145                     this.LastHeartbeatField = value;
    146                     this.RaisePropertyChanged("LastHeartbeat");
    147                 }
    148             }
    149         }
    150        
    151         [System.Runtime.Serialization.DataMemberAttribute()]
    152         public int MemoryNeeded
    153         {
    154             get
    155             {
    156                 return this.MemoryNeededField;
    157             }
    158             set
    159             {
    160                 if ((this.MemoryNeededField.Equals(value) != true))
    161                 {
    162                     this.MemoryNeededField = value;
    163                     this.RaisePropertyChanged("MemoryNeeded");
    164                 }
    165             }
    166         }
    167        
    168         [System.Runtime.Serialization.DataMemberAttribute()]
    169         public System.Collections.Generic.List<System.Guid> PluginsNeededIds
    170         {
    171             get
    172             {
    173                 return this.PluginsNeededIdsField;
    174             }
    175             set
    176             {
    177                 if ((object.ReferenceEquals(this.PluginsNeededIdsField, value) != true))
    178                 {
    179                     this.PluginsNeededIdsField = value;
    180                     this.RaisePropertyChanged("PluginsNeededIds");
    181                 }
    182             }
    183         }
    184        
    185         [System.Runtime.Serialization.DataMemberAttribute()]
    186         public int Priority
    187         {
    188             get
    189             {
    190                 return this.PriorityField;
    191             }
    192             set
    193             {
    194                 if ((this.PriorityField.Equals(value) != true))
    195                 {
    196                     this.PriorityField = value;
    197                     this.RaisePropertyChanged("Priority");
    198                 }
    199             }
    200         }
    201     }
    202    
    203     [System.Diagnostics.DebuggerStepThroughAttribute()]
    204     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    20516    [System.Runtime.Serialization.DataContractAttribute(Name="HiveItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    20617        "nsfer")]
    20718    [System.SerializableAttribute()]
     19    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.LightweightJob))]
    20820    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.StateLog))]
     21    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]
    20922    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Downtime))]
     23    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperimentPermission))]
     24    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))]
    21025    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.NamedHiveItem))]
    21126    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperiment))]
     27    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]
    21228    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))]
    21329    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Slave))]
    21430    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))]
    215     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]
    216     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperimentPermission))]
    217     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.PluginData))]
    218     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.LightweightJob))]
    219     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]
    22031    public partial class HiveItem : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
    22132    {
     
    27081    [System.Diagnostics.DebuggerStepThroughAttribute()]
    27182    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     83    [System.Runtime.Serialization.DataContractAttribute(Name="LightweightJob", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
     84        "nsfer")]
     85    [System.SerializableAttribute()]
     86    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]
     87    public partial class LightweightJob : HeuristicLab.Clients.Hive.HiveItem
     88    {
     89       
     90        [System.Runtime.Serialization.OptionalFieldAttribute()]
     91        private System.Nullable<HeuristicLab.Clients.Hive.Command> CommandField;
     92       
     93        [System.Runtime.Serialization.OptionalFieldAttribute()]
     94        private System.TimeSpan ExecutionTimeField;
     95       
     96        [System.Runtime.Serialization.OptionalFieldAttribute()]
     97        private System.DateTime LastJobDataUpdateField;
     98       
     99        [System.Runtime.Serialization.OptionalFieldAttribute()]
     100        private System.Nullable<System.Guid> ParentJobIdField;
     101       
     102        [System.Runtime.Serialization.OptionalFieldAttribute()]
     103        private HeuristicLab.Clients.Hive.JobState StateField;
     104       
     105        [System.Runtime.Serialization.OptionalFieldAttribute()]
     106        private System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLogField;
     107       
     108        [System.Runtime.Serialization.DataMemberAttribute()]
     109        public System.Nullable<HeuristicLab.Clients.Hive.Command> Command
     110        {
     111            get
     112            {
     113                return this.CommandField;
     114            }
     115            set
     116            {
     117                if ((this.CommandField.Equals(value) != true))
     118                {
     119                    this.CommandField = value;
     120                    this.RaisePropertyChanged("Command");
     121                }
     122            }
     123        }
     124       
     125        [System.Runtime.Serialization.DataMemberAttribute()]
     126        public System.TimeSpan ExecutionTime
     127        {
     128            get
     129            {
     130                return this.ExecutionTimeField;
     131            }
     132            set
     133            {
     134                if ((this.ExecutionTimeField.Equals(value) != true))
     135                {
     136                    this.ExecutionTimeField = value;
     137                    this.RaisePropertyChanged("ExecutionTime");
     138                }
     139            }
     140        }
     141       
     142        [System.Runtime.Serialization.DataMemberAttribute()]
     143        public System.DateTime LastJobDataUpdate
     144        {
     145            get
     146            {
     147                return this.LastJobDataUpdateField;
     148            }
     149            set
     150            {
     151                if ((this.LastJobDataUpdateField.Equals(value) != true))
     152                {
     153                    this.LastJobDataUpdateField = value;
     154                    this.RaisePropertyChanged("LastJobDataUpdate");
     155                }
     156            }
     157        }
     158       
     159        [System.Runtime.Serialization.DataMemberAttribute()]
     160        public System.Nullable<System.Guid> ParentJobId
     161        {
     162            get
     163            {
     164                return this.ParentJobIdField;
     165            }
     166            set
     167            {
     168                if ((this.ParentJobIdField.Equals(value) != true))
     169                {
     170                    this.ParentJobIdField = value;
     171                    this.RaisePropertyChanged("ParentJobId");
     172                }
     173            }
     174        }
     175       
     176        [System.Runtime.Serialization.DataMemberAttribute()]
     177        public HeuristicLab.Clients.Hive.JobState State
     178        {
     179            get
     180            {
     181                return this.StateField;
     182            }
     183            set
     184            {
     185                if ((this.StateField.Equals(value) != true))
     186                {
     187                    this.StateField = value;
     188                    this.RaisePropertyChanged("State");
     189                }
     190            }
     191        }
     192       
     193        [System.Runtime.Serialization.DataMemberAttribute()]
     194        public System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLog
     195        {
     196            get
     197            {
     198                return this.StateLogField;
     199            }
     200            set
     201            {
     202                if ((object.ReferenceEquals(this.StateLogField, value) != true))
     203                {
     204                    this.StateLogField = value;
     205                    this.RaisePropertyChanged("StateLog");
     206                }
     207            }
     208        }
     209    }
     210   
     211    [System.Diagnostics.DebuggerStepThroughAttribute()]
     212    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    272213    [System.Runtime.Serialization.DataContractAttribute(Name="StateLog", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    273214        "nsfer")]
     
    392333                    this.UserIdField = value;
    393334                    this.RaisePropertyChanged("UserId");
     335                }
     336            }
     337        }
     338    }
     339   
     340    [System.Diagnostics.DebuggerStepThroughAttribute()]
     341    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     342    [System.Runtime.Serialization.DataContractAttribute(Name="Job", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
     343        "nsfer")]
     344    [System.SerializableAttribute()]
     345    public partial class Job : HeuristicLab.Clients.Hive.LightweightJob
     346    {
     347       
     348        [System.Runtime.Serialization.OptionalFieldAttribute()]
     349        private int CoresNeededField;
     350       
     351        [System.Runtime.Serialization.OptionalFieldAttribute()]
     352        private bool FinishWhenChildJobsFinishedField;
     353       
     354        [System.Runtime.Serialization.OptionalFieldAttribute()]
     355        private System.Guid HiveExperimentIdField;
     356       
     357        [System.Runtime.Serialization.OptionalFieldAttribute()]
     358        private bool IsParentJobField;
     359       
     360        [System.Runtime.Serialization.OptionalFieldAttribute()]
     361        private bool IsPrivilegedField;
     362       
     363        [System.Runtime.Serialization.OptionalFieldAttribute()]
     364        private System.Nullable<System.DateTime> LastHeartbeatField;
     365       
     366        [System.Runtime.Serialization.OptionalFieldAttribute()]
     367        private int MemoryNeededField;
     368       
     369        [System.Runtime.Serialization.OptionalFieldAttribute()]
     370        private System.Collections.Generic.List<System.Guid> PluginsNeededIdsField;
     371       
     372        [System.Runtime.Serialization.OptionalFieldAttribute()]
     373        private int PriorityField;
     374       
     375        [System.Runtime.Serialization.DataMemberAttribute()]
     376        public int CoresNeeded
     377        {
     378            get
     379            {
     380                return this.CoresNeededField;
     381            }
     382            set
     383            {
     384                if ((this.CoresNeededField.Equals(value) != true))
     385                {
     386                    this.CoresNeededField = value;
     387                    this.RaisePropertyChanged("CoresNeeded");
     388                }
     389            }
     390        }
     391       
     392        [System.Runtime.Serialization.DataMemberAttribute()]
     393        public bool FinishWhenChildJobsFinished
     394        {
     395            get
     396            {
     397                return this.FinishWhenChildJobsFinishedField;
     398            }
     399            set
     400            {
     401                if ((this.FinishWhenChildJobsFinishedField.Equals(value) != true))
     402                {
     403                    this.FinishWhenChildJobsFinishedField = value;
     404                    this.RaisePropertyChanged("FinishWhenChildJobsFinished");
     405                }
     406            }
     407        }
     408       
     409        [System.Runtime.Serialization.DataMemberAttribute()]
     410        public System.Guid HiveExperimentId
     411        {
     412            get
     413            {
     414                return this.HiveExperimentIdField;
     415            }
     416            set
     417            {
     418                if ((this.HiveExperimentIdField.Equals(value) != true))
     419                {
     420                    this.HiveExperimentIdField = value;
     421                    this.RaisePropertyChanged("HiveExperimentId");
     422                }
     423            }
     424        }
     425       
     426        [System.Runtime.Serialization.DataMemberAttribute()]
     427        public bool IsParentJob
     428        {
     429            get
     430            {
     431                return this.IsParentJobField;
     432            }
     433            set
     434            {
     435                if ((this.IsParentJobField.Equals(value) != true))
     436                {
     437                    this.IsParentJobField = value;
     438                    this.RaisePropertyChanged("IsParentJob");
     439                }
     440            }
     441        }
     442       
     443        [System.Runtime.Serialization.DataMemberAttribute()]
     444        public bool IsPrivileged
     445        {
     446            get
     447            {
     448                return this.IsPrivilegedField;
     449            }
     450            set
     451            {
     452                if ((this.IsPrivilegedField.Equals(value) != true))
     453                {
     454                    this.IsPrivilegedField = value;
     455                    this.RaisePropertyChanged("IsPrivileged");
     456                }
     457            }
     458        }
     459       
     460        [System.Runtime.Serialization.DataMemberAttribute()]
     461        public System.Nullable<System.DateTime> LastHeartbeat
     462        {
     463            get
     464            {
     465                return this.LastHeartbeatField;
     466            }
     467            set
     468            {
     469                if ((this.LastHeartbeatField.Equals(value) != true))
     470                {
     471                    this.LastHeartbeatField = value;
     472                    this.RaisePropertyChanged("LastHeartbeat");
     473                }
     474            }
     475        }
     476       
     477        [System.Runtime.Serialization.DataMemberAttribute()]
     478        public int MemoryNeeded
     479        {
     480            get
     481            {
     482                return this.MemoryNeededField;
     483            }
     484            set
     485            {
     486                if ((this.MemoryNeededField.Equals(value) != true))
     487                {
     488                    this.MemoryNeededField = value;
     489                    this.RaisePropertyChanged("MemoryNeeded");
     490                }
     491            }
     492        }
     493       
     494        [System.Runtime.Serialization.DataMemberAttribute()]
     495        public System.Collections.Generic.List<System.Guid> PluginsNeededIds
     496        {
     497            get
     498            {
     499                return this.PluginsNeededIdsField;
     500            }
     501            set
     502            {
     503                if ((object.ReferenceEquals(this.PluginsNeededIdsField, value) != true))
     504                {
     505                    this.PluginsNeededIdsField = value;
     506                    this.RaisePropertyChanged("PluginsNeededIds");
     507                }
     508            }
     509        }
     510       
     511        [System.Runtime.Serialization.DataMemberAttribute()]
     512        public int Priority
     513        {
     514            get
     515            {
     516                return this.PriorityField;
     517            }
     518            set
     519            {
     520                if ((this.PriorityField.Equals(value) != true))
     521                {
     522                    this.PriorityField = value;
     523                    this.RaisePropertyChanged("Priority");
    394524                }
    395525            }
     
    528658    [System.Diagnostics.DebuggerStepThroughAttribute()]
    529659    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     660    [System.Runtime.Serialization.DataContractAttribute(Name="HiveExperimentPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
     661        "nsfer")]
     662    [System.SerializableAttribute()]
     663    public partial class HiveExperimentPermission : HeuristicLab.Clients.Hive.HiveItem
     664    {
     665       
     666        [System.Runtime.Serialization.OptionalFieldAttribute()]
     667        private System.Guid GrantedByUserIdField;
     668       
     669        [System.Runtime.Serialization.OptionalFieldAttribute()]
     670        private System.Guid GrantedUserIdField;
     671       
     672        [System.Runtime.Serialization.OptionalFieldAttribute()]
     673        private System.Guid HiveExperimentIdField;
     674       
     675        [System.Runtime.Serialization.OptionalFieldAttribute()]
     676        private HeuristicLab.Clients.Hive.Permission PermissionField;
     677       
     678        [System.Runtime.Serialization.DataMemberAttribute()]
     679        public System.Guid GrantedByUserId
     680        {
     681            get
     682            {
     683                return this.GrantedByUserIdField;
     684            }
     685            set
     686            {
     687                if ((this.GrantedByUserIdField.Equals(value) != true))
     688                {
     689                    this.GrantedByUserIdField = value;
     690                    this.RaisePropertyChanged("GrantedByUserId");
     691                }
     692            }
     693        }
     694       
     695        [System.Runtime.Serialization.DataMemberAttribute()]
     696        public System.Guid GrantedUserId
     697        {
     698            get
     699            {
     700                return this.GrantedUserIdField;
     701            }
     702            set
     703            {
     704                if ((this.GrantedUserIdField.Equals(value) != true))
     705                {
     706                    this.GrantedUserIdField = value;
     707                    this.RaisePropertyChanged("GrantedUserId");
     708                }
     709            }
     710        }
     711       
     712        [System.Runtime.Serialization.DataMemberAttribute()]
     713        public System.Guid HiveExperimentId
     714        {
     715            get
     716            {
     717                return this.HiveExperimentIdField;
     718            }
     719            set
     720            {
     721                if ((this.HiveExperimentIdField.Equals(value) != true))
     722                {
     723                    this.HiveExperimentIdField = value;
     724                    this.RaisePropertyChanged("HiveExperimentId");
     725                }
     726            }
     727        }
     728       
     729        [System.Runtime.Serialization.DataMemberAttribute()]
     730        public HeuristicLab.Clients.Hive.Permission Permission
     731        {
     732            get
     733            {
     734                return this.PermissionField;
     735            }
     736            set
     737            {
     738                if ((this.PermissionField.Equals(value) != true))
     739                {
     740                    this.PermissionField = value;
     741                    this.RaisePropertyChanged("Permission");
     742                }
     743            }
     744        }
     745    }
     746   
     747    [System.Diagnostics.DebuggerStepThroughAttribute()]
     748    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     749    [System.Runtime.Serialization.DataContractAttribute(Name="PluginData", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
     750        "nsfer")]
     751    [System.SerializableAttribute()]
     752    public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem
     753    {
     754       
     755        [System.Runtime.Serialization.OptionalFieldAttribute()]
     756        private byte[] DataField;
     757       
     758        [System.Runtime.Serialization.OptionalFieldAttribute()]
     759        private string FileNameField;
     760       
     761        [System.Runtime.Serialization.OptionalFieldAttribute()]
     762        private System.Guid PluginIdField;
     763       
     764        [System.Runtime.Serialization.DataMemberAttribute()]
     765        public byte[] Data
     766        {
     767            get
     768            {
     769                return this.DataField;
     770            }
     771            set
     772            {
     773                if ((object.ReferenceEquals(this.DataField, value) != true))
     774                {
     775                    this.DataField = value;
     776                    this.RaisePropertyChanged("Data");
     777                }
     778            }
     779        }
     780       
     781        [System.Runtime.Serialization.DataMemberAttribute()]
     782        public string FileName
     783        {
     784            get
     785            {
     786                return this.FileNameField;
     787            }
     788            set
     789            {
     790                if ((object.ReferenceEquals(this.FileNameField, value) != true))
     791                {
     792                    this.FileNameField = value;
     793                    this.RaisePropertyChanged("FileName");
     794                }
     795            }
     796        }
     797       
     798        [System.Runtime.Serialization.DataMemberAttribute()]
     799        public System.Guid PluginId
     800        {
     801            get
     802            {
     803                return this.PluginIdField;
     804            }
     805            set
     806            {
     807                if ((this.PluginIdField.Equals(value) != true))
     808                {
     809                    this.PluginIdField = value;
     810                    this.RaisePropertyChanged("PluginId");
     811                }
     812            }
     813        }
     814    }
     815   
     816    [System.Diagnostics.DebuggerStepThroughAttribute()]
     817    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    530818    [System.Runtime.Serialization.DataContractAttribute(Name="NamedHiveItem", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    531819        "nsfer")]
    532820    [System.SerializableAttribute()]
    533821    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.HiveExperiment))]
     822    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]
    534823    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Resource))]
    535824    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Slave))]
    536825    [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.SlaveGroup))]
    537     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Plugin))]
    538826    public partial class NamedHiveItem : HeuristicLab.Clients.Hive.HiveItem
    539827    {
     
    7641052                    this.ResourceNamesField = value;
    7651053                    this.RaisePropertyChanged("ResourceNames");
     1054                }
     1055            }
     1056        }
     1057    }
     1058   
     1059    [System.Diagnostics.DebuggerStepThroughAttribute()]
     1060    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     1061    [System.Runtime.Serialization.DataContractAttribute(Name="Plugin", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
     1062        "nsfer")]
     1063    [System.SerializableAttribute()]
     1064    public partial class Plugin : HeuristicLab.Clients.Hive.NamedHiveItem
     1065    {
     1066       
     1067        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1068        private System.DateTime DateCreatedField;
     1069       
     1070        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1071        private byte[] HashField;
     1072       
     1073        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1074        private System.Guid UserIdField;
     1075       
     1076        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1077        private System.Version VersionField;
     1078       
     1079        [System.Runtime.Serialization.DataMemberAttribute()]
     1080        public System.DateTime DateCreated
     1081        {
     1082            get
     1083            {
     1084                return this.DateCreatedField;
     1085            }
     1086            set
     1087            {
     1088                if ((this.DateCreatedField.Equals(value) != true))
     1089                {
     1090                    this.DateCreatedField = value;
     1091                    this.RaisePropertyChanged("DateCreated");
     1092                }
     1093            }
     1094        }
     1095       
     1096        [System.Runtime.Serialization.DataMemberAttribute()]
     1097        public byte[] Hash
     1098        {
     1099            get
     1100            {
     1101                return this.HashField;
     1102            }
     1103            set
     1104            {
     1105                if ((object.ReferenceEquals(this.HashField, value) != true))
     1106                {
     1107                    this.HashField = value;
     1108                    this.RaisePropertyChanged("Hash");
     1109                }
     1110            }
     1111        }
     1112       
     1113        [System.Runtime.Serialization.DataMemberAttribute()]
     1114        public System.Guid UserId
     1115        {
     1116            get
     1117            {
     1118                return this.UserIdField;
     1119            }
     1120            set
     1121            {
     1122                if ((this.UserIdField.Equals(value) != true))
     1123                {
     1124                    this.UserIdField = value;
     1125                    this.RaisePropertyChanged("UserId");
     1126                }
     1127            }
     1128        }
     1129       
     1130        [System.Runtime.Serialization.DataMemberAttribute()]
     1131        public System.Version Version
     1132        {
     1133            get
     1134            {
     1135                return this.VersionField;
     1136            }
     1137            set
     1138            {
     1139                if ((object.ReferenceEquals(this.VersionField, value) != true))
     1140                {
     1141                    this.VersionField = value;
     1142                    this.RaisePropertyChanged("Version");
    7661143                }
    7671144            }
     
    10361413    public partial class SlaveGroup : HeuristicLab.Clients.Hive.Resource
    10371414    {
    1038     }
    1039    
    1040     [System.Diagnostics.DebuggerStepThroughAttribute()]
    1041     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1042     [System.Runtime.Serialization.DataContractAttribute(Name="Plugin", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    1043         "nsfer")]
    1044     [System.SerializableAttribute()]
    1045     public partial class Plugin : HeuristicLab.Clients.Hive.NamedHiveItem
    1046     {
    1047        
    1048         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1049         private System.DateTime DateCreatedField;
    1050        
    1051         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1052         private byte[] HashField;
    1053        
    1054         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1055         private System.Guid UserIdField;
    1056        
    1057         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1058         private System.Version VersionField;
    1059        
    1060         [System.Runtime.Serialization.DataMemberAttribute()]
    1061         public System.DateTime DateCreated
    1062         {
    1063             get
    1064             {
    1065                 return this.DateCreatedField;
    1066             }
    1067             set
    1068             {
    1069                 if ((this.DateCreatedField.Equals(value) != true))
    1070                 {
    1071                     this.DateCreatedField = value;
    1072                     this.RaisePropertyChanged("DateCreated");
    1073                 }
    1074             }
    1075         }
    1076        
    1077         [System.Runtime.Serialization.DataMemberAttribute()]
    1078         public byte[] Hash
    1079         {
    1080             get
    1081             {
    1082                 return this.HashField;
    1083             }
    1084             set
    1085             {
    1086                 if ((object.ReferenceEquals(this.HashField, value) != true))
    1087                 {
    1088                     this.HashField = value;
    1089                     this.RaisePropertyChanged("Hash");
    1090                 }
    1091             }
    1092         }
    1093        
    1094         [System.Runtime.Serialization.DataMemberAttribute()]
    1095         public System.Guid UserId
    1096         {
    1097             get
    1098             {
    1099                 return this.UserIdField;
    1100             }
    1101             set
    1102             {
    1103                 if ((this.UserIdField.Equals(value) != true))
    1104                 {
    1105                     this.UserIdField = value;
    1106                     this.RaisePropertyChanged("UserId");
    1107                 }
    1108             }
    1109         }
    1110        
    1111         [System.Runtime.Serialization.DataMemberAttribute()]
    1112         public System.Version Version
    1113         {
    1114             get
    1115             {
    1116                 return this.VersionField;
    1117             }
    1118             set
    1119             {
    1120                 if ((object.ReferenceEquals(this.VersionField, value) != true))
    1121                 {
    1122                     this.VersionField = value;
    1123                     this.RaisePropertyChanged("Version");
    1124                 }
    1125             }
    1126         }
    1127     }
    1128    
    1129     [System.Diagnostics.DebuggerStepThroughAttribute()]
    1130     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1131     [System.Runtime.Serialization.DataContractAttribute(Name="HiveExperimentPermission", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    1132         "nsfer")]
    1133     [System.SerializableAttribute()]
    1134     public partial class HiveExperimentPermission : HeuristicLab.Clients.Hive.HiveItem
    1135     {
    1136        
    1137         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1138         private System.Guid GrantedByUserIdField;
    1139        
    1140         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1141         private System.Guid GrantedUserIdField;
    1142        
    1143         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1144         private System.Guid HiveExperimentIdField;
    1145        
    1146         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1147         private HeuristicLab.Clients.Hive.Permission PermissionField;
    1148        
    1149         [System.Runtime.Serialization.DataMemberAttribute()]
    1150         public System.Guid GrantedByUserId
    1151         {
    1152             get
    1153             {
    1154                 return this.GrantedByUserIdField;
    1155             }
    1156             set
    1157             {
    1158                 if ((this.GrantedByUserIdField.Equals(value) != true))
    1159                 {
    1160                     this.GrantedByUserIdField = value;
    1161                     this.RaisePropertyChanged("GrantedByUserId");
    1162                 }
    1163             }
    1164         }
    1165        
    1166         [System.Runtime.Serialization.DataMemberAttribute()]
    1167         public System.Guid GrantedUserId
    1168         {
    1169             get
    1170             {
    1171                 return this.GrantedUserIdField;
    1172             }
    1173             set
    1174             {
    1175                 if ((this.GrantedUserIdField.Equals(value) != true))
    1176                 {
    1177                     this.GrantedUserIdField = value;
    1178                     this.RaisePropertyChanged("GrantedUserId");
    1179                 }
    1180             }
    1181         }
    1182        
    1183         [System.Runtime.Serialization.DataMemberAttribute()]
    1184         public System.Guid HiveExperimentId
    1185         {
    1186             get
    1187             {
    1188                 return this.HiveExperimentIdField;
    1189             }
    1190             set
    1191             {
    1192                 if ((this.HiveExperimentIdField.Equals(value) != true))
    1193                 {
    1194                     this.HiveExperimentIdField = value;
    1195                     this.RaisePropertyChanged("HiveExperimentId");
    1196                 }
    1197             }
    1198         }
    1199        
    1200         [System.Runtime.Serialization.DataMemberAttribute()]
    1201         public HeuristicLab.Clients.Hive.Permission Permission
    1202         {
    1203             get
    1204             {
    1205                 return this.PermissionField;
    1206             }
    1207             set
    1208             {
    1209                 if ((this.PermissionField.Equals(value) != true))
    1210                 {
    1211                     this.PermissionField = value;
    1212                     this.RaisePropertyChanged("Permission");
    1213                 }
    1214             }
    1215         }
    1216     }
    1217    
    1218     [System.Diagnostics.DebuggerStepThroughAttribute()]
    1219     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1220     [System.Runtime.Serialization.DataContractAttribute(Name="PluginData", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    1221         "nsfer")]
    1222     [System.SerializableAttribute()]
    1223     public partial class PluginData : HeuristicLab.Clients.Hive.HiveItem
    1224     {
    1225        
    1226         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1227         private byte[] DataField;
    1228        
    1229         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1230         private string FileNameField;
    1231        
    1232         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1233         private System.Guid PluginIdField;
    1234        
    1235         [System.Runtime.Serialization.DataMemberAttribute()]
    1236         public byte[] Data
    1237         {
    1238             get
    1239             {
    1240                 return this.DataField;
    1241             }
    1242             set
    1243             {
    1244                 if ((object.ReferenceEquals(this.DataField, value) != true))
    1245                 {
    1246                     this.DataField = value;
    1247                     this.RaisePropertyChanged("Data");
    1248                 }
    1249             }
    1250         }
    1251        
    1252         [System.Runtime.Serialization.DataMemberAttribute()]
    1253         public string FileName
    1254         {
    1255             get
    1256             {
    1257                 return this.FileNameField;
    1258             }
    1259             set
    1260             {
    1261                 if ((object.ReferenceEquals(this.FileNameField, value) != true))
    1262                 {
    1263                     this.FileNameField = value;
    1264                     this.RaisePropertyChanged("FileName");
    1265                 }
    1266             }
    1267         }
    1268        
    1269         [System.Runtime.Serialization.DataMemberAttribute()]
    1270         public System.Guid PluginId
    1271         {
    1272             get
    1273             {
    1274                 return this.PluginIdField;
    1275             }
    1276             set
    1277             {
    1278                 if ((this.PluginIdField.Equals(value) != true))
    1279                 {
    1280                     this.PluginIdField = value;
    1281                     this.RaisePropertyChanged("PluginId");
    1282                 }
    1283             }
    1284         }
    1285     }
    1286    
    1287     [System.Diagnostics.DebuggerStepThroughAttribute()]
    1288     [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
    1289     [System.Runtime.Serialization.DataContractAttribute(Name="LightweightJob", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common.DataTra" +
    1290         "nsfer")]
    1291     [System.SerializableAttribute()]
    1292     [System.Runtime.Serialization.KnownTypeAttribute(typeof(HeuristicLab.Clients.Hive.Job))]
    1293     public partial class LightweightJob : HeuristicLab.Clients.Hive.HiveItem
    1294     {
    1295        
    1296         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1297         private System.Nullable<HeuristicLab.Clients.Hive.Command> CommandField;
    1298        
    1299         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1300         private System.TimeSpan ExecutionTimeField;
    1301        
    1302         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1303         private System.DateTime LastJobDataUpdateField;
    1304        
    1305         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1306         private System.Nullable<System.Guid> ParentJobIdField;
    1307        
    1308         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1309         private HeuristicLab.Clients.Hive.JobState StateField;
    1310        
    1311         [System.Runtime.Serialization.OptionalFieldAttribute()]
    1312         private System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLogField;
    1313        
    1314         [System.Runtime.Serialization.DataMemberAttribute()]
    1315         public System.Nullable<HeuristicLab.Clients.Hive.Command> Command
    1316         {
    1317             get
    1318             {
    1319                 return this.CommandField;
    1320             }
    1321             set
    1322             {
    1323                 if ((this.CommandField.Equals(value) != true))
    1324                 {
    1325                     this.CommandField = value;
    1326                     this.RaisePropertyChanged("Command");
    1327                 }
    1328             }
    1329         }
    1330        
    1331         [System.Runtime.Serialization.DataMemberAttribute()]
    1332         public System.TimeSpan ExecutionTime
    1333         {
    1334             get
    1335             {
    1336                 return this.ExecutionTimeField;
    1337             }
    1338             set
    1339             {
    1340                 if ((this.ExecutionTimeField.Equals(value) != true))
    1341                 {
    1342                     this.ExecutionTimeField = value;
    1343                     this.RaisePropertyChanged("ExecutionTime");
    1344                 }
    1345             }
    1346         }
    1347        
    1348         [System.Runtime.Serialization.DataMemberAttribute()]
    1349         public System.DateTime LastJobDataUpdate
    1350         {
    1351             get
    1352             {
    1353                 return this.LastJobDataUpdateField;
    1354             }
    1355             set
    1356             {
    1357                 if ((this.LastJobDataUpdateField.Equals(value) != true))
    1358                 {
    1359                     this.LastJobDataUpdateField = value;
    1360                     this.RaisePropertyChanged("LastJobDataUpdate");
    1361                 }
    1362             }
    1363         }
    1364        
    1365         [System.Runtime.Serialization.DataMemberAttribute()]
    1366         public System.Nullable<System.Guid> ParentJobId
    1367         {
    1368             get
    1369             {
    1370                 return this.ParentJobIdField;
    1371             }
    1372             set
    1373             {
    1374                 if ((this.ParentJobIdField.Equals(value) != true))
    1375                 {
    1376                     this.ParentJobIdField = value;
    1377                     this.RaisePropertyChanged("ParentJobId");
    1378                 }
    1379             }
    1380         }
    1381        
    1382         [System.Runtime.Serialization.DataMemberAttribute()]
    1383         public HeuristicLab.Clients.Hive.JobState State
    1384         {
    1385             get
    1386             {
    1387                 return this.StateField;
    1388             }
    1389             set
    1390             {
    1391                 if ((this.StateField.Equals(value) != true))
    1392                 {
    1393                     this.StateField = value;
    1394                     this.RaisePropertyChanged("State");
    1395                 }
    1396             }
    1397         }
    1398        
    1399         [System.Runtime.Serialization.DataMemberAttribute()]
    1400         public System.Collections.Generic.List<HeuristicLab.Clients.Hive.StateLog> StateLog
    1401         {
    1402             get
    1403             {
    1404                 return this.StateLogField;
    1405             }
    1406             set
    1407             {
    1408                 if ((object.ReferenceEquals(this.StateLogField, value) != true))
    1409                 {
    1410                     this.StateLogField = value;
    1411                     this.RaisePropertyChanged("StateLog");
    1412                 }
    1413             }
    1414         }
    14151415    }
    14161416   
     
    19291929    {
    19301930       
     1931        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlaveGroup", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveGroupResponse")]
     1932        void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup);
     1933       
    19311934        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/DeleteSlave", ReplyAction="http://tempuri.org/IHiveService/DeleteSlaveResponse")]
    19321935        void DeleteSlave(System.Guid slaveId);
     
    20422045        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetHiveExperimentPermissions", ReplyAction="http://tempuri.org/IHiveService/GetHiveExperimentPermissionsResponse")]
    20432046        System.Collections.Generic.List<HeuristicLab.Clients.Hive.HiveExperimentPermission> GetHiveExperimentPermissions(System.Guid hiveExperimentId);
     2047       
     2048        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/IsAllowedPrivileged", ReplyAction="http://tempuri.org/IHiveService/IsAllowedPrivilegedResponse")]
     2049        bool IsAllowedPrivileged();
    20442050       
    20452051        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/Hello", ReplyAction="http://tempuri.org/IHiveService/HelloResponse")]
     
    20912097        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlave", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveResponse")]
    20922098        void UpdateSlave(HeuristicLab.Clients.Hive.Slave slave);
    2093        
    2094         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/UpdateSlaveGroup", ReplyAction="http://tempuri.org/IHiveService/UpdateSlaveGroupResponse")]
    2095         void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup);
    20962099    }
    20972100   
     
    21302133        }
    21312134       
     2135        public void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup)
     2136        {
     2137            base.Channel.UpdateSlaveGroup(slaveGroup);
     2138        }
     2139       
    21322140        public void DeleteSlave(System.Guid slaveId)
    21332141        {
     
    23202328        }
    23212329       
     2330        public bool IsAllowedPrivileged()
     2331        {
     2332            return base.Channel.IsAllowedPrivileged();
     2333        }
     2334       
    23222335        public void Hello(HeuristicLab.Clients.Hive.Slave slave)
    23232336        {
     
    23982411        {
    23992412            base.Channel.UpdateSlave(slave);
    2400         }
    2401        
    2402         public void UpdateSlaveGroup(HeuristicLab.Clients.Hive.SlaveGroup slaveGroup)
    2403         {
    2404             base.Channel.UpdateSlaveGroup(slaveGroup);
    24052413        }
    24062414    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceLocator.cs

    r6372 r6479  
    5656      else
    5757        cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(null, null, username, password);
    58 
     58     
    5959      return cl;
    6060    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Views/3.4/HiveEngineView.cs

    r6444 r6479  
    3838
    3939    protected override void DeregisterContentEvents() {
    40       Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
    4140      Content.ExecutionTimeOnHiveChanged -= new EventHandler(Content_ExecutionTimeOnHiveChanged);
     41      Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged);
    4242      base.DeregisterContentEvents();
    4343    }
     
    4545    protected override void RegisterContentEvents() {
    4646      base.RegisterContentEvents();
    47       Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    4847      Content.ExecutionTimeOnHiveChanged += new EventHandler(Content_ExecutionTimeOnHiveChanged);
     48      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    4949    }
    5050
    5151    #region Event Handlers (Content)
    52     private void Content_ExecutionStateChanged(object sender, EventArgs e) {
     52    private void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    5353      if (InvokeRequired) {
    54         Invoke(new EventHandler(Content_ExecutionStateChanged), sender, e);
     54        Invoke(new EventHandler(Content_ExecutionTimeChanged), sender, e);
    5555      } else {
    5656        executionTimeTextBox.Text = Content.ExecutionTime.ToString();
     
    9292        resourceIdsTextBox.ReadOnly = this.ReadOnly;
    9393        priorityTextBox.ReadOnly = this.ReadOnly;
    94         isPrivilegedCheckBox.Enabled = !this.ReadOnly; // TODO: check for user rights
     94        isPrivilegedCheckBox.Enabled = Content.IsAllowedPrivileged;
    9595      } else {
    9696        resourceIdsTextBox.ReadOnly = false;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs

    r6452 r6479  
    9292    }
    9393
     94    public bool IsAllowedPrivileged { get; set; }
     95
    9496    #region constructors and cloning
    9597    public HiveEngine() {
     
    9799      this.Priority = 0;
    98100      this.log = new ThreadSafeLog(this.log);
     101      this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
    99102    }
    100103
     
    249252          var engineHiveJob = new EngineHiveJob(jobs[i], parentScopeClone);
    250253          engineHiveJob.Job.Priority = this.Priority;
    251           hiveExperiment.HiveJobs.Add(engineHiveJob);
     254          refreshableHiveExperiment.HiveJobs.Add(engineHiveJob);
    252255
    253256          // shuffle random variable to avoid the same random sequence in each operation; todo: does not yet work (it cannot find the random variable)
     
    261264        while (!refreshableHiveExperiment.AllJobsFinished()) {
    262265          Thread.Sleep(2000);
    263           this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x.HiveExperiment.ExecutionTime.TotalMilliseconds));
     266          this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x.ExecutionTime.TotalMilliseconds));
    264267          cancellationToken.ThrowIfCancellationRequested();
    265268        }
    266         log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment.HiveExperiment.ExecutionTime));
    267 
    268         var failedJobs = hiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed);
     269        log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment.ExecutionTime));
     270
     271        var failedJobs = refreshableHiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed);
    269272        if (failedJobs.Count() > 0) {
    270273          throw new HiveEngineException("Job failed: " + failedJobs.First().Job.StateLog.Last().Exception);
     
    273276        // get scopes
    274277        int j = 0;
    275         foreach (var hiveJob in hiveExperiment.HiveJobs) {
     278        foreach (var hiveJob in refreshableHiveExperiment.HiveJobs) {
    276279          var scope = ((IAtomicOperation)((EngineJob)hiveJob.ItemJob).InitialOperation).Scope;
    277280          scopes[j++] = scope;
     
    299302        hiveExperiment.IsPrivileged = this.IsPrivileged;
    300303        var refreshableHiveExperiment = new RefreshableHiveExperiment(hiveExperiment);
    301         refreshableHiveExperiment.IsControllable = false;
     304        refreshableHiveExperiment.IsDownloadable = false; // download happens automatically so disable button
    302305        hiveExperiments.Add(refreshableHiveExperiment);
    303306        return refreshableHiveExperiment;
     
    312315
    313316    private void ClearData(RefreshableHiveExperiment refreshableHiveExperiment) {
    314       var jobs = refreshableHiveExperiment.HiveExperiment.GetAllHiveJobs();
     317      var jobs = refreshableHiveExperiment.GetAllHiveJobs();
    315318      foreach (var job in jobs) {
    316319        job.ClearData();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/ServiceContracts/IHiveService.cs

    r6463 r6479  
    119119    [OperationContract]
    120120    IEnumerable<HiveExperimentPermission> GetHiveExperimentPermissions(Guid hiveExperimentId);
     121
     122    [OperationContract]
     123    bool IsAllowedPrivileged(); // current user may execute privileged jobs
    121124    #endregion
    122125
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLab.Services.Hive.DataAccess-3.4.csproj

    r6452 r6479  
    114114      <DependentUpon>Settings.settings</DependentUpon>
    115115    </Compile>
    116     <Compile Include="Tools\CreateHiveDatabaseApplication.cs" />
    117116    <Compile Include="TransactionManager.cs" />
    118117  </ItemGroup>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config

    r6478 r6479  
    3636  </connectionStrings>
    3737  <system.web>
    38     <httpHandlers>
    39       <add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    40         validate="false" />
    41     </httpHandlers>
     38    <authentication mode="Forms" />
    4239    <compilation debug="true" targetFramework="4.0">
    4340      <assemblies>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveRoles.cs

    r6372 r6479  
    2525    public const string Slave = "Hive Slave";
    2626    public const string Client = "Hive User";
     27    public const string IsAllowedPrivileged = "Hive IsAllowedPrivileged";
    2728  }
    2829}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs

    r6465 r6479  
    328328      });
    329329    }
     330
     331    public bool IsAllowedPrivileged() {
     332      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     333      return authen.IsInRole(HiveRoles.IsAllowedPrivileged);
     334    }
    330335    #endregion
    331336
     
    516521
    517522    public Guid GetResourceId(string resourceName) {
    518       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
     523      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    519524      return trans.UseTransaction(() => {
    520525        var resource = dao.GetResources(x => x.Name == resourceName).FirstOrDefault();
Note: See TracChangeset for help on using the changeset viewer.