29 using System.Reflection;
32 using OpenSim.Framework;
34 using OpenSim.Services.Interfaces;
35 using OpenSim.Services.Base;
37 namespace OpenSim.Services.Friends
45 string dllName = String.Empty;
46 string connString = String.Empty;
51 IConfig friendsConfig = config.Configs[
"FriendsService"];
52 if (friendsConfig != null)
54 dllName = friendsConfig.GetString(
"StorageProvider", dllName);
55 connString = friendsConfig.GetString(
"ConnectionString", connString);
61 IConfig dbConfig = config.Configs[
"DatabaseService"];
64 if (dllName == String.Empty)
65 dllName = dbConfig.GetString(
"StorageProvider", String.Empty);
66 if (connString == String.Empty)
67 connString = dbConfig.GetString(
"ConnectionString", String.Empty);
73 if (String.Empty.Equals(dllName))
74 throw new Exception(
"No StorageProvider configured");
76 string realm =
"Friends";
77 if (friendsConfig != null)
78 realm = friendsConfig.GetString(
"Realm", realm);
80 m_Database = LoadPlugin<IFriendsData>(dllName,
new Object[] { connString, realm });
81 if (m_Database == null)
85 "Could not find a storage interface {0} in the given StorageProvider {1}",
"IFriendsData", dllName));
An interface for connecting to the friends datastore
FriendsServiceBase(IConfigSource config)