Ignore:
Timestamp:
04/17/09 13:59:28 (12 years ago)
Author:
msteinbi
Message:

Implemented SendPlugins method (#531)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Core/3.2/ClientCommunicator.cs

    r1593 r1596  
    3636using HeuristicLab.PluginInfrastructure;
    3737using HeuristicLab.DataAccess.Interfaces;
     38using System.IO;
    3839
    3940namespace HeuristicLab.Hive.Server.Core {
     
    565566
    566567    public ResponsePlugin SendPlugins(List<HivePluginInfo> pluginList) {
    567 
    568 
    569       throw new NotImplementedException();
     568      ResponsePlugin response = new ResponsePlugin();
     569      ICollection<PluginInfo> allActivePlugins = PluginManager.Manager.ActivePlugins;
     570
     571      foreach (HivePluginInfo pluginInfo in pluginList) {
     572        foreach (PluginInfo currPlugin in allActivePlugins) {
     573          if (currPlugin.Name == pluginInfo.Name
     574              && currPlugin.Version.ToString() == pluginInfo.Version
     575              && currPlugin.BuildDate == pluginInfo.BuildDate) {
     576
     577            CachedHivePluginInfo currCachedPlugin = new CachedHivePluginInfo {
     578                Name = currPlugin.Name,
     579                Version = currPlugin.Version.ToString(),
     580                BuildDate = currPlugin.BuildDate };
     581
     582            foreach (String assemblyPath in currPlugin.Assemblies) {
     583              currCachedPlugin.PluginFiles.Add(File.ReadAllBytes(assemblyPath));
     584            }
     585            response.Plugins.Add(currCachedPlugin);
     586          }
     587        }
     588      }
     589      response.Success = true;
     590      response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_PLUGINS_SENT;
     591
     592      return response;
     593
    570594    }
    571595
Note: See TracChangeset for help on using the changeset viewer.