Slowly working my way towards the elimination of IAssetServer and IAssetCache.

arthursv
Diva Canto 2009-08-10 07:13:13 -07:00
parent a50904a68b
commit 024755d8b7
2 changed files with 6 additions and 122 deletions

View File

@ -35,14 +35,13 @@ namespace OpenSim.Framework
/// <summary> /// <summary>
/// Interface to the local asset cache. This is the mechanism through which assets can be added and requested. /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested.
/// </summary> /// </summary>
public interface IAssetCache : IAssetReceiver, IPlugin public interface IAssetCache : IPlugin
{ {
/// <value> /// <value>
/// The 'server' from which assets can be requested and to which assets are persisted. /// The 'server' from which assets can be requested and to which assets are persisted.
/// </value> /// </value>
IAssetServer AssetServer { get; }
void Initialise(ConfigSettings cs, IAssetServer server); void Initialise(ConfigSettings cs);
/// <summary> /// <summary>
/// Report statistical data to the log. /// Report statistical data to the log.
@ -112,21 +111,4 @@ namespace OpenSim.Framework
void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest); void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest);
} }
public class AssetCachePluginInitialiser : PluginInitialiserBase
{
private ConfigSettings config;
private IAssetServer server;
public AssetCachePluginInitialiser (ConfigSettings p_sv, IAssetServer p_as)
{
config = p_sv;
server = p_as;
}
public override void Initialise (IPlugin plugin)
{
IAssetCache p = plugin as IAssetCache;
p.Initialise (config, server);
}
}
} }

View File

@ -29,108 +29,10 @@ using OpenMetaverse;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
/// <summary> ///// <summary>
/// Description of IAssetServer. ///// Description of IAssetServer.
/// </summary> ///// </summary>
public interface IAssetServer : IPlugin public interface IAssetServer : IPlugin
{ {
void Initialise(ConfigSettings settings);
void Initialise(ConfigSettings settings, string url, string dir, bool test);
void Initialise(ConfigSettings settings, string url);
/// <summary>
/// Start the asset server
/// </summary>
void Start();
/// <summary>
/// Stop the asset server
/// </summary>
void Stop();
void SetReceiver(IAssetReceiver receiver);
void RequestAsset(UUID assetID, bool isTexture);
void StoreAsset(AssetBase asset);
void UpdateAsset(AssetBase asset);
} }
/// <summary>
/// Implemented by classes which with to asynchronously receive asset data from the asset service
/// </summary>
/// <remarks>could change to delegate?</remarks>
public interface IAssetReceiver
{
/// <summary>
/// Call back made when a requested asset has been retrieved by an asset server
/// </summary>
/// <param name="asset"></param>
/// <param name="IsTexture"></param>
void AssetReceived(AssetBase asset, bool IsTexture);
/// <summary>
/// Call back made when an asset server could not retrieve a requested asset
/// </summary>
/// <param name="assetID"></param>
/// <param name="IsTexture"></param>
void AssetNotFound(UUID assetID, bool IsTexture);
}
public class AssetClientPluginInitialiser : PluginInitialiserBase
{
private ConfigSettings config;
public AssetClientPluginInitialiser (ConfigSettings p_sv)
{
config = p_sv;
}
public override void Initialise (IPlugin plugin)
{
IAssetServer p = plugin as IAssetServer;
p.Initialise (config);
}
}
public class LegacyAssetClientPluginInitialiser : PluginInitialiserBase
{
private ConfigSettings config;
private string assetURL;
public LegacyAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url)
{
config = p_sv;
assetURL = p_url;
}
public override void Initialise (IPlugin plugin)
{
IAssetServer p = plugin as IAssetServer;
p.Initialise (config, assetURL);
}
}
public class CryptoAssetClientPluginInitialiser : PluginInitialiserBase
{
private ConfigSettings config;
private string assetURL;
private string currdir;
private bool test;
public CryptoAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url, string p_dir, bool p_test)
{
config = p_sv;
assetURL = p_url;
currdir = p_dir;
test = p_test;
}
public override void Initialise (IPlugin plugin)
{
IAssetServer p = plugin as IAssetServer;
p.Initialise (config, assetURL, currdir, test);
}
}
public interface IAssetPlugin
{
IAssetServer GetAssetServer();
}
} }