aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/AssetInventoryServer/Plugins/Simple
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/Simple/Resources/AssetInventoryServerSimplePlugins.addin.xml3
-rw-r--r--OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs (renamed from OpenSim/Grid/AssetInventoryServer/Extensions/SimpleInventory.cs)61
2 files changed, 46 insertions, 18 deletions
diff --git a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/Resources/AssetInventoryServerSimplePlugins.addin.xml b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/Resources/AssetInventoryServerSimplePlugins.addin.xml
index 53534c4..f898145 100644
--- a/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/Resources/AssetInventoryServerSimplePlugins.addin.xml
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/Resources/AssetInventoryServerSimplePlugins.addin.xml
@@ -10,4 +10,7 @@
10 <Extension path="/OpenSim/AssetInventoryServer/StorageProvider"> 10 <Extension path="/OpenSim/AssetInventoryServer/StorageProvider">
11 <Plugin id="SimpleAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.SimpleAssetStoragePlugin" /> 11 <Plugin id="SimpleAssetStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.SimpleAssetStoragePlugin" />
12 </Extension> 12 </Extension>
13 <Extension path="/OpenSim/AssetInventoryServer/InventoryProvider">
14 <Plugin id="SimpleInventoryStorage" provider="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.Simple.SimpleInventoryStoragePlugin" />
15 </Extension>
13</Addin> 16</Addin>
diff --git a/OpenSim/Grid/AssetInventoryServer/Extensions/SimpleInventory.cs b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs
index c140965..78dae35 100644
--- a/OpenSim/Grid/AssetInventoryServer/Extensions/SimpleInventory.cs
+++ b/OpenSim/Grid/AssetInventoryServer/Plugins/Simple/SimpleInventoryStoragePlugin.cs
@@ -35,12 +35,13 @@ using System.Text;
35using ExtensionLoader; 35using ExtensionLoader;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenMetaverse.StructuredData; 37using OpenMetaverse.StructuredData;
38using OpenSim.Framework;
38 39
39namespace OpenSim.Grid.AssetInventoryServer.Extensions 40namespace OpenSim.Grid.AssetInventoryServer.Plugins.Simple
40{ 41{
41 public class SimpleInventory : IExtension<AssetInventoryServer>, IInventoryProvider 42 public class SimpleInventoryStoragePlugin : IInventoryStorageProvider
42 { 43 {
43 const string EXTENSION_NAME = "SimpleInventory"; // Used for metrics reporting 44 const string EXTENSION_NAME = "SimpleInventoryStorage"; // Used for metrics reporting
44 const string DEFAULT_INVENTORY_DIR = "SimpleInventory"; 45 const string DEFAULT_INVENTORY_DIR = "SimpleInventory";
45 46
46 AssetInventoryServer server; 47 AssetInventoryServer server;
@@ -49,26 +50,12 @@ namespace OpenSim.Grid.AssetInventoryServer.Extensions
49 Utils.InventoryItemSerializer itemSerializer = new Utils.InventoryItemSerializer(); 50 Utils.InventoryItemSerializer itemSerializer = new Utils.InventoryItemSerializer();
50 Utils.InventoryFolderSerializer folderSerializer = new Utils.InventoryFolderSerializer(); 51 Utils.InventoryFolderSerializer folderSerializer = new Utils.InventoryFolderSerializer();
51 52
52 public SimpleInventory() 53 public SimpleInventoryStoragePlugin()
53 { 54 {
54 } 55 }
55 56
56 #region Required Interfaces 57 #region Required Interfaces
57 58
58 public void Start(AssetInventoryServer server)
59 {
60 this.server = server;
61
62 LoadFiles(DEFAULT_INVENTORY_DIR);
63
64 Logger.Log.InfoFormat("Initialized the inventory index with data for {0} avatars",
65 inventories.Count);
66 }
67
68 public void Stop()
69 {
70 }
71
72 public BackendResponse TryFetchItem(Uri owner, UUID itemID, out InventoryItem item) 59 public BackendResponse TryFetchItem(Uri owner, UUID itemID, out InventoryItem item)
73 { 60 {
74 item = null; 61 item = null;
@@ -598,5 +585,43 @@ namespace OpenSim.Grid.AssetInventoryServer.Extensions
598 Logger.Log.ErrorFormat("Failed loading inventory from {0}: {1}", folder, ex.Message); 585 Logger.Log.ErrorFormat("Failed loading inventory from {0}: {1}", folder, ex.Message);
599 } 586 }
600 } 587 }
588
589 #region IPlugin implementation
590
591 public void Initialise(AssetInventoryServer server)
592 {
593 this.server = server;
594
595 LoadFiles(DEFAULT_INVENTORY_DIR);
596
597 Logger.Log.InfoFormat("Initialized the inventory index with data for {0} avatars",
598 inventories.Count);
599 }
600
601 /// <summary>
602 /// <para>Initialises asset interface</para>
603 /// </summary>
604 public void Initialise()
605 {
606 Logger.Log.InfoFormat("[ASSET]: {0} cannot be default-initialized!", Name);
607 throw new PluginNotInitialisedException(Name);
608 }
609
610 public void Dispose()
611 {
612 }
613
614 public string Version
615 {
616 // TODO: this should be something meaningful and not hardcoded?
617 get { return "0.1"; }
618 }
619
620 public string Name
621 {
622 get { return "AssetInventoryServer Simple inventory storage provider"; }
623 }
624
625 #endregion IPlugin implementation
601 } 626 }
602} 627}