aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Manager/GridServerManager.cs
blob: 16ea6e8ac15ec5a7d1f07d6abdfba8ffababe56d (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(requestData["authkey"]!=recvkey) {
	    			responseData["error"]="INVALID KEY";
	    		} else {
				responseData["msg"]="Shutdown command accepted";
	    			responseData["authkey"]=sendkey;
	    			thecallback("shutdown");	
	    		} 


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