aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityInventory.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEstateDataService.cs45
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs98
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs4
-rw-r--r--OpenSim/Region/Framework/StorageManager.cs80
8 files changed, 121 insertions, 116 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 54845fd..7edb43e 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Interfaces
200 /// Backup the inventory to the given data store 200 /// Backup the inventory to the given data store
201 /// </summary> 201 /// </summary>
202 /// <param name="datastore"></param> 202 /// <param name="datastore"></param>
203 void ProcessInventoryBackup(ISimulationDataStore datastore); 203 void ProcessInventoryBackup(ISimulationDataService datastore);
204 204
205 uint MaskEffectivePermissions(); 205 uint MaskEffectivePermissions();
206 206
diff --git a/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
new file mode 100644
index 0000000..95c9659
--- /dev/null
+++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs
@@ -0,0 +1,45 @@
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 OpenSimulator 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;
29using System.Collections.Generic;
30using OpenSim.Framework;
31using OpenMetaverse;
32
33namespace OpenSim.Region.Framework.Interfaces
34{
35 public interface IEstateDataService
36 {
37 EstateSettings LoadEstateSettings(UUID regionID, bool create);
38 EstateSettings LoadEstateSettings(int estateID);
39 void StoreEstateSettings(EstateSettings es);
40 List<int> GetEstates(string search);
41 bool LinkRegion(UUID regionID, int estateID);
42 List<UUID> GetRegions(int estateID);
43 bool DeleteEstate(int estateID);
44 }
45}
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index ff4595e..437b91a 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes
57 57
58 public event OnTerrainTickDelegate OnTerrainTick; 58 public event OnTerrainTickDelegate OnTerrainTick;
59 59
60 public delegate void OnBackupDelegate(ISimulationDataStore datastore, bool forceBackup); 60 public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup);
61 61
62 public event OnBackupDelegate OnBackup; 62 public event OnBackupDelegate OnBackup;
63 63
@@ -684,7 +684,7 @@ namespace OpenSim.Region.Framework.Scenes
684 } 684 }
685 } 685 }
686 686
687 public void TriggerOnBackup(ISimulationDataStore dstore, bool forced) 687 public void TriggerOnBackup(ISimulationDataService dstore, bool forced)
688 { 688 {
689 OnBackupDelegate handlerOnAttach = OnBackup; 689 OnBackupDelegate handlerOnAttach = OnBackup;
690 if (handlerOnAttach != null) 690 if (handlerOnAttach != null)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f8877e4..6d2ae5a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -100,10 +100,11 @@ namespace OpenSim.Region.Framework.Scenes
100 protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); 100 protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
101 protected string m_simulatorVersion = "OpenSimulator Server"; 101 protected string m_simulatorVersion = "OpenSimulator Server";
102 protected ModuleLoader m_moduleLoader; 102 protected ModuleLoader m_moduleLoader;
103 protected StorageManager m_storageManager;
104 protected AgentCircuitManager m_authenticateHandler; 103 protected AgentCircuitManager m_authenticateHandler;
105 protected SceneCommunicationService m_sceneGridService; 104 protected SceneCommunicationService m_sceneGridService;
106 105
106 protected ISimulationDataService m_SimulationDataService;
107 protected IEstateDataService m_EstateDataService;
107 protected IAssetService m_AssetService; 108 protected IAssetService m_AssetService;
108 protected IAuthorizationService m_AuthorizationService; 109 protected IAuthorizationService m_AuthorizationService;
109 protected IInventoryService m_InventoryService; 110 protected IInventoryService m_InventoryService;
@@ -216,6 +217,42 @@ namespace OpenSim.Region.Framework.Scenes
216 get { return m_sceneGridService; } 217 get { return m_sceneGridService; }
217 } 218 }
218 219
220 public ISimulationDataService SimulationDataService
221 {
222 get
223 {
224 if (m_SimulationDataService == null)
225 {
226 m_SimulationDataService = RequestModuleInterface<ISimulationDataService>();
227
228 if (m_SimulationDataService == null)
229 {
230 throw new Exception("No ISimulationDataService available.");
231 }
232 }
233
234 return m_SimulationDataService;
235 }
236 }
237
238 public IEstateDataService EstateDataService
239 {
240 get
241 {
242 if (m_EstateDataService == null)
243 {
244 m_EstateDataService = RequestModuleInterface<IEstateDataService>();
245
246 if (m_EstateDataService == null)
247 {
248 throw new Exception("No IEstateDataService available.");
249 }
250 }
251
252 return m_EstateDataService;
253 }
254 }
255
219 public IAssetService AssetService 256 public IAssetService AssetService
220 { 257 {
221 get 258 get
@@ -468,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes
468 505
469 public Scene(RegionInfo regInfo, AgentCircuitManager authen, 506 public Scene(RegionInfo regInfo, AgentCircuitManager authen,
470 SceneCommunicationService sceneGridService, 507 SceneCommunicationService sceneGridService,
471 StorageManager storeManager, 508 ISimulationDataService simDataService, IEstateDataService estateDataService,
472 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, 509 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
473 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) 510 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
474 { 511 {
@@ -504,7 +541,8 @@ namespace OpenSim.Region.Framework.Scenes
504 m_moduleLoader = moduleLoader; 541 m_moduleLoader = moduleLoader;
505 m_authenticateHandler = authen; 542 m_authenticateHandler = authen;
506 m_sceneGridService = sceneGridService; 543 m_sceneGridService = sceneGridService;
507 m_storageManager = storeManager; 544 m_SimulationDataService = simDataService;
545 m_EstateDataService = estateDataService;
508 m_regInfo = regInfo; 546 m_regInfo = regInfo;
509 m_regionHandle = m_regInfo.RegionHandle; 547 m_regionHandle = m_regInfo.RegionHandle;
510 m_regionName = m_regInfo.RegionName; 548 m_regionName = m_regInfo.RegionName;
@@ -523,11 +561,9 @@ namespace OpenSim.Region.Framework.Scenes
523 #region Region Settings 561 #region Region Settings
524 562
525 // Load region settings 563 // Load region settings
526 m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); 564 m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID);
527 if (m_storageManager.EstateDataStore != null) 565 if (estateDataService != null)
528 { 566 m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);
529 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
530 }
531 567
532 #endregion Region Settings 568 #endregion Region Settings
533 569
@@ -537,9 +573,9 @@ namespace OpenSim.Region.Framework.Scenes
537 573
538 //Bind Storage Manager functions to some land manager functions for this scene 574 //Bind Storage Manager functions to some land manager functions for this scene
539 EventManager.OnLandObjectAdded += 575 EventManager.OnLandObjectAdded +=
540 new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); 576 new EventManager.LandObjectAdded(simDataService.StoreLandObject);
541 EventManager.OnLandObjectRemoved += 577 EventManager.OnLandObjectRemoved +=
542 new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); 578 new EventManager.LandObjectRemoved(simDataService.RemoveLandObject);
543 579
544 m_sceneGraph = new SceneGraph(this, m_regInfo); 580 m_sceneGraph = new SceneGraph(this, m_regInfo);
545 581
@@ -1085,7 +1121,7 @@ namespace OpenSim.Region.Framework.Scenes
1085 { 1121 {
1086 if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) 1122 if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged)
1087 { 1123 {
1088 ((SceneObjectGroup)entity).ProcessBackup(m_storageManager.DataStore, false); 1124 ((SceneObjectGroup)entity).ProcessBackup(SimulationDataService, false);
1089 } 1125 }
1090 } 1126 }
1091 1127
@@ -1526,7 +1562,7 @@ namespace OpenSim.Region.Framework.Scenes
1526 { 1562 {
1527 lock (m_returns) 1563 lock (m_returns)
1528 { 1564 {
1529 EventManager.TriggerOnBackup(m_storageManager.DataStore, forced); 1565 EventManager.TriggerOnBackup(SimulationDataService, forced);
1530 m_backingup = false; 1566 m_backingup = false;
1531 1567
1532 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) 1568 foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns)
@@ -1567,7 +1603,7 @@ namespace OpenSim.Region.Framework.Scenes
1567 { 1603 {
1568 if (group != null) 1604 if (group != null)
1569 { 1605 {
1570 group.ProcessBackup(m_storageManager.DataStore, true); 1606 group.ProcessBackup(SimulationDataService, true);
1571 } 1607 }
1572 } 1608 }
1573 1609
@@ -1609,19 +1645,19 @@ namespace OpenSim.Region.Framework.Scenes
1609 /// </summary> 1645 /// </summary>
1610 public void SaveTerrain() 1646 public void SaveTerrain()
1611 { 1647 {
1612 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1648 SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
1613 } 1649 }
1614 1650
1615 public void StoreWindlightProfile(RegionLightShareData wl) 1651 public void StoreWindlightProfile(RegionLightShareData wl)
1616 { 1652 {
1617 m_regInfo.WindlightSettings = wl; 1653 m_regInfo.WindlightSettings = wl;
1618 m_storageManager.DataStore.StoreRegionWindlightSettings(wl); 1654 SimulationDataService.StoreRegionWindlightSettings(wl);
1619 m_eventManager.TriggerOnSaveNewWindlightProfile(); 1655 m_eventManager.TriggerOnSaveNewWindlightProfile();
1620 } 1656 }
1621 1657
1622 public void LoadWindlightProfile() 1658 public void LoadWindlightProfile()
1623 { 1659 {
1624 m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); 1660 m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID);
1625 m_eventManager.TriggerOnSaveNewWindlightProfile(); 1661 m_eventManager.TriggerOnSaveNewWindlightProfile();
1626 } 1662 }
1627 1663
@@ -1632,13 +1668,13 @@ namespace OpenSim.Region.Framework.Scenes
1632 { 1668 {
1633 try 1669 try
1634 { 1670 {
1635 double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); 1671 double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID);
1636 if (map == null) 1672 if (map == null)
1637 { 1673 {
1638 m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain."); 1674 m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
1639 Heightmap = new TerrainChannel(); 1675 Heightmap = new TerrainChannel();
1640 1676
1641 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1677 SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
1642 } 1678 }
1643 else 1679 else
1644 { 1680 {
@@ -1655,7 +1691,7 @@ namespace OpenSim.Region.Framework.Scenes
1655 { 1691 {
1656 Heightmap = new TerrainChannel(); 1692 Heightmap = new TerrainChannel();
1657 1693
1658 m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); 1694 SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
1659 } 1695 }
1660 } 1696 }
1661 catch (Exception e) 1697 catch (Exception e)
@@ -1702,7 +1738,7 @@ namespace OpenSim.Region.Framework.Scenes
1702 public void loadAllLandObjectsFromStorage(UUID regionID) 1738 public void loadAllLandObjectsFromStorage(UUID regionID)
1703 { 1739 {
1704 m_log.Info("[SCENE]: Loading land objects from storage"); 1740 m_log.Info("[SCENE]: Loading land objects from storage");
1705 List<LandData> landData = m_storageManager.DataStore.LoadLandObjects(regionID); 1741 List<LandData> landData = SimulationDataService.LoadLandObjects(regionID);
1706 1742
1707 if (LandChannel != null) 1743 if (LandChannel != null)
1708 { 1744 {
@@ -1733,7 +1769,7 @@ namespace OpenSim.Region.Framework.Scenes
1733 LoadingPrims = true; 1769 LoadingPrims = true;
1734 m_log.Info("[SCENE]: Loading objects from datastore"); 1770 m_log.Info("[SCENE]: Loading objects from datastore");
1735 1771
1736 List<SceneObjectGroup> PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); 1772 List<SceneObjectGroup> PrimsFromDB = SimulationDataService.LoadObjects(regionID);
1737 1773
1738 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); 1774 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore");
1739 1775
@@ -2103,7 +2139,7 @@ namespace OpenSim.Region.Framework.Scenes
2103 // to the DB. 2139 // to the DB.
2104 ForceSceneObjectBackup(so); 2140 ForceSceneObjectBackup(so);
2105 so.DetachFromBackup(); 2141 so.DetachFromBackup();
2106 m_storageManager.DataStore.RemoveObject(so.UUID, m_regInfo.RegionID); 2142 SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
2107 } 2143 }
2108 2144
2109 // We need to keep track of this state in case this group is still queued for further backup. 2145 // We need to keep track of this state in case this group is still queued for further backup.
@@ -4408,7 +4444,7 @@ namespace OpenSim.Region.Framework.Scenes
4408 4444
4409 public void DeleteFromStorage(UUID uuid) 4445 public void DeleteFromStorage(UUID uuid)
4410 { 4446 {
4411 m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); 4447 SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID);
4412 } 4448 }
4413 4449
4414 public int GetHealth() 4450 public int GetHealth()
@@ -4817,17 +4853,21 @@ namespace OpenSim.Region.Framework.Scenes
4817 4853
4818 public List<UUID> GetEstateRegions(int estateID) 4854 public List<UUID> GetEstateRegions(int estateID)
4819 { 4855 {
4820 if (m_storageManager.EstateDataStore == null) 4856 IEstateDataService estateDataService = EstateDataService;
4821 return new List<UUID>(); 4857 if (estateDataService == null)
4858 return new List<UUID>(0);
4822 4859
4823 return m_storageManager.EstateDataStore.GetRegions(estateID); 4860 return estateDataService.GetRegions(estateID);
4824 } 4861 }
4825 4862
4826 public void ReloadEstateData() 4863 public void ReloadEstateData()
4827 { 4864 {
4828 m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); 4865 IEstateDataService estateDataService = EstateDataService;
4829 4866 if (estateDataService != null)
4830 TriggerEstateSunUpdate(); 4867 {
4868 m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);
4869 TriggerEstateSunUpdate();
4870 }
4831 } 4871 }
4832 4872
4833 public void TriggerEstateSunUpdate() 4873 public void TriggerEstateSunUpdate()
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 4caa439..2c1f207 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes
1378 /// Processes backup. 1378 /// Processes backup.
1379 /// </summary> 1379 /// </summary>
1380 /// <param name="datastore"></param> 1380 /// <param name="datastore"></param>
1381 public virtual void ProcessBackup(ISimulationDataStore datastore, bool forcedBackup) 1381 public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup)
1382 { 1382 {
1383 if (!m_isBackedUp) 1383 if (!m_isBackedUp)
1384 { 1384 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 4affdef..53ddb5d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes
848 /// Process inventory backup 848 /// Process inventory backup
849 /// </summary> 849 /// </summary>
850 /// <param name="datastore"></param> 850 /// <param name="datastore"></param>
851 public void ProcessInventoryBackup(ISimulationDataStore datastore) 851 public void ProcessInventoryBackup(ISimulationDataService datastore)
852 { 852 {
853 if (HasInventoryChanged) 853 if (HasInventoryChanged)
854 { 854 {
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index 9f787c9..60824be 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
292 // scene backup thread. 292 // scene backup thread.
293 scene.Backup(true); 293 scene.Backup(true);
294 294
295 List<SceneObjectGroup> storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); 295 List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
296 296
297 Assert.That(storedObjects.Count, Is.EqualTo(1)); 297 Assert.That(storedObjects.Count, Is.EqualTo(1));
298 Assert.That(storedObjects[0].Children.Count, Is.EqualTo(2)); 298 Assert.That(storedObjects[0].Children.Count, Is.EqualTo(2));
@@ -335,7 +335,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
335 SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); 335 SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
336 scene.DeleteSceneObject(groupToDelete, false); 336 scene.DeleteSceneObject(groupToDelete, false);
337 337
338 List<SceneObjectGroup> storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); 338 List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
339 339
340 Assert.That(storedObjects.Count, Is.EqualTo(1)); 340 Assert.That(storedObjects.Count, Is.EqualTo(1));
341 Assert.That(storedObjects[0].Children.Count, Is.EqualTo(1)); 341 Assert.That(storedObjects[0].Children.Count, Is.EqualTo(1));
diff --git a/OpenSim/Region/Framework/StorageManager.cs b/OpenSim/Region/Framework/StorageManager.cs
deleted file mode 100644
index c858d56..0000000
--- a/OpenSim/Region/Framework/StorageManager.cs
+++ /dev/null
@@ -1,80 +0,0 @@
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 OpenSimulator 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;
29using System.Reflection;
30using log4net;
31using OpenSim.Region.Framework.Interfaces;
32
33namespace OpenSim.Region.Framework
34{
35 public class StorageManager
36 {
37 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
38
39 public readonly ISimulationDataStore DataStore;
40 public readonly IEstateDataStore EstateDataStore;
41
42 public StorageManager(string dllName, string connectionstring, string estateconnectionstring)
43 {
44 m_log.Info("[DATASTORE]: Attempting to load " + dllName);
45 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
46
47 foreach (Type pluginType in pluginAssembly.GetTypes())
48 {
49 if (pluginType.IsPublic)
50 {
51 Type typeInterface = pluginType.GetInterface("ISimulationDataStore", true);
52
53 if (typeInterface != null)
54 {
55 ISimulationDataStore plug =
56 (ISimulationDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
57 plug.Initialise(connectionstring);
58
59 DataStore = plug;
60
61 m_log.Info("[DATASTORE]: Added ISimulationDataStore Interface");
62 }
63
64 typeInterface = pluginType.GetInterface("IEstateDataStore", true);
65
66 if (typeInterface != null)
67 {
68 IEstateDataStore estPlug =
69 (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
70 estPlug.Initialise(estateconnectionstring);
71
72 EstateDataStore = estPlug;
73 }
74 }
75 }
76
77 //TODO: Add checking and warning to make sure it initialised.
78 }
79 }
80}