Rename IAssetProviderPlugin to IAssetDataPlugin aligning with the other data plugins.
parent
2c2f10e156
commit
f8e45e8e98
|
@ -30,7 +30,7 @@ using OpenSim.Framework;
|
||||||
|
|
||||||
namespace OpenSim.Data
|
namespace OpenSim.Data
|
||||||
{
|
{
|
||||||
public abstract class AssetDataBase : IAssetProviderPlugin
|
public abstract class AssetDataBase : IAssetDataPlugin
|
||||||
{
|
{
|
||||||
public abstract AssetBase FetchAsset(UUID uuid);
|
public abstract AssetBase FetchAsset(UUID uuid);
|
||||||
public abstract void CreateAsset(AssetBase asset);
|
public abstract void CreateAsset(AssetBase asset);
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace OpenSim.Data.MSSQL
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IAssetProviderPlugin Members
|
#region IAssetDataPlugin Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetch Asset from database
|
/// Fetch Asset from database
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace OpenSim.Data.MySQL
|
||||||
|
|
||||||
public override void Dispose() { }
|
public override void Dispose() { }
|
||||||
|
|
||||||
#region IAssetProviderPlugin Members
|
#region IAssetDataPlugin Members
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetch Asset <paramref name="assetID"/> from database
|
/// Fetch Asset <paramref name="assetID"/> from database
|
||||||
|
|
|
@ -43,9 +43,9 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
protected IAssetReceiver m_receiver;
|
protected IAssetReceiver m_receiver;
|
||||||
protected BlockingQueue<AssetRequest> m_assetRequests;
|
protected BlockingQueue<AssetRequest> m_assetRequests;
|
||||||
protected Thread m_localAssetServerThread;
|
protected Thread m_localAssetServerThread;
|
||||||
protected IAssetProviderPlugin m_assetProvider;
|
protected IAssetDataPlugin m_assetProvider;
|
||||||
|
|
||||||
public IAssetProviderPlugin AssetProviderPlugin
|
public IAssetDataPlugin AssetProviderPlugin
|
||||||
{
|
{
|
||||||
get { return m_assetProvider; }
|
get { return m_assetProvider; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
AddPlugin(pluginName, connect);
|
AddPlugin(pluginName, connect);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SQLAssetServer(IAssetProviderPlugin assetProvider)
|
public SQLAssetServer(IAssetDataPlugin assetProvider)
|
||||||
{
|
{
|
||||||
m_assetProvider = assetProvider;
|
m_assetProvider = assetProvider;
|
||||||
}
|
}
|
||||||
|
@ -54,12 +54,12 @@ namespace OpenSim.Framework.Communications.Cache
|
||||||
{
|
{
|
||||||
if (!pluginType.IsAbstract)
|
if (!pluginType.IsAbstract)
|
||||||
{
|
{
|
||||||
Type typeInterface = pluginType.GetInterface("IAssetProviderPlugin", true);
|
Type typeInterface = pluginType.GetInterface("IAssetDataPlugin", true);
|
||||||
|
|
||||||
if (typeInterface != null)
|
if (typeInterface != null)
|
||||||
{
|
{
|
||||||
IAssetProviderPlugin plug =
|
IAssetDataPlugin plug =
|
||||||
(IAssetProviderPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
(IAssetDataPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||||
m_assetProvider = plug;
|
m_assetProvider = plug;
|
||||||
m_assetProvider.Initialise(connect);
|
m_assetProvider.Initialise(connect);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ using OpenMetaverse;
|
||||||
|
|
||||||
namespace OpenSim.Framework
|
namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
public interface IAssetProviderPlugin : IPlugin
|
public interface IAssetDataPlugin : IPlugin
|
||||||
{
|
{
|
||||||
AssetBase FetchAsset(UUID uuid);
|
AssetBase FetchAsset(UUID uuid);
|
||||||
void CreateAsset(AssetBase asset);
|
void CreateAsset(AssetBase asset);
|
||||||
|
@ -44,7 +44,7 @@ namespace OpenSim.Framework
|
||||||
public AssetDataInitialiser (string s) { connect = s; }
|
public AssetDataInitialiser (string s) { connect = s; }
|
||||||
public override void Initialise (IPlugin plugin)
|
public override void Initialise (IPlugin plugin)
|
||||||
{
|
{
|
||||||
IAssetProviderPlugin p = plugin as IAssetProviderPlugin;
|
IAssetDataPlugin p = plugin as IAssetDataPlugin;
|
||||||
p.Initialise (connect);
|
p.Initialise (connect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
// Temporarily hardcoded - should be a plugin
|
// Temporarily hardcoded - should be a plugin
|
||||||
protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
|
protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
|
||||||
|
|
||||||
private IAssetProviderPlugin m_assetProvider;
|
private IAssetDataPlugin m_assetProvider;
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
@ -111,10 +111,10 @@ namespace OpenSim.Grid.AssetServer
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IAssetProviderPlugin LoadDatabasePlugin(string provider, string connect)
|
public IAssetDataPlugin LoadDatabasePlugin(string provider, string connect)
|
||||||
{
|
{
|
||||||
PluginLoader<IAssetProviderPlugin> loader =
|
PluginLoader<IAssetDataPlugin> loader =
|
||||||
new PluginLoader<IAssetProviderPlugin> (new AssetDataInitialiser (connect));
|
new PluginLoader<IAssetDataPlugin> (new AssetDataInitialiser (connect));
|
||||||
|
|
||||||
// loader will try to load all providers (MySQL, MSSQL, etc)
|
// loader will try to load all providers (MySQL, MSSQL, etc)
|
||||||
// unless it is constrainted to the correct "Provider" entry in the addin.xml
|
// unless it is constrainted to the correct "Provider" entry in the addin.xml
|
||||||
|
|
|
@ -45,14 +45,14 @@ namespace OpenSim.Grid.AssetServer
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
// private OpenAsset_Main m_assetManager;
|
// private OpenAsset_Main m_assetManager;
|
||||||
private IAssetProviderPlugin m_assetProvider;
|
private IAssetDataPlugin m_assetProvider;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor.
|
/// Constructor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="assetManager"></param>
|
/// <param name="assetManager"></param>
|
||||||
/// <param name="assetProvider"></param>
|
/// <param name="assetProvider"></param>
|
||||||
public GetAssetStreamHandler(IAssetProviderPlugin assetProvider)
|
public GetAssetStreamHandler(IAssetDataPlugin assetProvider)
|
||||||
: base("GET", "/assets")
|
: base("GET", "/assets")
|
||||||
{
|
{
|
||||||
m_log.Info("[REST]: In Get Request");
|
m_log.Info("[REST]: In Get Request");
|
||||||
|
@ -125,7 +125,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
// private OpenAsset_Main m_assetManager;
|
// private OpenAsset_Main m_assetManager;
|
||||||
private IAssetProviderPlugin m_assetProvider;
|
private IAssetDataPlugin m_assetProvider;
|
||||||
|
|
||||||
public override byte[] Handle(string path, Stream request,
|
public override byte[] Handle(string path, Stream request,
|
||||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
|
@ -146,7 +146,7 @@ namespace OpenSim.Grid.AssetServer
|
||||||
return new byte[] {};
|
return new byte[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
public PostAssetStreamHandler(IAssetProviderPlugin assetProvider)
|
public PostAssetStreamHandler(IAssetDataPlugin assetProvider)
|
||||||
: base("POST", "/assets")
|
: base("POST", "/assets")
|
||||||
{
|
{
|
||||||
// m_assetManager = assetManager;
|
// m_assetManager = assetManager;
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace OpenSim.Region.Environment.Modules.Hypergrid
|
||||||
|
|
||||||
protected void AddHttpHandlers(Scene m_scene)
|
protected void AddHttpHandlers(Scene m_scene)
|
||||||
{
|
{
|
||||||
IAssetProviderPlugin m_assetProvider = ((AssetServerBase)m_scene.AssetCache.AssetServer).AssetProviderPlugin;
|
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 GetAssetStreamHandler(m_assetProvider));
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
/// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit
|
/// mono addin plugin system starts co-operating with the unit test system. Currently no locking since unit
|
||||||
/// tests are single threaded.
|
/// tests are single threaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TestAssetDataPlugin : IAssetProviderPlugin
|
public class TestAssetDataPlugin : IAssetDataPlugin
|
||||||
{
|
{
|
||||||
public string Version { get { return "0"; } }
|
public string Version { get { return "0"; } }
|
||||||
public string Name { get { return "TestAssetDataPlugin"; } }
|
public string Name { get { return "TestAssetDataPlugin"; } }
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin"/>
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.ILogDataPlugin"/>
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
<ExtensionPoint path = "/OpenSim/AssetData">
|
<ExtensionPoint path = "/OpenSim/AssetData">
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IAssetProviderPlugin"/>
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin"/>
|
||||||
</ExtensionPoint>
|
</ExtensionPoint>
|
||||||
<ExtensionPoint path = "/OpenSim/InventoryData">
|
<ExtensionPoint path = "/OpenSim/InventoryData">
|
||||||
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IInventoryDataPlugin"/>
|
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Framework.IInventoryDataPlugin"/>
|
||||||
|
|
Loading…
Reference in New Issue