diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/IAssetCache.cs | 24 | ||||
-rw-r--r-- | OpenSim/Framework/IAssetServer.cs | 104 |
2 files changed, 6 insertions, 122 deletions
diff --git a/OpenSim/Framework/IAssetCache.cs b/OpenSim/Framework/IAssetCache.cs index 201504b..751fdd5 100644 --- a/OpenSim/Framework/IAssetCache.cs +++ b/OpenSim/Framework/IAssetCache.cs | |||
@@ -35,14 +35,13 @@ namespace OpenSim.Framework | |||
35 | /// <summary> | 35 | /// <summary> |
36 | /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested. | 36 | /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested. |
37 | /// </summary> | 37 | /// </summary> |
38 | public interface IAssetCache : IAssetReceiver, IPlugin | 38 | public interface IAssetCache : IPlugin |
39 | { | 39 | { |
40 | /// <value> | 40 | /// <value> |
41 | /// The 'server' from which assets can be requested and to which assets are persisted. | 41 | /// The 'server' from which assets can be requested and to which assets are persisted. |
42 | /// </value> | 42 | /// </value> |
43 | IAssetServer AssetServer { get; } | 43 | |
44 | 44 | void Initialise(ConfigSettings cs); | |
45 | void Initialise(ConfigSettings cs, IAssetServer server); | ||
46 | 45 | ||
47 | /// <summary> | 46 | /// <summary> |
48 | /// Report statistical data to the log. | 47 | /// Report statistical data to the log. |
@@ -112,21 +111,4 @@ namespace OpenSim.Framework | |||
112 | void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest); | 111 | void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest); |
113 | } | 112 | } |
114 | 113 | ||
115 | public class AssetCachePluginInitialiser : PluginInitialiserBase | ||
116 | { | ||
117 | private ConfigSettings config; | ||
118 | private IAssetServer server; | ||
119 | |||
120 | public AssetCachePluginInitialiser (ConfigSettings p_sv, IAssetServer p_as) | ||
121 | { | ||
122 | config = p_sv; | ||
123 | server = p_as; | ||
124 | } | ||
125 | public override void Initialise (IPlugin plugin) | ||
126 | { | ||
127 | IAssetCache p = plugin as IAssetCache; | ||
128 | p.Initialise (config, server); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | } | 114 | } |
diff --git a/OpenSim/Framework/IAssetServer.cs b/OpenSim/Framework/IAssetServer.cs index 756ef8b..dbdf544 100644 --- a/OpenSim/Framework/IAssetServer.cs +++ b/OpenSim/Framework/IAssetServer.cs | |||
@@ -29,108 +29,10 @@ using OpenMetaverse; | |||
29 | 29 | ||
30 | namespace OpenSim.Framework | 30 | namespace OpenSim.Framework |
31 | { | 31 | { |
32 | /// <summary> | 32 | ///// <summary> |
33 | /// Description of IAssetServer. | 33 | ///// Description of IAssetServer. |
34 | /// </summary> | 34 | ///// </summary> |
35 | public interface IAssetServer : IPlugin | 35 | public interface IAssetServer : IPlugin |
36 | { | 36 | { |
37 | void Initialise(ConfigSettings settings); | ||
38 | void Initialise(ConfigSettings settings, string url, string dir, bool test); | ||
39 | void Initialise(ConfigSettings settings, string url); | ||
40 | |||
41 | /// <summary> | ||
42 | /// Start the asset server | ||
43 | /// </summary> | ||
44 | void Start(); | ||
45 | |||
46 | /// <summary> | ||
47 | /// Stop the asset server | ||
48 | /// </summary> | ||
49 | void Stop(); | ||
50 | |||
51 | void SetReceiver(IAssetReceiver receiver); | ||
52 | void RequestAsset(UUID assetID, bool isTexture); | ||
53 | void StoreAsset(AssetBase asset); | ||
54 | void UpdateAsset(AssetBase asset); | ||
55 | } | 37 | } |
56 | |||
57 | /// <summary> | ||
58 | /// Implemented by classes which with to asynchronously receive asset data from the asset service | ||
59 | /// </summary> | ||
60 | /// <remarks>could change to delegate?</remarks> | ||
61 | public interface IAssetReceiver | ||
62 | { | ||
63 | /// <summary> | ||
64 | /// Call back made when a requested asset has been retrieved by an asset server | ||
65 | /// </summary> | ||
66 | /// <param name="asset"></param> | ||
67 | /// <param name="IsTexture"></param> | ||
68 | void AssetReceived(AssetBase asset, bool IsTexture); | ||
69 | |||
70 | /// <summary> | ||
71 | /// Call back made when an asset server could not retrieve a requested asset | ||
72 | /// </summary> | ||
73 | /// <param name="assetID"></param> | ||
74 | /// <param name="IsTexture"></param> | ||
75 | void AssetNotFound(UUID assetID, bool IsTexture); | ||
76 | } | ||
77 | |||
78 | public class AssetClientPluginInitialiser : PluginInitialiserBase | ||
79 | { | ||
80 | private ConfigSettings config; | ||
81 | |||
82 | public AssetClientPluginInitialiser (ConfigSettings p_sv) | ||
83 | { | ||
84 | config = p_sv; | ||
85 | } | ||
86 | public override void Initialise (IPlugin plugin) | ||
87 | { | ||
88 | IAssetServer p = plugin as IAssetServer; | ||
89 | p.Initialise (config); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | public class LegacyAssetClientPluginInitialiser : PluginInitialiserBase | ||
94 | { | ||
95 | private ConfigSettings config; | ||
96 | private string assetURL; | ||
97 | |||
98 | public LegacyAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url) | ||
99 | { | ||
100 | config = p_sv; | ||
101 | assetURL = p_url; | ||
102 | } | ||
103 | public override void Initialise (IPlugin plugin) | ||
104 | { | ||
105 | IAssetServer p = plugin as IAssetServer; | ||
106 | p.Initialise (config, assetURL); | ||
107 | } | ||
108 | } | ||
109 | |||
110 | public class CryptoAssetClientPluginInitialiser : PluginInitialiserBase | ||
111 | { | ||
112 | private ConfigSettings config; | ||
113 | private string assetURL; | ||
114 | private string currdir; | ||
115 | private bool test; | ||
116 | |||
117 | public CryptoAssetClientPluginInitialiser (ConfigSettings p_sv, string p_url, string p_dir, bool p_test) | ||
118 | { | ||
119 | config = p_sv; | ||
120 | assetURL = p_url; | ||
121 | currdir = p_dir; | ||
122 | test = p_test; | ||
123 | } | ||
124 | public override void Initialise (IPlugin plugin) | ||
125 | { | ||
126 | IAssetServer p = plugin as IAssetServer; | ||
127 | p.Initialise (config, assetURL, currdir, test); | ||
128 | } | ||
129 | } | ||
130 | |||
131 | public interface IAssetPlugin | ||
132 | { | ||
133 | IAssetServer GetAssetServer(); | ||
134 | } | ||
135 | |||
136 | } | 38 | } |