aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs')
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs23
1 files changed, 13 insertions, 10 deletions
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
30using System; 30using System;
31using System.Reflection;
31using System.Collections.Generic; 32using System.Collections.Generic;
32using System.Net; 33using System.Net;
33using System.IO; 34using System.IO;
@@ -35,6 +36,7 @@ using System.Text;
35using OpenMetaverse; 36using OpenMetaverse;
36using OpenMetaverse.StructuredData; 37using OpenMetaverse.StructuredData;
37using OpenSim.Framework; 38using OpenSim.Framework;
39using log4net;
38 40
39namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple 41namespace 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