Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1596


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

Implemented SendPlugins method (#531)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ApplicationConstants.cs

    r1577 r1596  
    7676    public static string RESPONSE_COMMUNICATOR_JOB_DOESNT_EXIST = "No job exists with this id";
    7777    public static string RESPONSE_COMMUNICATOR_SEND_JOBRESULT = "Please send the Jobresult to the server";
     78    public static string RESPONSE_COMMUNICATOR_PLUGINS_SENT = "Communicator.PluginsSent";
    7879
    7980    public static string RESPONSE_JOB_ALL_JOBS = "Job.AllJobs";
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/BusinessObjects/CachedHivePluginInfo.cs

    r1591 r1596  
    2727namespace HeuristicLab.PluginInfrastructure {
    2828  public class CachedHivePluginInfo : HivePluginInfo {
    29    
     29
    3030    private List<byte[]> pluginFiles = new List<byte[]>();
    3131    /// <summary>
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/ResponsePlugin.cs

    r1589 r1596  
    1010  [DataContract]
    1111  public class ResponsePlugin : Response {
     12    public ResponsePlugin() {
     13      Plugins = new List<CachedHivePluginInfo>();
     14    }
     15
    1216    [DataMember]
    1317    public List<CachedHivePluginInfo> Plugins { get; set; }
  • 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.