From 0db1ed0b5a6f5bd104c6008f142d173c84263ce5 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 12 Sep 2010 14:20:26 -0700 Subject: * Added ISimulationDataService and IEstateDataService * Removed StorageManager * CONFIG CHANGE: There are no more database settings in OpenSim.ini. Check the config-include configuration files for region store and estate store database settings --- OpenSim/Region/Application/ConfigurationLoader.cs | 4 - OpenSim/Region/Application/OpenSimBase.cs | 56 ++++++----- .../Region/ClientStack/RegionApplicationBase.cs | 33 ++----- .../Framework/Interfaces/IEntityInventory.cs | 2 +- .../Framework/Interfaces/IEstateDataService.cs | 45 +++++++++ OpenSim/Region/Framework/Scenes/EventManager.cs | 4 +- OpenSim/Region/Framework/Scenes/Scene.cs | 102 ++++++++++++++------- .../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- .../Framework/Scenes/SceneObjectPartInventory.cs | 2 +- .../Scenes/Tests/SceneObjectLinkingTests.cs | 4 +- OpenSim/Region/Framework/StorageManager.cs | 80 ---------------- 11 files changed, 165 insertions(+), 169 deletions(-) create mode 100644 OpenSim/Region/Framework/Interfaces/IEstateDataService.cs delete mode 100644 OpenSim/Region/Framework/StorageManager.cs (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index e69e3fc..e2e0640 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -345,10 +345,6 @@ namespace OpenSim m_configSettings.StorageDll = startupConfig.GetString("storage_plugin"); - m_configSettings.StorageConnectionString - = startupConfig.GetString("storage_connection_string"); - m_configSettings.EstateConnectionString - = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString); m_configSettings.ClientstackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); } diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d2d2607..74ad168 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -45,6 +45,7 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; +using OpenSim.Server.Base; namespace OpenSim { @@ -186,6 +187,24 @@ namespace OpenSim userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); } + // Load the simulation data service + IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; + if (simDataConfig == null) + throw new Exception("Configuration file is missing the [SimulationDataStore] section"); + string module = simDataConfig.GetString("LocalServiceModule", String.Empty); + if (String.IsNullOrEmpty(module)) + throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section"); + m_simulationDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + + // Load the estate data service + IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; + if (estateDataConfig == null) + throw new Exception("Configuration file is missing the [EstateDataStore] section"); + module = estateDataConfig.GetString("LocalServiceModule", String.Empty); + if (String.IsNullOrEmpty(module)) + throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); + m_estateDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + base.StartupSpecific(); m_stats = StatsManager.StartCollectingSimExtraStats(); @@ -536,7 +555,7 @@ namespace OpenSim regionInfo.InternalEndPoint.Port = (int) port; - Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); + Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); if (m_autoCreateClientStack) { @@ -552,30 +571,19 @@ namespace OpenSim return scene; } - protected override StorageManager CreateStorageManager() - { - return - CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString); - } - - protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) - { - return new StorageManager(m_configSettings.StorageDll, connectionstring, estateconnectionstring); - } - protected override ClientStackManager CreateClientStackManager() { return new ClientStackManager(m_configSettings.ClientstackDll); } - protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, - AgentCircuitManager circuitManager) + protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, + IEstateDataService estateDataService, AgentCircuitManager circuitManager) { SceneCommunicationService sceneGridService = new SceneCommunicationService(); return new Scene( regionInfo, circuitManager, sceneGridService, - storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, + simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); } @@ -792,21 +800,23 @@ namespace OpenSim /// public void PopulateRegionEstateInfo(RegionInfo regInfo) { - if (m_storageManager.EstateDataStore != null) + IEstateDataService estateDataService = EstateDataService; + + if (estateDataService != null) { - regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false); + regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false); } - + if (regInfo.EstateSettings.EstateID == 0) // No record at all { MainConsole.Instance.Output("Your region is not part of an estate."); while (true) { - string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() {"yes", "no"}); + string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() { "yes", "no" }); if (response == "no") { // Create a new estate - regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true); + regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true); regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); //regInfo.EstateSettings.Save(); @@ -818,7 +828,7 @@ namespace OpenSim if (response == "None") continue; - List estateIDs = m_storageManager.EstateDataStore.GetEstates(response); + List estateIDs = estateDataService.GetEstates(response); if (estateIDs.Count < 1) { MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); @@ -827,9 +837,9 @@ namespace OpenSim int estateID = estateIDs[0]; - regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); + regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID); - if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID)) + if (estateDataService.LinkRegion(regInfo.RegionID, estateID)) break; MainConsole.Instance.Output("Joining the estate failed. Please try again."); diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 46b68ec..ea1317a 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -36,6 +36,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; @@ -48,28 +49,16 @@ namespace OpenSim.Region.ClientStack protected Dictionary m_clientCircuits = new Dictionary(); protected NetworkServersInfo m_networkServersInfo; - - public NetworkServersInfo NetServersInfo - { - get { return m_networkServersInfo; } - } - protected uint m_httpServerPort; - - protected StorageManager m_storageManager; - - public StorageManager StorageManager - { - get { return m_storageManager; } - } - + protected ISimulationDataService m_simulationDataService; + protected IEstateDataService m_estateDataService; protected ClientStackManager m_clientStackManager; - - public SceneManager SceneManager - { - get { return m_sceneManager; } - } protected SceneManager m_sceneManager = new SceneManager(); + + public SceneManager SceneManager { get { return m_sceneManager; } } + public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } + public ISimulationDataService SimulationDataService { get { return m_simulationDataService; } } + public IEstateDataService EstateDataService { get { return m_estateDataService; } } protected abstract void Initialize(); @@ -83,15 +72,11 @@ namespace OpenSim.Region.ClientStack /// protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); - protected abstract StorageManager CreateStorageManager(); protected abstract ClientStackManager CreateClientStackManager(); - protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, - AgentCircuitManager circuitManager); + protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); protected override void StartupSpecific() { - m_storageManager = CreateStorageManager(); - m_clientStackManager = CreateClientStackManager(); Initialize(); 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 /// Backup the inventory to the given data store /// /// - void ProcessInventoryBackup(ISimulationDataStore datastore); + void ProcessInventoryBackup(ISimulationDataService datastore); uint MaskEffectivePermissions(); 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 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenSim.Framework; +using OpenMetaverse; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface IEstateDataService + { + EstateSettings LoadEstateSettings(UUID regionID, bool create); + EstateSettings LoadEstateSettings(int estateID); + void StoreEstateSettings(EstateSettings es); + List GetEstates(string search); + bool LinkRegion(UUID regionID, int estateID); + List GetRegions(int estateID); + bool DeleteEstate(int estateID); + } +} diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 6b2e03e..72b8de8 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnTerrainTickDelegate OnTerrainTick; - public delegate void OnBackupDelegate(ISimulationDataStore datastore, bool forceBackup); + public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); public event OnBackupDelegate OnBackup; @@ -684,7 +684,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerOnBackup(ISimulationDataStore dstore, bool forced) + public void TriggerOnBackup(ISimulationDataService dstore, bool forced) { OnBackupDelegate handlerOnAttach = OnBackup; if (handlerOnAttach != null) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 46b84bb..9a9ef5f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -100,10 +100,11 @@ namespace OpenSim.Region.Framework.Scenes protected List m_neighbours = new List(); protected string m_simulatorVersion = "OpenSimulator Server"; protected ModuleLoader m_moduleLoader; - protected StorageManager m_storageManager; protected AgentCircuitManager m_authenticateHandler; protected SceneCommunicationService m_sceneGridService; + protected ISimulationDataService m_SimulationDataService; + protected IEstateDataService m_EstateDataService; protected IAssetService m_AssetService; protected IAuthorizationService m_AuthorizationService; protected IInventoryService m_InventoryService; @@ -216,6 +217,42 @@ namespace OpenSim.Region.Framework.Scenes get { return m_sceneGridService; } } + public ISimulationDataService SimulationDataService + { + get + { + if (m_SimulationDataService == null) + { + m_SimulationDataService = RequestModuleInterface(); + + if (m_SimulationDataService == null) + { + throw new Exception("No ISimulationDataService available."); + } + } + + return m_SimulationDataService; + } + } + + public IEstateDataService EstateDataService + { + get + { + if (m_EstateDataService == null) + { + m_EstateDataService = RequestModuleInterface(); + + if (m_EstateDataService == null) + { + throw new Exception("No IEstateDataService available."); + } + } + + return m_EstateDataService; + } + } + public IAssetService AssetService { get @@ -468,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes public Scene(RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, - StorageManager storeManager, + ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) { @@ -504,7 +541,8 @@ namespace OpenSim.Region.Framework.Scenes m_moduleLoader = moduleLoader; m_authenticateHandler = authen; m_sceneGridService = sceneGridService; - m_storageManager = storeManager; + m_SimulationDataService = simDataService; + m_EstateDataService = estateDataService; m_regInfo = regInfo; m_regionHandle = m_regInfo.RegionHandle; m_regionName = m_regInfo.RegionName; @@ -523,11 +561,9 @@ namespace OpenSim.Region.Framework.Scenes #region Region Settings // Load region settings - m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); - if (m_storageManager.EstateDataStore != null) - { - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); - } + m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID); + if (estateDataService != null) + m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); #endregion Region Settings @@ -537,9 +573,9 @@ namespace OpenSim.Region.Framework.Scenes //Bind Storage Manager functions to some land manager functions for this scene EventManager.OnLandObjectAdded += - new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); + new EventManager.LandObjectAdded(simDataService.StoreLandObject); EventManager.OnLandObjectRemoved += - new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); + new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); m_sceneGraph = new SceneGraph(this, m_regInfo); @@ -1085,7 +1121,7 @@ namespace OpenSim.Region.Framework.Scenes { if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) { - ((SceneObjectGroup)entity).ProcessBackup(m_storageManager.DataStore, false); + ((SceneObjectGroup)entity).ProcessBackup(SimulationDataService, false); } } @@ -1526,7 +1562,7 @@ namespace OpenSim.Region.Framework.Scenes { lock (m_returns) { - EventManager.TriggerOnBackup(m_storageManager.DataStore, forced); + EventManager.TriggerOnBackup(SimulationDataService, forced); m_backingup = false; foreach (KeyValuePair ret in m_returns) @@ -1567,7 +1603,7 @@ namespace OpenSim.Region.Framework.Scenes { if (group != null) { - group.ProcessBackup(m_storageManager.DataStore, true); + group.ProcessBackup(SimulationDataService, true); } } @@ -1609,19 +1645,19 @@ namespace OpenSim.Region.Framework.Scenes /// public void SaveTerrain() { - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } public void StoreWindlightProfile(RegionLightShareData wl) { m_regInfo.WindlightSettings = wl; - m_storageManager.DataStore.StoreRegionWindlightSettings(wl); + SimulationDataService.StoreRegionWindlightSettings(wl); m_eventManager.TriggerOnSaveNewWindlightProfile(); } public void LoadWindlightProfile() { - m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); + m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID); m_eventManager.TriggerOnSaveNewWindlightProfile(); } @@ -1632,13 +1668,13 @@ namespace OpenSim.Region.Framework.Scenes { try { - double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); + double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID); if (map == null) { m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain."); Heightmap = new TerrainChannel(); - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } else { @@ -1655,7 +1691,7 @@ namespace OpenSim.Region.Framework.Scenes { Heightmap = new TerrainChannel(); - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } } catch (Exception e) @@ -1702,7 +1738,7 @@ namespace OpenSim.Region.Framework.Scenes public void loadAllLandObjectsFromStorage(UUID regionID) { m_log.Info("[SCENE]: Loading land objects from storage"); - List landData = m_storageManager.DataStore.LoadLandObjects(regionID); + List landData = SimulationDataService.LoadLandObjects(regionID); if (LandChannel != null) { @@ -1733,7 +1769,7 @@ namespace OpenSim.Region.Framework.Scenes LoadingPrims = true; m_log.Info("[SCENE]: Loading objects from datastore"); - List PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); + List PrimsFromDB = SimulationDataService.LoadObjects(regionID); m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); @@ -2102,12 +2138,12 @@ namespace OpenSim.Region.Framework.Scenes // group has recently been delinked from another group but that this change has not been persisted // to the DB. ForceSceneObjectBackup(so); - so.DetachFromBackup(); - m_storageManager.DataStore.RemoveObject(so.UUID, m_regInfo.RegionID); + so.DetachFromBackup(); + SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID); } // We need to keep track of this state in case this group is still queued for further backup. - so.IsDeleted = true; + so.IsDeleted = true; return true; } @@ -4408,7 +4444,7 @@ namespace OpenSim.Region.Framework.Scenes public void DeleteFromStorage(UUID uuid) { - m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); + SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID); } public int GetHealth() @@ -4817,17 +4853,21 @@ namespace OpenSim.Region.Framework.Scenes public List GetEstateRegions(int estateID) { - if (m_storageManager.EstateDataStore == null) - return new List(); + IEstateDataService estateDataService = EstateDataService; + if (estateDataService == null) + return new List(0); - return m_storageManager.EstateDataStore.GetRegions(estateID); + return estateDataService.GetRegions(estateID); } public void ReloadEstateData() { - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); - - TriggerEstateSunUpdate(); + IEstateDataService estateDataService = EstateDataService; + if (estateDataService != null) + { + m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); + TriggerEstateSunUpdate(); + } } public void TriggerEstateSunUpdate() diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 4024328..454f031 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes /// Processes backup. /// /// - public virtual void ProcessBackup(ISimulationDataStore datastore, bool forcedBackup) + public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup) { if (!m_isBackedUp) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 1984d45..e45d488 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -848,7 +848,7 @@ namespace OpenSim.Region.Framework.Scenes /// Process inventory backup /// /// - public void ProcessInventoryBackup(ISimulationDataStore datastore) + public void ProcessInventoryBackup(ISimulationDataService datastore) { if (HasInventoryChanged) { diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index e3ef263..d634840 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 // scene backup thread. scene.Backup(true); - List storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); + List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); Assert.That(storedObjects.Count, Is.EqualTo(1)); Assert.That(storedObjects[0].Children.Count, Is.EqualTo(2)); @@ -335,7 +335,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); scene.DeleteSceneObject(groupToDelete, false); - List storedObjects = scene.StorageManager.DataStore.LoadObjects(scene.RegionInfo.RegionID); + List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); Assert.That(storedObjects.Count, Is.EqualTo(1)); 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 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Reflection; -using log4net; -using OpenSim.Region.Framework.Interfaces; - -namespace OpenSim.Region.Framework -{ - public class StorageManager - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public readonly ISimulationDataStore DataStore; - public readonly IEstateDataStore EstateDataStore; - - public StorageManager(string dllName, string connectionstring, string estateconnectionstring) - { - m_log.Info("[DATASTORE]: Attempting to load " + dllName); - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - Type typeInterface = pluginType.GetInterface("ISimulationDataStore", true); - - if (typeInterface != null) - { - ISimulationDataStore plug = - (ISimulationDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(connectionstring); - - DataStore = plug; - - m_log.Info("[DATASTORE]: Added ISimulationDataStore Interface"); - } - - typeInterface = pluginType.GetInterface("IEstateDataStore", true); - - if (typeInterface != null) - { - IEstateDataStore estPlug = - (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - estPlug.Initialise(estateconnectionstring); - - EstateDataStore = estPlug; - } - } - } - - //TODO: Add checking and warning to make sure it initialised. - } - } -} -- cgit v1.1