root / trunk / Pithos.ShellExtensions / PithosHost.cs @ 255f5f86
History | View | Annotate | Download (3.4 kB)
1 | 255f5f86 | Panagiotis Kanavos | #region |
---|---|---|---|
2 | 255f5f86 | Panagiotis Kanavos | /* ----------------------------------------------------------------------- |
3 | 255f5f86 | Panagiotis Kanavos | * <copyright file="PithosHost.cs" company="GRNet"> |
4 | 255f5f86 | Panagiotis Kanavos | * |
5 | 255f5f86 | Panagiotis Kanavos | * Copyright 2011-2012 GRNET S.A. All rights reserved. |
6 | 255f5f86 | Panagiotis Kanavos | * |
7 | 255f5f86 | Panagiotis Kanavos | * Redistribution and use in source and binary forms, with or |
8 | 255f5f86 | Panagiotis Kanavos | * without modification, are permitted provided that the following |
9 | 255f5f86 | Panagiotis Kanavos | * conditions are met: |
10 | 255f5f86 | Panagiotis Kanavos | * |
11 | 255f5f86 | Panagiotis Kanavos | * 1. Redistributions of source code must retain the above |
12 | 255f5f86 | Panagiotis Kanavos | * copyright notice, this list of conditions and the following |
13 | 255f5f86 | Panagiotis Kanavos | * disclaimer. |
14 | 255f5f86 | Panagiotis Kanavos | * |
15 | 255f5f86 | Panagiotis Kanavos | * 2. Redistributions in binary form must reproduce the above |
16 | 255f5f86 | Panagiotis Kanavos | * copyright notice, this list of conditions and the following |
17 | 255f5f86 | Panagiotis Kanavos | * disclaimer in the documentation and/or other materials |
18 | 255f5f86 | Panagiotis Kanavos | * provided with the distribution. |
19 | 255f5f86 | Panagiotis Kanavos | * |
20 | 255f5f86 | Panagiotis Kanavos | * |
21 | 255f5f86 | Panagiotis Kanavos | * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS |
22 | 255f5f86 | Panagiotis Kanavos | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
23 | 255f5f86 | Panagiotis Kanavos | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
24 | 255f5f86 | Panagiotis Kanavos | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR |
25 | 255f5f86 | Panagiotis Kanavos | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
26 | 255f5f86 | Panagiotis Kanavos | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
27 | 255f5f86 | Panagiotis Kanavos | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
28 | 255f5f86 | Panagiotis Kanavos | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
29 | 255f5f86 | Panagiotis Kanavos | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | 255f5f86 | Panagiotis Kanavos | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
31 | 255f5f86 | Panagiotis Kanavos | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
32 | 255f5f86 | Panagiotis Kanavos | * POSSIBILITY OF SUCH DAMAGE. |
33 | 255f5f86 | Panagiotis Kanavos | * |
34 | 255f5f86 | Panagiotis Kanavos | * The views and conclusions contained in the software and |
35 | 255f5f86 | Panagiotis Kanavos | * documentation are those of the authors and should not be |
36 | 255f5f86 | Panagiotis Kanavos | * interpreted as representing official policies, either expressed |
37 | 255f5f86 | Panagiotis Kanavos | * or implied, of GRNET S.A. |
38 | 255f5f86 | Panagiotis Kanavos | * </copyright> |
39 | 255f5f86 | Panagiotis Kanavos | * ----------------------------------------------------------------------- |
40 | 255f5f86 | Panagiotis Kanavos | */ |
41 | 255f5f86 | Panagiotis Kanavos | #endregion |
42 | 0eea575a | Panagiotis Kanavos | using System.ServiceModel; |
43 | 0eea575a | Panagiotis Kanavos | using Pithos.ShellExtensions.PithosService; |
44 | 0eea575a | Panagiotis Kanavos | |
45 | 0eea575a | Panagiotis Kanavos | namespace Pithos.ShellExtensions |
46 | 0eea575a | Panagiotis Kanavos | { |
47 | 0eea575a | Panagiotis Kanavos | /// <summary> |
48 | 3ddbb7b8 | Panagiotis Kanavos | /// Returns the status service clients |
49 | 0eea575a | Panagiotis Kanavos | /// </summary> |
50 | 0eea575a | Panagiotis Kanavos | public static class PithosHost |
51 | 0eea575a | Panagiotis Kanavos | { |
52 | 3ddbb7b8 | Panagiotis Kanavos | /// <summary> |
53 | 3ddbb7b8 | Panagiotis Kanavos | /// Provides a client for retrieving file status from the Pithos App |
54 | 3ddbb7b8 | Panagiotis Kanavos | /// </summary> |
55 | 3ddbb7b8 | Panagiotis Kanavos | /// <returns></returns> |
56 | 0eea575a | Panagiotis Kanavos | public static StatusServiceClient GetStatusClient() |
57 | 0eea575a | Panagiotis Kanavos | { |
58 | 0eea575a | Panagiotis Kanavos | var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); |
59 | 0eea575a | Panagiotis Kanavos | var remoteAddress = new EndpointAddress("net.pipe://localhost/pithos/statuscache"); |
60 | 0eea575a | Panagiotis Kanavos | |
61 | 0eea575a | Panagiotis Kanavos | return new StatusServiceClient(binding, remoteAddress); |
62 | 0eea575a | Panagiotis Kanavos | } |
63 | 0eea575a | Panagiotis Kanavos | |
64 | 3ddbb7b8 | Panagiotis Kanavos | /// <summary> |
65 | 3ddbb7b8 | Panagiotis Kanavos | /// Provides a client for retrieving settings from the Pithos App |
66 | 3ddbb7b8 | Panagiotis Kanavos | /// </summary> |
67 | 3ddbb7b8 | Panagiotis Kanavos | /// <returns></returns> |
68 | 0eea575a | Panagiotis Kanavos | public static SettingsServiceClient GetSettingsClient() |
69 | 0eea575a | Panagiotis Kanavos | { |
70 | 0eea575a | Panagiotis Kanavos | var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); |
71 | 0eea575a | Panagiotis Kanavos | var remoteAddress = new EndpointAddress("net.pipe://localhost/pithos/settings"); |
72 | 0eea575a | Panagiotis Kanavos | |
73 | 0eea575a | Panagiotis Kanavos | return new SettingsServiceClient(binding, remoteAddress); |
74 | 0eea575a | Panagiotis Kanavos | } |
75 | 42800be8 | Panagiotis Kanavos | |
76 | 3ddbb7b8 | Panagiotis Kanavos | |
77 | 3ddbb7b8 | Panagiotis Kanavos | /// <summary> |
78 | 3ddbb7b8 | Panagiotis Kanavos | /// Provides a client for sending commands to the Pithos Client |
79 | 3ddbb7b8 | Panagiotis Kanavos | /// </summary> |
80 | 3ddbb7b8 | Panagiotis Kanavos | /// <returns></returns> |
81 | 42800be8 | Panagiotis Kanavos | public static CommandsServiceClient GetCommandsClient() |
82 | 42800be8 | Panagiotis Kanavos | { |
83 | 42800be8 | Panagiotis Kanavos | var binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); |
84 | 42800be8 | Panagiotis Kanavos | var remoteAddress = new EndpointAddress("net.pipe://localhost/pithos/commands"); |
85 | 42800be8 | Panagiotis Kanavos | |
86 | 42800be8 | Panagiotis Kanavos | return new CommandsServiceClient(binding, remoteAddress); |
87 | 42800be8 | Panagiotis Kanavos | } |
88 | 42800be8 | Panagiotis Kanavos | |
89 | 42800be8 | Panagiotis Kanavos | |
90 | 0eea575a | Panagiotis Kanavos | } |
91 | 0eea575a | Panagiotis Kanavos | } |