Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/11/11 15:32:27 (13 years ago)
Author:
cneumuel
Message:

#1233

  • added GetPlugin service method
  • fixed minor issues with double plugins in database
  • worked on HiveEngine
  • fixed wrong role name for Hive User
  • fixed bug in group assignment of slaves
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/ExperimentManagerClient.cs

    r5958 r6000  
    5050    }
    5151
    52     private IEnumerable<Plugin> onlinePlugins;
    53     public IEnumerable<Plugin> OnlinePlugins {
     52    private List<Plugin> onlinePlugins;
     53    public List<Plugin> OnlinePlugins {
    5454      get { return onlinePlugins; }
    5555      set { onlinePlugins = value; }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/PluginUtil.cs

    r5958 r6000  
    2424using System.IO;
    2525using System.Linq;
     26using System.ServiceModel;
    2627using HeuristicLab.PluginInfrastructure;
    2728
     
    3839    /// <param name="useLocalPlugins">If true, the plugins which are already online are ignored. All local plugins are uploaded, but only once.</param>
    3940    /// <returns></returns>
    40     public static List<Guid> GetPluginDependencies(IHiveService service, IEnumerable<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins, bool useLocalPlugins) {
     41    public static List<Guid> GetPluginDependencies(IHiveService service, List<Plugin> onlinePlugins, List<Plugin> alreadyUploadedPlugins, IEnumerable<IPluginDescription> neededPlugins, bool useLocalPlugins) {
    4142      var pluginIds = new List<Guid>();
    4243      foreach (var neededPlugin in neededPlugins) {
    43         Plugin foundPlugin = alreadyUploadedPlugins.SingleOrDefault(p => p.Name == neededPlugin.Name && p.Version == neededPlugin.Version);
     44        Plugin foundPlugin = alreadyUploadedPlugins.FirstOrDefault(p => p.Name == neededPlugin.Name && p.Version == neededPlugin.Version);
    4445        if (foundPlugin == null) {
    45           foundPlugin = onlinePlugins.SingleOrDefault(p => p.Name == neededPlugin.Name && p.Version == neededPlugin.Version);
     46          foundPlugin = onlinePlugins.FirstOrDefault(p => p.Name == neededPlugin.Name && p.Version == neededPlugin.Version);
    4647          if (useLocalPlugins || foundPlugin == null) {
    4748            Plugin p = CreatePlugin(neededPlugin, useLocalPlugins);
    4849            List<PluginData> pd = CreatePluginDatas(neededPlugin);
    49             p.Id = service.AddPlugin(p, pd);
    50             alreadyUploadedPlugins.Add(p);
    51             pluginIds.Add(p.Id);
     50            try {
     51              p.Id = service.AddPlugin(p, pd);
     52              alreadyUploadedPlugins.Add(p);
     53              pluginIds.Add(p.Id);
     54            }
     55            catch (FaultException<PluginAlreadyExistsFault> fault) {
     56              onlinePlugins.Add(service.GetPlugin(fault.Detail.Id));
     57            }
    5258          } else {
    5359            pluginIds.Add(foundPlugin.Id);
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveServiceClient.cs

    r5955 r6000  
    16731673    }
    16741674   
     1675    [System.Diagnostics.DebuggerStepThroughAttribute()]
     1676    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
     1677    [System.Runtime.Serialization.DataContractAttribute(Name="PluginAlreadyExistsFault", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common")]
     1678    [System.SerializableAttribute()]
     1679    public partial class PluginAlreadyExistsFault : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
     1680    {
     1681       
     1682        [System.NonSerializedAttribute()]
     1683        private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
     1684       
     1685        [System.Runtime.Serialization.OptionalFieldAttribute()]
     1686        private System.Guid IdField;
     1687       
     1688        public System.Runtime.Serialization.ExtensionDataObject ExtensionData
     1689        {
     1690            get
     1691            {
     1692                return this.extensionDataField;
     1693            }
     1694            set
     1695            {
     1696                this.extensionDataField = value;
     1697            }
     1698        }
     1699       
     1700        [System.Runtime.Serialization.DataMemberAttribute()]
     1701        public System.Guid Id
     1702        {
     1703            get
     1704            {
     1705                return this.IdField;
     1706            }
     1707            set
     1708            {
     1709                if ((this.IdField.Equals(value) != true))
     1710                {
     1711                    this.IdField = value;
     1712                    this.RaisePropertyChanged("Id");
     1713                }
     1714            }
     1715        }
     1716       
     1717        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
     1718       
     1719        protected void RaisePropertyChanged(string propertyName)
     1720        {
     1721            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
     1722            if ((propertyChanged != null))
     1723            {
     1724                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
     1725            }
     1726        }
     1727    }
     1728   
    16751729    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    16761730    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="HeuristicLab.Clients.Hive.IHiveService")]
     
    16781732    {
    16791733       
     1734        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddAppointment", ReplyAction="http://tempuri.org/IHiveService/AddAppointmentResponse")]
     1735        System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment);
     1736       
    16801737        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/DeleteAppointment", ReplyAction="http://tempuri.org/IHiveService/DeleteAppointmentResponse")]
    16811738        void DeleteAppointment(System.Guid appointmentId);
     
    17591816        System.Collections.Generic.List<HeuristicLab.Clients.Hive.MessageContainer> Heartbeat([System.ServiceModel.MessageParameterAttribute(Name="heartbeat")] HeuristicLab.Clients.Hive.Heartbeat heartbeat1);
    17601817       
     1818        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetPlugin", ReplyAction="http://tempuri.org/IHiveService/GetPluginResponse")]
     1819        HeuristicLab.Clients.Hive.Plugin GetPlugin(System.Guid pluginId);
     1820       
    17611821        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddPlugin", ReplyAction="http://tempuri.org/IHiveService/AddPluginResponse")]
     1822        [System.ServiceModel.FaultContractAttribute(typeof(HeuristicLab.Clients.Hive.PluginAlreadyExistsFault), Action="http://tempuri.org/IHiveService/AddPluginPluginAlreadyExistsFaultFault", Name="PluginAlreadyExistsFault", Namespace="http://schemas.datacontract.org/2004/07/HeuristicLab.Services.Hive.Common")]
    17621823        System.Guid AddPlugin(HeuristicLab.Clients.Hive.Plugin plugin, System.Collections.Generic.List<HeuristicLab.Clients.Hive.PluginData> pluginData);
    17631824       
     
    18091870        [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/TriggerLifecycle", ReplyAction="http://tempuri.org/IHiveService/TriggerLifecycleResponse")]
    18101871        void TriggerLifecycle(bool force);
    1811        
    1812         [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/AddAppointment", ReplyAction="http://tempuri.org/IHiveService/AddAppointmentResponse")]
    1813         System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment);
    18141872    }
    18151873   
     
    18481906        }
    18491907       
     1908        public System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment)
     1909        {
     1910            return base.Channel.AddAppointment(appointment);
     1911        }
     1912       
    18501913        public void DeleteAppointment(System.Guid appointmentId)
    18511914        {
     
    19832046        }
    19842047       
     2048        public HeuristicLab.Clients.Hive.Plugin GetPlugin(System.Guid pluginId)
     2049        {
     2050            return base.Channel.GetPlugin(pluginId);
     2051        }
     2052       
    19852053        public System.Guid AddPlugin(HeuristicLab.Clients.Hive.Plugin plugin, System.Collections.Generic.List<HeuristicLab.Clients.Hive.PluginData> pluginData)
    19862054        {
     
    20672135            base.Channel.TriggerLifecycle(force);
    20682136        }
    2069        
    2070         public System.Guid AddAppointment(HeuristicLab.Clients.Hive.Appointment appointment)
    2071         {
    2072             return base.Channel.AddAppointment(appointment);
    2073         }
    20742137    }
    20752138}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Plugin.cs

    r5955 r6000  
    3939      return new Plugin(this, cloner);
    4040    }
     41
     42    public override string ToString() {
     43      return string.Format("{0}-{1}", this.Name, this.Version.ToString()) + (this.IsLocal ? ", Local" : string.Empty);
     44    }
    4145  }
    4246}
Note: See TracChangeset for help on using the changeset viewer.