aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServiceConnector.cs
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-03 21:44:39 +1000
committerDavid Walter Seikel2016-11-03 21:44:39 +1000
commit134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch)
tree216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServiceConnector.cs
parentMore changing to production grid. Double oops. (diff)
downloadopensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServiceConnector.cs (renamed from OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs)47
1 files changed, 26 insertions, 21 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServiceConnector.cs
index a88fe88..a581ea2 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/IRestHandler.cs
+++ b/OpenSim/Server/Handlers/AgentPreferences/AgentPreferencesServiceConnector.cs
@@ -25,35 +25,40 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28
29using System;
30using Nini.Config;
31using OpenSim.Server.Base;
32using OpenSim.Services.Interfaces;
33using OpenSim.Framework.ServiceAuth;
28using OpenSim.Framework.Servers.HttpServer; 34using OpenSim.Framework.Servers.HttpServer;
35using OpenSim.Server.Handlers.Base;
29 36
30namespace OpenSim.ApplicationPlugins.Rest.Inventory 37namespace OpenSim.Server.Handlers.AgentPreferences
31{ 38{
39 public class AgentPreferencesServiceConnector : ServiceConnector
40 {
41 private IAgentPreferencesService m_AgentPreferencesService;
42 private string m_ConfigName = "AgentPreferencesService";
32 43
33 /// <remarks> 44 public AgentPreferencesServiceConnector(IConfigSource config, IHttpServer server, string configName) :
34 /// The handler delegates are not noteworthy. The allocator allows 45 base(config, server, configName)
35 /// a given handler to optionally subclass the base RequestData 46 {
36 /// structure to carry any locally required per-request state 47 IConfig serverConfig = config.Configs[m_ConfigName];
37 /// needed. 48 if (serverConfig == null)
38 /// </remarks> 49 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
39 50
40 public delegate void RestMethodHandler(RequestData rdata); 51 string service = serverConfig.GetString("LocalServiceModule", String.Empty);
41 public delegate RequestData RestMethodAllocator(OSHttpRequest request, OSHttpResponse response, string path);
42 52
43 /// <summary> 53 if (String.IsNullOrWhiteSpace(service))
44 /// This interface exports the generic plugin-handling services 54 throw new Exception("No LocalServiceModule in config file");
45 /// available to each loaded REST services module (IRest implementation)
46 /// </summary>
47 55
48 internal interface IRestHandler 56 Object[] args = new Object[] { config };
49 { 57 m_AgentPreferencesService = ServerUtils.LoadPlugin<IAgentPreferencesService>(service, args);
50 58
51 string MsgId { get; } 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName); ;
52 string RequestId { get; }
53
54 void AddPathHandler(RestMethodHandler mh, string path, RestMethodAllocator ma);
55 void AddStreamHandler(string httpMethod, string path, RestMethod method);
56 60
61 server.AddStreamHandler(new AgentPreferencesServerPostHandler(m_AgentPreferencesService, auth));
62 }
57 } 63 }
58
59} 64}