aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Addons/Groups/Service/GroupsServiceBase.cs')
-rw-r--r--OpenSim/Addons/Groups/Service/GroupsServiceBase.cs110
1 files changed, 55 insertions, 55 deletions
diff --git a/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs b/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs
index 8e237aa..98d0172 100644
--- a/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs
+++ b/OpenSim/Addons/Groups/Service/GroupsServiceBase.cs
@@ -35,67 +35,67 @@ using OpenSim.Services.Base;
35 35
36namespace OpenSim.Groups 36namespace OpenSim.Groups
37{ 37{
38 public class GroupsServiceBase : ServiceBase 38 public class GroupsServiceBase : ServiceBase
39 { 39 {
40 protected IGroupsData m_Database = null; 40 protected IGroupsData m_Database = null;
41 protected IGridUserData m_GridUserService = null; 41 protected IGridUserData m_GridUserService = null;
42 42
43 public GroupsServiceBase(IConfigSource config, string cName) 43 public GroupsServiceBase(IConfigSource config, string cName)
44 : base(config) 44 : base(config)
45 { 45 {
46 string dllName = String.Empty; 46 string dllName = String.Empty;
47 string connString = String.Empty; 47 string connString = String.Empty;
48 string realm = "os_groups"; 48 string realm = "os_groups";
49 string usersRealm = "GridUser"; 49 string usersRealm = "GridUser";
50 string configName = (cName == string.Empty) ? "Groups" : cName; 50 string configName = (cName == string.Empty) ? "Groups" : cName;
51 51
52 // 52 //
53 // Try reading the [DatabaseService] section, if it exists 53 // Try reading the [DatabaseService] section, if it exists
54 // 54 //
55 IConfig dbConfig = config.Configs["DatabaseService"]; 55 IConfig dbConfig = config.Configs["DatabaseService"];
56 if (dbConfig != null) 56 if (dbConfig != null)
57 { 57 {
58 if (dllName == String.Empty) 58 if (dllName == String.Empty)
59 dllName = dbConfig.GetString("StorageProvider", String.Empty); 59 dllName = dbConfig.GetString("StorageProvider", String.Empty);
60 if (connString == String.Empty) 60 if (connString == String.Empty)
61 connString = dbConfig.GetString("ConnectionString", String.Empty); 61 connString = dbConfig.GetString("ConnectionString", String.Empty);
62 } 62 }
63 63
64 // 64 //
65 // [Groups] section overrides [DatabaseService], if it exists 65 // [Groups] section overrides [DatabaseService], if it exists
66 // 66 //
67 IConfig groupsConfig = config.Configs[configName]; 67 IConfig groupsConfig = config.Configs[configName];
68 if (groupsConfig != null) 68 if (groupsConfig != null)
69 { 69 {
70 dllName = groupsConfig.GetString("StorageProvider", dllName); 70 dllName = groupsConfig.GetString("StorageProvider", dllName);
71 connString = groupsConfig.GetString("ConnectionString", connString); 71 connString = groupsConfig.GetString("ConnectionString", connString);
72 realm = groupsConfig.GetString("Realm", realm); 72 realm = groupsConfig.GetString("Realm", realm);
73 } 73 }
74 74
75 // 75 //
76 // We tried, but this doesn't exist. We can't proceed. 76 // We tried, but this doesn't exist. We can't proceed.
77 // 77 //
78 if (dllName.Equals(String.Empty)) 78 if (dllName.Equals(String.Empty))
79 throw new Exception("No StorageProvider configured"); 79 throw new Exception("No StorageProvider configured");
80 80
81 m_Database = LoadPlugin<IGroupsData>(dllName, new Object[] { connString, realm }); 81 m_Database = LoadPlugin<IGroupsData>(dllName, new Object[] { connString, realm });
82 if (m_Database == null) 82 if (m_Database == null)
83 throw new Exception("Could not find a storage interface in the given module " + dllName); 83 throw new Exception("Could not find a storage interface in the given module " + dllName);
84 84
85 // 85 //
86 // [GridUserService] section overrides [DatabaseService], if it exists 86 // [GridUserService] section overrides [DatabaseService], if it exists
87 // 87 //
88 IConfig usersConfig = config.Configs["GridUserService"]; 88 IConfig usersConfig = config.Configs["GridUserService"];
89 if (usersConfig != null) 89 if (usersConfig != null)
90 { 90 {
91 dllName = usersConfig.GetString("StorageProvider", dllName); 91 dllName = usersConfig.GetString("StorageProvider", dllName);
92 connString = usersConfig.GetString("ConnectionString", connString); 92 connString = usersConfig.GetString("ConnectionString", connString);
93 usersRealm = usersConfig.GetString("Realm", usersRealm); 93 usersRealm = usersConfig.GetString("Realm", usersRealm);
94 } 94 }
95 95
96 m_GridUserService = LoadPlugin<IGridUserData>(dllName, new Object[] { connString, usersRealm }); 96 m_GridUserService = LoadPlugin<IGridUserData>(dllName, new Object[] { connString, usersRealm });
97 if (m_GridUserService == null) 97 if (m_GridUserService == null)
98 throw new Exception("Could not find a storage inferface for the given users module " + dllName); 98 throw new Exception("Could not find a storage inferface for the given users module " + dllName);
99 } 99 }
100 } 100 }
101} 101}