diff options
author | Mike Mazur | 2009-02-16 02:27:43 +0000 |
---|---|---|
committer | Mike Mazur | 2009-02-16 02:27:43 +0000 |
commit | 5277fc64c07da92014e749be40aa837193a26495 (patch) | |
tree | 5351a96ac5d612560dc63d8c8585237d9dc80d27 /OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | |
parent | - remove dependency on ExtensionLoader.dll (DBConnString.cs can go) (diff) | |
download | opensim-SC_OLD-5277fc64c07da92014e749be40aa837193a26495.zip opensim-SC_OLD-5277fc64c07da92014e749be40aa837193a26495.tar.gz opensim-SC_OLD-5277fc64c07da92014e749be40aa837193a26495.tar.bz2 opensim-SC_OLD-5277fc64c07da92014e749be40aa837193a26495.tar.xz |
- change AssetInventoryServer config from XML to INI
- convert AssetInventoryServer logging to OpenSim's log4net
- updated AssetInventoryServer.ini.example file
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs index 5a718f2..d66fc69 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | |||
@@ -28,12 +28,14 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | using System; | 30 | using System; |
31 | using System.Reflection; | ||
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
32 | using System.Net; | 33 | using System.Net; |
33 | using System.IO; | 34 | using System.IO; |
34 | using OpenMetaverse; | 35 | using OpenMetaverse; |
35 | using OpenMetaverse.StructuredData; | 36 | using OpenMetaverse.StructuredData; |
36 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using log4net; | ||
37 | 39 | ||
38 | namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | 40 | namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple |
39 | { | 41 | { |
@@ -43,6 +45,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
43 | const string DEFAULT_DATA_DIR = "SimpleAssets"; | 45 | const string DEFAULT_DATA_DIR = "SimpleAssets"; |
44 | const string TEMP_DATA_DIR = "SimpleAssetsTemp"; | 46 | const string TEMP_DATA_DIR = "SimpleAssetsTemp"; |
45 | 47 | ||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | AssetInventoryServer server; | 49 | AssetInventoryServer server; |
47 | Dictionary<UUID, Metadata> metadataStorage; | 50 | Dictionary<UUID, Metadata> metadataStorage; |
48 | Dictionary<UUID, string> filenames; | 51 | Dictionary<UUID, string> filenames; |
@@ -82,7 +85,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
82 | } | 85 | } |
83 | catch (Exception ex) | 86 | catch (Exception ex) |
84 | { | 87 | { |
85 | Logger.Log.ErrorFormat("Failed reading data for asset {0} from {1}: {2}", assetID, filename, ex.Message); | 88 | m_log.ErrorFormat("Failed reading data for asset {0} from {1}: {2}", assetID, filename, ex.Message); |
86 | ret = BackendResponse.Failure; | 89 | ret = BackendResponse.Failure; |
87 | } | 90 | } |
88 | } | 91 | } |
@@ -112,7 +115,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
112 | } | 115 | } |
113 | catch (Exception ex) | 116 | catch (Exception ex) |
114 | { | 117 | { |
115 | Logger.Log.ErrorFormat("Failed reading data for asset {0} from {1}: {2}", assetID, filename, ex.Message); | 118 | m_log.ErrorFormat("Failed reading data for asset {0} from {1}: {2}", assetID, filename, ex.Message); |
116 | ret = BackendResponse.Failure; | 119 | ret = BackendResponse.Failure; |
117 | } | 120 | } |
118 | } | 121 | } |
@@ -169,7 +172,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
169 | } | 172 | } |
170 | catch (Exception ex) | 173 | catch (Exception ex) |
171 | { | 174 | { |
172 | Logger.Log.ErrorFormat("Failed writing data for asset {0} to {1}: {2}", metadata.ID, filename, ex.Message); | 175 | m_log.ErrorFormat("Failed writing data for asset {0} to {1}: {2}", metadata.ID, filename, ex.Message); |
173 | ret = BackendResponse.Failure; | 176 | ret = BackendResponse.Failure; |
174 | } | 177 | } |
175 | 178 | ||
@@ -207,7 +210,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
207 | LoadFiles(DEFAULT_DATA_DIR, false); | 210 | LoadFiles(DEFAULT_DATA_DIR, false); |
208 | LoadFiles(TEMP_DATA_DIR, true); | 211 | LoadFiles(TEMP_DATA_DIR, true); |
209 | 212 | ||
210 | Logger.Log.InfoFormat("Initialized the store index with metadata for {0} assets", | 213 | m_log.InfoFormat("Initialized the store index with metadata for {0} assets", |
211 | metadataStorage.Count); | 214 | metadataStorage.Count); |
212 | } | 215 | } |
213 | 216 | ||
@@ -216,7 +219,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
216 | /// </summary> | 219 | /// </summary> |
217 | public void Initialise() | 220 | public void Initialise() |
218 | { | 221 | { |
219 | Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); | 222 | m_log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); |
220 | throw new PluginNotInitialisedException(Name); | 223 | throw new PluginNotInitialisedException(Name); |
221 | } | 224 | } |
222 | 225 | ||
@@ -243,7 +246,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
243 | if (Directory.Exists(TEMP_DATA_DIR)) | 246 | if (Directory.Exists(TEMP_DATA_DIR)) |
244 | { | 247 | { |
245 | try { Directory.Delete(TEMP_DATA_DIR); } | 248 | try { Directory.Delete(TEMP_DATA_DIR); } |
246 | catch (Exception ex) { Logger.Log.Error(ex.Message); } | 249 | catch (Exception ex) { m_log.Error(ex.Message); } |
247 | } | 250 | } |
248 | } | 251 | } |
249 | 252 | ||
@@ -255,7 +258,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
255 | try { Directory.CreateDirectory(folder); } | 258 | try { Directory.CreateDirectory(folder); } |
256 | catch (Exception ex) | 259 | catch (Exception ex) |
257 | { | 260 | { |
258 | Logger.Log.Warn(ex.Message); | 261 | m_log.Warn(ex.Message); |
259 | return; | 262 | return; |
260 | } | 263 | } |
261 | } | 264 | } |
@@ -287,7 +290,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
287 | } | 290 | } |
288 | catch (Exception ex) | 291 | catch (Exception ex) |
289 | { | 292 | { |
290 | Logger.Log.Warn(ex.Message); | 293 | m_log.Warn(ex.Message); |
291 | } | 294 | } |
292 | } | 295 | } |
293 | } | 296 | } |