- Timestamp:
- 08/03/10 17:20:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs
r4042 r4140 595 595 } 596 596 job.JobInfo.Percentage = percentage; 597 598 if (finished) { 597 if(exception != null) { 598 job.JobInfo.State = State.failed; 599 job.JobInfo.Exception = exception.ToString(); 600 job.JobInfo.DateFinished = DateTime.Now; 601 } else if (finished) { 599 602 job.JobInfo.State = State.finished; 600 603 job.JobInfo.DateFinished = DateTime.Now; … … 718 721 ResponsePlugin response = new ResponsePlugin(); 719 722 foreach (HivePluginInfoDto pluginInfo in pluginList) { 720 // TODO: BuildDate deleted, not needed??? 721 // TODO: Split version to major, minor and revision number 722 foreach (IPluginDescription currPlugin in ApplicationManager.Manager.Plugins) { 723 if (currPlugin.Name == pluginInfo.Name) { 724 725 CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto { 726 Name = currPlugin.Name, 727 Version = currPlugin.Version, 728 BuildDate = currPlugin.BuildDate 729 }; 730 731 foreach (string fileName in from file in currPlugin.Files select file.Name) { 732 currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName)); 733 } 734 response.Plugins.Add(currCachedPlugin); 723 if(pluginInfo.Update) { 724 //check if there is a newer version 725 IPluginDescription ipd = 726 ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision > pluginInfo.Version.Revision).SingleOrDefault(); 727 if(ipd != null) { 728 response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 729 } 730 } else { 731 IPluginDescription ipd = 732 ApplicationManager.Manager.Plugins.Where(pd => pd.Name == pluginInfo.Name && pd.Version.Major == pluginInfo.Version.Major && pd.Version.Minor == pluginInfo.Version.Minor && pd.Version.Revision >= pluginInfo.Version.Revision).SingleOrDefault(); 733 if(ipd != null) { 734 response.Plugins.Add(convertPluginDescriptorToDto(ipd)); 735 } else { 736 response.Success = false; 737 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_PLUGINS_NOT_AVAIL; 738 return response; 735 739 } 736 740 } … … 741 745 return response; 742 746 747 } 748 749 private CachedHivePluginInfoDto convertPluginDescriptorToDto(IPluginDescription currPlugin) { 750 CachedHivePluginInfoDto currCachedPlugin = new CachedHivePluginInfoDto { 751 Name = currPlugin.Name, 752 Version = currPlugin.Version, 753 BuildDate = currPlugin.BuildDate 754 }; 755 756 foreach (string fileName in from file in currPlugin.Files select file.Name) { 757 currCachedPlugin.PluginFiles.Add(new HivePluginFile(File.ReadAllBytes(fileName), fileName)); 758 } 759 return currCachedPlugin; 743 760 } 744 761
Note: See TracChangeset
for help on using the changeset viewer.