aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs29
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs2
-rw-r--r--OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs95
3 files changed, 119 insertions, 7 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
index 9ecb9ff..84e5db5 100644
--- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using log4net; 31using log4net;
31using OpenSim.Data; 32using OpenSim.Data;
@@ -33,6 +34,7 @@ using OpenSim.Framework;
33using OpenSim.Framework.Communications; 34using OpenSim.Framework.Communications;
34using OpenSim.Framework.Communications.Services; 35using OpenSim.Framework.Communications.Services;
35using OpenSim.Framework.Communications.Cache; 36using OpenSim.Framework.Communications.Cache;
37using OpenSim.Framework.Communications.Osp;
36using OpenSim.Framework.Servers; 38using OpenSim.Framework.Servers;
37using OpenSim.Region.Communications.Hypergrid; 39using OpenSim.Region.Communications.Hypergrid;
38using OpenSim.Region.Communications.Local; 40using OpenSim.Region.Communications.Local;
@@ -164,8 +166,16 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
164 protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder) 166 protected virtual void InitialiseStandaloneServices(LibraryRootFolder libraryRootFolder)
165 { 167 {
166 LocalInventoryService inventoryService = new LocalInventoryService(); 168 LocalInventoryService inventoryService = new LocalInventoryService();
167 inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, 169 List<IInventoryDataPlugin> plugins
168 m_openSim.ConfigurationSettings.StandaloneInventorySource); 170 = DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(
171 m_openSim.ConfigurationSettings.StandaloneInventoryPlugin,
172 m_openSim.ConfigurationSettings.StandaloneInventorySource);
173
174 foreach (IInventoryDataPlugin plugin in plugins)
175 {
176 // Using the OSP wrapper plugin for database plugins should be made configurable at some point
177 inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin));
178 }
169 179
170 LocalBackEndServices backendService = new LocalBackEndServices(); 180 LocalBackEndServices backendService = new LocalBackEndServices();
171 181
@@ -186,7 +196,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
186 196
187 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler()); 197 m_httpServer.AddStreamHandler(new OpenSim.SimStatusHandler());
188 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim)); 198 m_httpServer.AddStreamHandler(new OpenSim.XSimStatusHandler(m_openSim));
189 if(m_openSim.userStatsURI != String.Empty ) 199 if (m_openSim.userStatsURI != String.Empty )
190 m_httpServer.AddStreamHandler(new OpenSim.UXSimStatusHandler(m_openSim)); 200 m_httpServer.AddStreamHandler(new OpenSim.UXSimStatusHandler(m_openSim));
191 } 201 }
192 202
@@ -196,9 +206,16 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
196 206
197 HGInventoryServiceClient inventoryService 207 HGInventoryServiceClient inventoryService
198 = new HGInventoryServiceClient(m_openSim.NetServersInfo.InventoryURL, null, false); 208 = new HGInventoryServiceClient(m_openSim.NetServersInfo.InventoryURL, null, false);
199 inventoryService.AddPlugin( 209 List<IInventoryDataPlugin> plugins
200 m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, 210 = DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(
201 m_openSim.ConfigurationSettings.StandaloneInventorySource); 211 m_openSim.ConfigurationSettings.StandaloneInventoryPlugin,
212 m_openSim.ConfigurationSettings.StandaloneInventorySource);
213
214 foreach (IInventoryDataPlugin plugin in plugins)
215 {
216 // Using the OSP wrapper plugin should be made configurable at some point
217 inventoryService.AddPlugin(new OspInventoryWrapperPlugin(plugin));
218 }
202 219
203 HGGridServicesStandalone gridService 220 HGGridServicesStandalone gridService
204 = new HGGridServicesStandalone( 221 = new HGGridServicesStandalone(
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 0909a52..010429d 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Framework.Communications
67 public void AddPlugin(string provider, string connect) 67 public void AddPlugin(string provider, string connect)
68 { 68 {
69 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(provider, connect)); 69 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IInventoryDataPlugin>(provider, connect));
70 } 70 }
71 71
72 #endregion 72 #endregion
73 73
diff --git a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
new file mode 100644
index 0000000..3a692ae
--- /dev/null
+++ b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs
@@ -0,0 +1,95 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSim Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using OpenSim.Data;
30using OpenMetaverse;
31
32namespace OpenSim.Framework.Communications.Osp
33{
34 /// <summary>
35 /// Wrap other inventory data plugins so that we can perform OSP related post processing for items
36 /// </summary>
37 public class OspInventoryWrapperPlugin : IInventoryDataPlugin
38 {
39 protected IInventoryDataPlugin m_wrappedPlugin;
40
41 public OspInventoryWrapperPlugin(IInventoryDataPlugin wrappedPlugin)
42 {
43 m_wrappedPlugin = wrappedPlugin;
44 }
45
46 public string Name { get { return "OspInventoryWrapperPlugin"; } }
47 public string Version { get { return "0.1"; } }
48 public void Initialise() {}
49 public void Initialise(string connect) {}
50 public void Dispose() {}
51
52 public InventoryItemBase getInventoryItem(UUID item)
53 {
54 return m_wrappedPlugin.getInventoryItem(item);
55
56 // TODO: Need to post process here
57 }
58
59 // XXX: Why on earth does this exist as it appears to duplicate getInventoryItem?
60 public InventoryItemBase queryInventoryItem(UUID item)
61 {
62 return m_wrappedPlugin.queryInventoryItem(item);
63
64 // TODO: Need to post process here
65 }
66
67 public List<InventoryItemBase> getInventoryInFolder(UUID folderID)
68 {
69 return m_wrappedPlugin.getInventoryInFolder(folderID);
70
71 // TODO: Need to post process here
72 }
73
74 public List<InventoryItemBase> fetchActiveGestures(UUID avatarID)
75 {
76 return m_wrappedPlugin.fetchActiveGestures(avatarID);
77
78 // Presuming that no post processing is needed here as gestures don't refer to creator information (?)
79 }
80
81 public List<InventoryFolderBase> getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); }
82 public List<InventoryFolderBase> getUserRootFolders(UUID user) { return m_wrappedPlugin.getUserRootFolders(user); }
83 public InventoryFolderBase getUserRootFolder(UUID user) { return m_wrappedPlugin.getUserRootFolder(user); }
84 public List<InventoryFolderBase> getInventoryFolders(UUID parentID) { return m_wrappedPlugin.getInventoryFolders(parentID); }
85 public InventoryFolderBase getInventoryFolder(UUID folder) { return m_wrappedPlugin.getInventoryFolder(folder); }
86 public void addInventoryItem(InventoryItemBase item) { m_wrappedPlugin.addInventoryItem(item); }
87 public void updateInventoryItem(InventoryItemBase item) { m_wrappedPlugin.updateInventoryItem(item); }
88 public void deleteInventoryItem(UUID item) { m_wrappedPlugin.deleteInventoryItem(item); }
89 public InventoryFolderBase queryInventoryFolder(UUID folder) { return m_wrappedPlugin.queryInventoryFolder(folder); }
90 public void addInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.addInventoryFolder(folder); }
91 public void updateInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.updateInventoryFolder(folder); }
92 public void moveInventoryFolder(InventoryFolderBase folder) { m_wrappedPlugin.moveInventoryFolder(folder); }
93 public void deleteInventoryFolder(UUID folder) { m_wrappedPlugin.deleteInventoryFolder(folder); }
94 }
95}