aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Manager/GridServerManager.cs
blob: c536e33176d4fb466617c310456081c942905239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections;
using System.Collections.Generic;
using Nwc.XmlRpc;


namespace OpenGrid.Framework.Manager {

	public class GridServerManager 
	{
		public static GridManagerCallback thecallback;

		public static string sendkey;
		public static string recvkey;

		public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
         	{
           		XmlRpcResponse response = new XmlRpcResponse();
            		Hashtable requestData = (Hashtable)request.Params[0];
	    		Hashtable responseData = new Hashtable();
           
	    		if((string)requestData["authkey"] != recvkey) {
	    			responseData["error"]="INVALID KEY";
	    		} else {
				responseData["msg"]="Shutdown command accepted";
	    			responseData["authkey"]=sendkey;
	    			thecallback("shutdown");	
	    		} 


	    		response.Value = responseData;
	    		return response;
		}
	 }
}