diff options
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer/Plugins/Simple')
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleAssetStoragePlugin.cs | 19 | ||||
-rw-r--r-- | OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs | 23 |
2 files changed, 24 insertions, 18 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 | } |
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs index 415874a..8be6f8c 100644 --- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs +++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs | |||
@@ -28,6 +28,7 @@ | |||
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; |
@@ -35,6 +36,7 @@ using System.Text; | |||
35 | using OpenMetaverse; | 36 | using OpenMetaverse; |
36 | using OpenMetaverse.StructuredData; | 37 | using OpenMetaverse.StructuredData; |
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using log4net; | ||
38 | 40 | ||
39 | namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | 41 | namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple |
40 | { | 42 | { |
@@ -43,6 +45,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
43 | const string EXTENSION_NAME = "SimpleInventoryStorage"; // Used for metrics reporting | 45 | const string EXTENSION_NAME = "SimpleInventoryStorage"; // Used for metrics reporting |
44 | const string DEFAULT_INVENTORY_DIR = "SimpleInventory"; | 46 | const string DEFAULT_INVENTORY_DIR = "SimpleInventory"; |
45 | 47 | ||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | AssetInventoryServer server; | 49 | AssetInventoryServer server; |
47 | Dictionary<Uri, InventoryCollection> inventories = new Dictionary<Uri, InventoryCollection>(); | 50 | Dictionary<Uri, InventoryCollection> inventories = new Dictionary<Uri, InventoryCollection>(); |
48 | Dictionary<Uri, List<InventoryItem>> activeGestures = new Dictionary<Uri, List<InventoryItem>>(); | 51 | Dictionary<Uri, List<InventoryItem>> activeGestures = new Dictionary<Uri, List<InventoryItem>>(); |
@@ -209,7 +212,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
209 | } | 212 | } |
210 | catch (Exception ex) | 213 | catch (Exception ex) |
211 | { | 214 | { |
212 | Logger.Log.Error(ex.Message); | 215 | m_log.Error(ex.Message); |
213 | ret = BackendResponse.Failure; | 216 | ret = BackendResponse.Failure; |
214 | } | 217 | } |
215 | } | 218 | } |
@@ -251,7 +254,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
251 | } | 254 | } |
252 | catch (Exception ex) | 255 | catch (Exception ex) |
253 | { | 256 | { |
254 | Logger.Log.Error(ex.Message); | 257 | m_log.Error(ex.Message); |
255 | ret = BackendResponse.Failure; | 258 | ret = BackendResponse.Failure; |
256 | } | 259 | } |
257 | } | 260 | } |
@@ -305,7 +308,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
305 | } | 308 | } |
306 | catch (Exception ex) | 309 | catch (Exception ex) |
307 | { | 310 | { |
308 | Logger.Log.Error(ex.Message); | 311 | m_log.Error(ex.Message); |
309 | ret = BackendResponse.Failure; | 312 | ret = BackendResponse.Failure; |
310 | } | 313 | } |
311 | } | 314 | } |
@@ -353,7 +356,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
353 | foreach (string match in matches) | 356 | foreach (string match in matches) |
354 | { | 357 | { |
355 | try { File.Delete(match); } | 358 | try { File.Delete(match); } |
356 | catch (Exception ex) { Logger.Log.ErrorFormat("Failed to delete file {0}: {1}", match, ex.Message); } | 359 | catch (Exception ex) { m_log.ErrorFormat("Failed to delete file {0}: {1}", match, ex.Message); } |
357 | } | 360 | } |
358 | 361 | ||
359 | ret = BackendResponse.Success; | 362 | ret = BackendResponse.Success; |
@@ -390,7 +393,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
390 | foreach (string match in matches) | 393 | foreach (string match in matches) |
391 | { | 394 | { |
392 | try { File.Delete(match); } | 395 | try { File.Delete(match); } |
393 | catch (Exception ex) { Logger.Log.ErrorFormat("Failed to delete folder file {0}: {1}", match, ex.Message); } | 396 | catch (Exception ex) { m_log.ErrorFormat("Failed to delete folder file {0}: {1}", match, ex.Message); } |
394 | } | 397 | } |
395 | 398 | ||
396 | ret = BackendResponse.Success; | 399 | ret = BackendResponse.Success; |
@@ -501,7 +504,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
501 | try { Directory.CreateDirectory(folder); } | 504 | try { Directory.CreateDirectory(folder); } |
502 | catch (Exception ex) | 505 | catch (Exception ex) |
503 | { | 506 | { |
504 | Logger.Log.Warn(ex.Message); | 507 | m_log.Warn(ex.Message); |
505 | return; | 508 | return; |
506 | } | 509 | } |
507 | } | 510 | } |
@@ -525,7 +528,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
525 | } | 528 | } |
526 | catch (Exception ex) | 529 | catch (Exception ex) |
527 | { | 530 | { |
528 | Logger.Log.WarnFormat("Failed loading the index file {0}: {1}", indexPath, ex.Message); | 531 | m_log.WarnFormat("Failed loading the index file {0}: {1}", indexPath, ex.Message); |
529 | } | 532 | } |
530 | 533 | ||
531 | if (ownerID != UUID.Zero && owner != null) | 534 | if (ownerID != UUID.Zero && owner != null) |
@@ -581,7 +584,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
581 | } | 584 | } |
582 | catch (Exception ex) | 585 | catch (Exception ex) |
583 | { | 586 | { |
584 | Logger.Log.ErrorFormat("Failed loading inventory from {0}: {1}", folder, ex.Message); | 587 | m_log.ErrorFormat("Failed loading inventory from {0}: {1}", folder, ex.Message); |
585 | } | 588 | } |
586 | } | 589 | } |
587 | 590 | ||
@@ -593,7 +596,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
593 | 596 | ||
594 | LoadFiles(DEFAULT_INVENTORY_DIR); | 597 | LoadFiles(DEFAULT_INVENTORY_DIR); |
595 | 598 | ||
596 | Logger.Log.InfoFormat("Initialized the inventory index with data for {0} avatars", | 599 | m_log.InfoFormat("Initialized the inventory index with data for {0} avatars", |
597 | inventories.Count); | 600 | inventories.Count); |
598 | } | 601 | } |
599 | 602 | ||
@@ -602,7 +605,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple | |||
602 | /// </summary> | 605 | /// </summary> |
603 | public void Initialise() | 606 | public void Initialise() |
604 | { | 607 | { |
605 | Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); | 608 | m_log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name); |
606 | throw new PluginNotInitialisedException(Name); | 609 | throw new PluginNotInitialisedException(Name); |
607 | } | 610 | } |
608 | 611 | ||