29 using System.Reflection;
31 using OpenSim.Framework;
33 using OpenSim.Services.Interfaces;
34 using OpenSim.Services.Base;
36 namespace OpenSim.Groups
46 string dllName = String.Empty;
47 string connString = String.Empty;
48 string realm =
"os_groups";
49 string usersRealm =
"GridUser";
50 string configName = (cName == string.Empty) ?
"Groups" : cName;
55 IConfig dbConfig = config.Configs[
"DatabaseService"];
58 if (dllName == String.Empty)
59 dllName = dbConfig.GetString(
"StorageProvider", String.Empty);
60 if (connString == String.Empty)
61 connString = dbConfig.GetString(
"ConnectionString", String.Empty);
67 IConfig groupsConfig = config.Configs[configName];
68 if (groupsConfig != null)
70 dllName = groupsConfig.GetString(
"StorageProvider", dllName);
71 connString = groupsConfig.GetString(
"ConnectionString", connString);
72 realm = groupsConfig.GetString(
"Realm", realm);
78 if (dllName.Equals(String.Empty))
79 throw new Exception(
"No StorageProvider configured");
81 m_Database = LoadPlugin<IGroupsData>(dllName,
new Object[] { connString, realm });
82 if (m_Database == null)
83 throw new Exception(
"Could not find a storage interface in the given module " + dllName);
88 IConfig usersConfig = config.Configs[
"GridUserService"];
89 if (usersConfig != null)
91 dllName = usersConfig.GetString(
"StorageProvider", dllName);
92 connString = usersConfig.GetString(
"ConnectionString", connString);
93 usersRealm = usersConfig.GetString(
"Realm", usersRealm);
96 m_GridUserService = LoadPlugin<IGridUserData>(dllName,
new Object[] { connString, usersRealm });
97 if (m_GridUserService == null)
98 throw new Exception(
"Could not find a storage inferface for the given users module " + dllName);
An interface for connecting to the user grid datastore
GroupsServiceBase(IConfigSource config, string cName)