diff options
Diffstat (limited to '')
-rw-r--r-- | OpenGrid.Framework.Manager/GridManagementAgent.cs | 31 | ||||
-rw-r--r-- | OpenGrid.Framework.Manager/GridServerManager.cs | 36 | ||||
-rw-r--r-- | OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build | 1 |
3 files changed, 67 insertions, 1 deletions
diff --git a/OpenGrid.Framework.Manager/GridManagementAgent.cs b/OpenGrid.Framework.Manager/GridManagementAgent.cs index 04e2205..dca7a4a 100644 --- a/OpenGrid.Framework.Manager/GridManagementAgent.cs +++ b/OpenGrid.Framework.Manager/GridManagementAgent.cs | |||
@@ -2,5 +2,34 @@ using Nwc.XmlRpc; | |||
2 | using OpenSim.Framework; | 2 | using OpenSim.Framework; |
3 | using OpenSim.Servers; | 3 | using OpenSim.Servers; |
4 | 4 | ||
5 | public class GridManagementAgent { | 5 | namespace OpenGrid.Framework.Manager { |
6 | |||
7 | public delegate void GridManagerCallback(string param); | ||
8 | |||
9 | public class GridManagementAgent { | ||
10 | |||
11 | private GridManagerCallback thecallback; | ||
12 | private string sendkey; | ||
13 | private string recvkey; | ||
14 | private string component_type; | ||
15 | |||
16 | public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback) | ||
17 | { | ||
18 | this.sendkey=sendkey; | ||
19 | this.recvkey=recvkey; | ||
20 | this.component_type=component_type; | ||
21 | this.thecallback=thecallback; | ||
22 | |||
23 | switch(component_type) | ||
24 | { | ||
25 | case "gridserver": | ||
26 | GridServerManager.sendkey=this.sendkey; | ||
27 | GridServerManager.recvkey=this.recvkey; | ||
28 | GridServerManager.thecallback=thecallback; | ||
29 | app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod); | ||
30 | break; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | } | ||
6 | } | 35 | } |
diff --git a/OpenGrid.Framework.Manager/GridServerManager.cs b/OpenGrid.Framework.Manager/GridServerManager.cs new file mode 100644 index 0000000..16ea6e8 --- /dev/null +++ b/OpenGrid.Framework.Manager/GridServerManager.cs | |||
@@ -0,0 +1,36 @@ | |||
1 | using System; | ||
2 | using System.Collections; | ||
3 | using System.Collections.Generic; | ||
4 | using Nwc.XmlRpc; | ||
5 | |||
6 | |||
7 | namespace OpenGrid.Framework.Manager { | ||
8 | |||
9 | public class GridServerManager | ||
10 | { | ||
11 | public static GridManagerCallback thecallback; | ||
12 | |||
13 | public static string sendkey; | ||
14 | public static string recvkey; | ||
15 | |||
16 | public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request) | ||
17 | { | ||
18 | XmlRpcResponse response = new XmlRpcResponse(); | ||
19 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
20 | Hashtable responseData = new Hashtable(); | ||
21 | |||
22 | if(requestData["authkey"]!=recvkey) { | ||
23 | responseData["error"]="INVALID KEY"; | ||
24 | } else { | ||
25 | responseData["msg"]="Shutdown command accepted"; | ||
26 | responseData["authkey"]=sendkey; | ||
27 | thecallback("shutdown"); | ||
28 | } | ||
29 | |||
30 | |||
31 | response.Value = responseData; | ||
32 | return response; | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | |||
diff --git a/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build b/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build index dc699fe..3302bf2 100644 --- a/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build +++ b/OpenGrid.Framework.Manager/OpenGrid.Framework.Manager.dll.build | |||
@@ -12,6 +12,7 @@ | |||
12 | </resources> | 12 | </resources> |
13 | <sources failonempty="true"> | 13 | <sources failonempty="true"> |
14 | <include name="GridManagementAgent.cs" /> | 14 | <include name="GridManagementAgent.cs" /> |
15 | <include name="GridServerManager.cs" /> | ||
15 | </sources> | 16 | </sources> |
16 | <references basedir="${project::get-base-directory()}"> | 17 | <references basedir="${project::get-base-directory()}"> |
17 | <lib> | 18 | <lib> |