Changeset 1084


Ignore:
Timestamp:
01/07/09 16:35:53 (12 years ago)
Author:
svonolfe
Message:

Added interface for login (#454)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Contracts/Interfaces/IServerConsoleFacade.cs

    r909 r1084  
    3131  /// Facade for the server management console
    3232  /// </summary>
    33   [ServiceContract]
    34   public interface IServerConsoleFacade : IClientManager, IJobManager, IUserRoleManager {
     33  [ServiceContract(SessionMode=SessionMode.Required)]
     34  public interface IServerConsoleFacade : IClientManager,
     35    IJobManager,
     36    IUserRoleManager {
     37    [OperationContract]
     38    bool Login(String username, String password);
    3539  }
    3640}
  • trunk/sources/HeuristicLab.Hive.Server.Console/ServiceLocator.cs

    r844 r1084  
    99namespace HeuristicLab.Hive.Server.Console {
    1010  internal class ServiceLocator {
    11     private static IClientManager clientManager = null;
    12     private static IJobManager jobManager = null;
    13     private static IUserRoleManager userManager = null;
     11    private static IServerConsoleFacade serverConsoleFacade = null;
    1412
    1513    internal static string Address { get; set; }
     
    1715
    1816    internal static IClientManager GetClientManager() {
    19       if (clientManager == null &&
    20         Address != String.Empty &&
    21         Port != String.Empty) {
    22         ChannelFactory<IClientManager> factory =
    23           new ChannelFactory<IClientManager>(
    24             new NetTcpBinding(),
    25             new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ClientManager"));
    26        
    27         clientManager = factory.CreateChannel();
    28       }
    29 
    30       return clientManager;
     17      return GetServerConsoleFacade() as IClientManager;
    3118    }
    3219
    3320    internal static IJobManager GetJobManager() {
    34       if (jobManager == null &&
    35         Address != String.Empty &&
    36         Port != String.Empty) {
    37         ChannelFactory<IJobManager> factory =
    38           new ChannelFactory<IJobManager>(
    39             new NetTcpBinding(),
    40             new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/JobManager"));
    41 
    42         jobManager = factory.CreateChannel();
    43       }
    44 
    45       return jobManager;
     21      return GetServerConsoleFacade() as IJobManager;
    4622    }
    4723
    4824    internal static IUserRoleManager GetUserRoleManager() {
    49       if (userManager == null &&
     25      return GetServerConsoleFacade() as IUserRoleManager;
     26    }
     27
     28    internal static IServerConsoleFacade GetServerConsoleFacade() {
     29      if (serverConsoleFacade == null &&
    5030        Address != String.Empty &&
    5131        Port != String.Empty) {
    52         ChannelFactory<IUserRoleManager> factory =
    53           new ChannelFactory<IUserRoleManager>(
     32        ChannelFactory<IServerConsoleFacade> factory =
     33          new ChannelFactory<IServerConsoleFacade>(
    5434            new NetTcpBinding(),
    55             new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/UserRoleManager"));
     35            new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ServerConsoleFacade"));
    5636
    57         userManager = factory.CreateChannel();
     37        serverConsoleFacade = factory.CreateChannel();
    5838      }
    5939
    60       return userManager;
     40      return serverConsoleFacade;
    6141    }
    6242  }
  • trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs

    r1012 r1084  
    3333    private IJobManager jobManager = new JobManager();
    3434    private IUserRoleManager userRoleManager = new UserRoleManager();
    35    
     35
     36    private String loginName = null;
     37
     38    #region IServerConsoleFacade Members
     39
     40    public bool Login(string username, string password) {
     41      loginName = username;
     42
     43      return true;
     44    }
     45
     46    #endregion
     47
    3648    #region IClientManager Members
    3749
     
    116128
    117129    #endregion
    118 
    119130  }
    120131}
  • trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs

    r994 r1084  
    9595
    9696        serviceHost.AddServiceEndpoint(
    97           typeof(IClientManager),
    98               binding,
    99               "ClientManager");
    100 
    101         serviceHost.AddServiceEndpoint(
    102           typeof(IJobManager),
    103               binding,
    104               "JobManager");
    105 
    106         serviceHost.AddServiceEndpoint(
    107           typeof(IUserRoleManager),
    108               binding,
    109               "UserRoleManager");
     97          typeof(IServerConsoleFacade),
     98            binding,
     99            "ServerConsoleFacade");
    110100
    111101        AddMexEndpoint(serviceHost);
Note: See TracChangeset for help on using the changeset viewer.