From e12b0a249674bbe4b1980c74f13d8f09cc2e4432 Mon Sep 17 00:00:00 2001 From: Mike Mazur Date: Tue, 3 Feb 2009 05:20:16 +0000 Subject: [PATCH] - move IAssetDataPlugin from OpenSim/Framework/IAssetProvider.cs to OpenSim/Data/IAssetData.cs - remove some trailing whitespace --- .../IAssetProvider.cs => Data/IAssetData.cs} | 3 +- OpenSim/Data/MSSQL/MSSQLAssetData.cs | 4 +- .../Communications/Cache/AssetServerBase.cs | 1 + .../Communications/Cache/SQLAssetServer.cs | 1 + OpenSim/Grid/AssetServer/Main.cs | 1 + OpenSim/Grid/AssetServer/RestService.cs | 3 +- .../Hypergrid/HGStandaloneAssetService.cs | 45 ++++++++++--------- .../Tests/Common/Mock/TestAssetDataPlugin.cs | 6 +-- prebuild.xml | 10 +++-- 9 files changed, 41 insertions(+), 33 deletions(-) rename OpenSim/{Framework/IAssetProvider.cs => Data/IAssetData.cs} (97%) diff --git a/OpenSim/Framework/IAssetProvider.cs b/OpenSim/Data/IAssetData.cs similarity index 97% rename from OpenSim/Framework/IAssetProvider.cs rename to OpenSim/Data/IAssetData.cs index 77e0d0c6d8..47e25f3cf7 100644 --- a/OpenSim/Framework/IAssetProvider.cs +++ b/OpenSim/Data/IAssetData.cs @@ -26,8 +26,9 @@ */ using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Framework +namespace OpenSim.Data { public interface IAssetDataPlugin : IPlugin { diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 2fe89e223e..3eaae125e3 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -42,7 +42,7 @@ namespace OpenSim.Data.MSSQL private const string _migrationStore = "AssetStore"; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private long TicksToEpoch; + private long TicksToEpoch; /// /// Database manager /// @@ -212,7 +212,7 @@ namespace OpenSim.Data.MSSQL } } -// Commented out since currently unused - this probably should be called in FetchAsset() +// Commented out since currently unused - this probably should be called in FetchAsset() // private void UpdateAccessTime(AssetBase asset) // { // using (AutoClosingSqlCommand cmd = database.Query("UPDATE assets SET access_time = @access_time WHERE id=@id")) diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 7fb06b9e35..cc5ba8e976 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -32,6 +32,7 @@ using OpenMetaverse; using log4net; using OpenSim.Framework.AssetLoader.Filesystem; using OpenSim.Framework.Statistics; +using OpenSim.Data; namespace OpenSim.Framework.Communications.Cache { diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs index 00dbad0e1e..6266bf00fb 100644 --- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs +++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs @@ -28,6 +28,7 @@ using System; using System.Reflection; using log4net; +using OpenSim.Data; namespace OpenSim.Framework.Communications.Cache { diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index b5c8df01d1..07fe0a44a6 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -36,6 +36,7 @@ using OpenSim.Framework.AssetLoader.Filesystem; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Statistics; +using OpenSim.Data; namespace OpenSim.Grid.AssetServer { diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs index e81cb3fd79..3613cd886c 100644 --- a/OpenSim/Grid/AssetServer/RestService.cs +++ b/OpenSim/Grid/AssetServer/RestService.cs @@ -37,6 +37,7 @@ using log4net; using OpenSim.Framework; using OpenSim.Framework.Servers; using OpenSim.Framework.Statistics; +using OpenSim.Data; namespace OpenSim.Grid.AssetServer { @@ -98,7 +99,7 @@ namespace OpenSim.Grid.AssetServer result = ms.GetBuffer(); //Ckrinke 1/11/09 Commenting out the succesful REST message as under heavy use there -//are multiple messages in a second and that is usually (in my experience) meaning +//are multiple messages in a second and that is usually (in my experience) meaning //the logging itself is slowing down the program. Leaving the unsuccesful message //as we need to know about that path. // m_log.InfoFormat( diff --git a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs index 24de4e88e3..285a01916d 100644 --- a/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs +++ b/OpenSim/Region/Environment/Modules/Hypergrid/HGStandaloneAssetService.cs @@ -1,29 +1,29 @@ /** * Copyright (c) 2008, Contributors. All rights reserved. * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without modification, + * + * 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, + * + * * 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 + * * 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 Organizations nor the names of Individual - * Contributors may be used to endorse or promote products derived from + * Contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR 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 + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR 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; @@ -43,6 +43,7 @@ using OpenSim.Framework.Servers; using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Scenes; using OpenSim.Grid.AssetServer; +using OpenSim.Data; namespace OpenSim.Region.Environment.Modules.Hypergrid { @@ -51,10 +52,10 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static bool initialized = false; private static bool enabled = false; - + Scene m_scene; //AssetService m_assetService; - + #region IRegionModule interface public void Initialise(Scene scene, IConfigSource config) @@ -98,7 +99,7 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid } - public class AssetService + public class AssetService { private IUserService m_userService; private bool m_doLookup = false; @@ -120,8 +121,8 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid protected void AddHttpHandlers(Scene m_scene) { IAssetDataPlugin m_assetProvider = ((AssetServerBase)m_scene.AssetCache.AssetServer).AssetProviderPlugin; - - BaseHttpServer httpServer = m_scene.CommsManager.HttpServer; + + BaseHttpServer httpServer = m_scene.CommsManager.HttpServer; httpServer.AddStreamHandler(new GetAssetStreamHandler(m_assetProvider)); httpServer.AddStreamHandler(new PostAssetStreamHandler(m_assetProvider)); diff --git a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs index ebece27048..fc84eac9c7 100644 --- a/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestAssetDataPlugin.cs @@ -27,7 +27,7 @@ using OpenMetaverse; using OpenSim.Framework; -using OpenSim.Framework.Communications; +using OpenSim.Data; namespace OpenSim.Tests.Common.Mock { @@ -35,7 +35,7 @@ namespace OpenSim.Tests.Common.Mock /// In memory asset data plugin for test purposes. Could be another dll when properly filled out and when the /// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit /// tests are single threaded. - /// + /// public class TestAssetDataPlugin : IAssetDataPlugin { public string Version { get { return "0"; } } @@ -43,7 +43,7 @@ namespace OpenSim.Tests.Common.Mock public void Initialise() {} public void Dispose() {} - + public AssetBase FetchAsset(UUID uuid) { return null; } public void CreateAsset(AssetBase asset) {} public void UpdateAsset(AssetBase asset) {} diff --git a/prebuild.xml b/prebuild.xml index 6b1bce37d2..47ae00c1ea 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -716,6 +716,7 @@ + @@ -2217,7 +2218,7 @@ - + @@ -2297,6 +2298,7 @@ + @@ -2317,7 +2319,7 @@ ../../../bin/ - + ../../../bin/ @@ -2580,7 +2582,7 @@ -