aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/InventoryServiceBase.cs
diff options
context:
space:
mode:
authordiva2009-06-10 13:18:32 +0000
committerdiva2009-06-10 13:18:32 +0000
commit0f367bd7bbc5d22d4834e1eb0f1671381485143e (patch)
treeeeb4290f1146601f8fd97dc164e0a7f247a2fafb /OpenSim/Services/InventoryService/InventoryServiceBase.cs
parentFrom: Alan Webb <alan_webb@us.ibm.com> (diff)
downloadopensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.zip
opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.gz
opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.bz2
opensim-SC_OLD-0f367bd7bbc5d22d4834e1eb0f1671381485143e.tar.xz
Heart surgery no.2: the inventory service hooks.
Several improvements in the connectors themselves. Several improvements in configurations. Needed to add a hack in IUserService and UserManagerBase, to be removed when that service is refactored.
Diffstat (limited to 'OpenSim/Services/InventoryService/InventoryServiceBase.cs')
-rw-r--r--OpenSim/Services/InventoryService/InventoryServiceBase.cs40
1 files changed, 29 insertions, 11 deletions
diff --git a/OpenSim/Services/InventoryService/InventoryServiceBase.cs b/OpenSim/Services/InventoryService/InventoryServiceBase.cs
index 179d541..4526c34 100644
--- a/OpenSim/Services/InventoryService/InventoryServiceBase.cs
+++ b/OpenSim/Services/InventoryService/InventoryServiceBase.cs
@@ -44,19 +44,37 @@ namespace OpenSim.Services.InventoryService
44 44
45 public InventoryServiceBase(IConfigSource config) : base(config) 45 public InventoryServiceBase(IConfigSource config) : base(config)
46 { 46 {
47 IConfig assetConfig = config.Configs["InventoryService"]; 47 string dllName = String.Empty;
48 if (assetConfig == null) 48 string connString = String.Empty;
49
50 //
51 // Try reading the [DatabaseService] section first, if it exists
52 //
53 IConfig dbConfig = config.Configs["DatabaseService"];
54 if (dbConfig != null)
55 {
56 dllName = dbConfig.GetString("StorageProvider", String.Empty);
57 connString = dbConfig.GetString("ConnectionString", String.Empty);
58 }
59 else
60 Console.WriteLine("------ dbConfig = null!");
61
62 //
63 // Try reading the more specific [InventoryService] section, if it exists
64 //
65 IConfig inventoryConfig = config.Configs["InventoryService"];
66 if (inventoryConfig != null)
67 {
68 dllName = inventoryConfig.GetString("StorageProvider", dllName);
69 connString = inventoryConfig.GetString("ConnectionString", connString);
70 }
71
72 //
73 // We tried, but this doesn't exist. We can't proceed.
74 //
75 if (dllName.Equals(String.Empty))
49 throw new Exception("No InventoryService configuration"); 76 throw new Exception("No InventoryService configuration");
50 77
51 string dllName = assetConfig.GetString("StorageProvider",
52 String.Empty);
53
54 if (dllName == String.Empty)
55 throw new Exception("No StorageProvider configured");
56
57 string connString = assetConfig.GetString("ConnectionString",
58 String.Empty);
59
60 m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); 78 m_Database = LoadPlugin<IInventoryDataPlugin>(dllName);
61 if (m_Database == null) 79 if (m_Database == null)
62 throw new Exception("Could not find a storage interface in the given module"); 80 throw new Exception("Could not find a storage interface in the given module");