29 using System.Collections;
30 using System.Reflection;
34 using OpenSim.Framework;
35 using OpenSim.Framework.Capabilities;
36 using OpenSim.Framework.Servers;
37 using OpenSim.Framework.Servers.HttpServer;
38 using OpenSim.Region.Framework.Scenes;
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
52 m_externalData = externalData;
57 m_log.Info(
"[DATASNAPSHOT]: Set up snapshot service");
60 MainServer.Instance.AddHTTPHandler(
"validate", OnValidate);
66 m_log.Debug(
"[DATASNAPSHOT] Received collection request");
67 Hashtable reply =
new Hashtable();
70 string snapObj = (string)keysvals[
"region"];
72 XmlDocument response = m_externalData.GetSnapshot(snapObj);
74 reply[
"str_response_string"] = response.OuterXml;
75 reply[
"int_response_code"] = statuscode;
76 reply[
"content_type"] =
"text/xml";
83 m_log.Debug(
"[DATASNAPSHOT] Received validation request");
84 Hashtable reply =
new Hashtable();
87 string secret = (string)keysvals[
"secret"];
88 if (secret == m_externalData.Secret.ToString())
91 reply[
"str_response_string"] = string.Empty;
92 reply[
"int_response_code"] = statuscode;
93 reply[
"content_type"] =
"text/plain";
bool AddHTTPHandler(string methodName, GenericHTTPMethod handler)
Add a handler for an HTTP request.
Hashtable OnGetSnapshot(Hashtable keysvals)
Hashtable OnValidate(Hashtable keysvals)
Interactive OpenSim region server
static BaseHttpServer Instance
Set the main HTTP server instance.
OpenSim.Framework.Capabilities.Caps Caps
DataRequestHandler(Scene scene, DataSnapshotManager externalData)