Rev | Line | |
---|
[919] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using HeuristicLab.Hive.Client.Core.ClientConsoleService.Interfaces;
|
---|
[932] | 6 | using HeuristicLab.Hive.Client.Core.ConfigurationManager;
|
---|
| 7 | using HeuristicLab.Hive.Client.Communication;
|
---|
[1085] | 8 | using HeuristicLab.Hive.Client.Common;
|
---|
| 9 | using HeuristicLab.Hive.Contracts;
|
---|
[919] | 10 |
|
---|
| 11 | namespace HeuristicLab.Hive.Client.Core.ClientConsoleService {
|
---|
| 12 | public class ClientConsoleCommunicator: IClientConsoleCommunicator {
|
---|
| 13 | #region IClientConsoleCommunicator Members
|
---|
| 14 |
|
---|
| 15 | public StatusCommons GetStatusInfos() {
|
---|
[1033] | 16 | lock (Core.Locker) {
|
---|
| 17 | return ConfigManager.Instance.GetStatusForClientConsole();
|
---|
| 18 | }
|
---|
[919] | 19 | }
|
---|
| 20 |
|
---|
| 21 | public ConnectionContainer GetConnection() {
|
---|
[932] | 22 | return new ConnectionContainer{IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort } ;
|
---|
[919] | 23 | }
|
---|
| 24 |
|
---|
| 25 | public void SetConnection(ConnectionContainer container) {
|
---|
[944] | 26 | ConfigManager.Instance.SetServerIPAndPort(container);
|
---|
[932] | 27 | WcfService.Instance.Connect(container.IPAdress, container.Port);
|
---|
[919] | 28 | }
|
---|
| 29 |
|
---|
[932] | 30 | public void Disconnect() {
|
---|
| 31 | WcfService.Instance.Disconnect();
|
---|
[959] | 32 | }
|
---|
| 33 |
|
---|
| 34 | public ConnectionContainer GetCurrentConnection() {
|
---|
| 35 | return new ConnectionContainer { IPAdress = WcfService.Instance.ServerIP, Port = WcfService.Instance.ServerPort };
|
---|
[932] | 36 | }
|
---|
| 37 |
|
---|
[1083] | 38 | public void ShutdownClient() {
|
---|
[1085] | 39 | MessageQueue.GetInstance().AddMessage(MessageContainer.MessageType.Shutdown);
|
---|
[1083] | 40 | }
|
---|
| 41 |
|
---|
[919] | 42 | #endregion
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.