- remove dependency on ExtensionLoader.dll (DBConnString.cs can go)

- bring config system in line with other servers
- add new plugin filter class which filters on ID
- update AssetInventoryServer.ini file
This commit is contained in:
Mike Mazur
2009-02-16 02:27:34 +00:00
parent f8ea274090
commit 529dd66ed0
9 changed files with 344 additions and 384 deletions

View File

@@ -0,0 +1,146 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSim Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
namespace OpenSim.Framework
{
/// <summary>
/// AssetInventoryConfig -- For AssetInventory Server Configuration
/// </summary>
public class AssetInventoryConfig
{
private ConfigurationMember configMember;
public const uint DefaultHttpPort = 8003;
public uint HttpPort = DefaultHttpPort;
public string AssetStorageProvider = "OpenSimAssetStorage";
public string AssetDatabaseConnect = String.Empty;
public string InventoryStorageProvider = "OpenSimInventoryStorage";
public string InventoryDatabaseConnect = String.Empty;
public string AuthenticationProvider = "NullAuthentication";
public string AuthorizationProvider = "AuthorizeAll";
public string MetricsProvider = "NullMetrics";
public string Frontends = "OpenSimAssetFrontend,OpenSimInventoryFrontend";
public AssetInventoryConfig(string description, string filename)
{
configMember = new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true);
configMember.performConfigurationRetrieve();
}
public void loadConfigurationOptions()
{
configMember.addConfigurationOption("listen_port",
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
"HTTP listener port",
DefaultHttpPort.ToString(),
false);
configMember.addConfigurationOption("asset_storage_provider",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Asset storage provider",
AssetStorageProvider,
false);
configMember.addConfigurationOption("asset_database_connect",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Asset database connection string",
AssetDatabaseConnect,
false);
configMember.addConfigurationOption("inventory_storage_provider",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Inventory storage provider",
InventoryStorageProvider,
false);
configMember.addConfigurationOption("inventory_database_connect",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Inventory database connection string",
InventoryDatabaseConnect,
false);
configMember.addConfigurationOption("authentication_provider",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Authentication provider",
AuthenticationProvider,
false);
configMember.addConfigurationOption("authorization_provider",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Authentication provider",
AuthorizationProvider,
false);
configMember.addConfigurationOption("metrics_provider",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Metrics provider",
MetricsProvider,
false);
configMember.addConfigurationOption("frontends",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Comma-separated list of frontends",
Frontends,
false);
}
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
{
switch (configuration_key)
{
case "listen_port":
HttpPort = (uint) configuration_result;
break;
case "asset_storage_provider":
AssetStorageProvider = (string) configuration_result;
break;
case "asset_database_connect":
AssetDatabaseConnect = (string) configuration_result;
break;
case "inventory_storage_provider":
InventoryStorageProvider = (string) configuration_result;
break;
case "inventory_database_connect":
InventoryDatabaseConnect = (string) configuration_result;
break;
case "authentication_provider":
AuthenticationProvider = (string) configuration_result;
break;
case "authorization_provider":
AuthorizationProvider = (string) configuration_result;
break;
case "metrics_provider":
MetricsProvider = (string) configuration_result;
break;
case "frontends":
Frontends = (string) configuration_result;
break;
}
return true;
}
}
}

View File

@@ -277,6 +277,9 @@ namespace OpenSim.Framework
public class PluginExtensionNode : ExtensionNode
{
[NodeAttribute]
string id = "";
[NodeAttribute]
string provider = "";
@@ -285,6 +288,7 @@ namespace OpenSim.Framework
Type typeobj;
public string ID { get { return id; } }
public string Provider { get { return provider; } }
public string TypeName { get { return type; } }
@@ -349,7 +353,7 @@ namespace OpenSim.Framework
}
/// <summary>
/// Filters out which plugin to load based on its the plugin name or names given. Plugin names are contained in
/// Filters out which plugin to load based on the plugin name or names given. Plugin names are contained in
/// their addin.xml
/// </summary>
public class PluginProviderFilter : IPluginFilter
@@ -390,4 +394,46 @@ namespace OpenSim.Framework
return false;
}
}
/// <summary>
/// Filters plugins according to their ID. Plugin IDs are contained in their addin.xml
/// </summary>
public class PluginIdFilter : IPluginFilter
{
private string[] m_filters;
/// <summary>
/// Constructor.
/// </summary>
/// <param name="p">
/// Plugin ID or IDs on which to filter. Multiple names should be separated by commas.
/// </param>
public PluginIdFilter(string p)
{
m_filters = p.Split(',');
for (int i = 0; i < m_filters.Length; i++)
{
m_filters[i] = m_filters[i].Trim();
}
}
/// <summary>
/// Apply this filter to <paramref name="plugin" />.
/// </summary>
/// <param name="plugin">PluginExtensionNode instance to check whether it passes the filter.</param>
/// <returns>true if the plugin's ID matches one of the filters, false otherwise.</returns>
public bool Apply (PluginExtensionNode plugin)
{
for (int i = 0; i < m_filters.Length; i++)
{
if (m_filters[i] == plugin.ID)
{
return true;
}
}
return false;
}
}
}

View File

@@ -32,11 +32,6 @@ using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.ServiceProcess;
using ExtensionLoader;
using ExtensionLoader.Config;
//using HttpServer;
using log4net;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
@@ -44,12 +39,11 @@ using OpenSim.Framework.Console;
namespace OpenSim.Grid.AssetInventoryServer
{
public class AssetInventoryServer : BaseOpenSimServer//ServiceBase
public class AssetInventoryServer : BaseOpenSimServer
{
public const string CONFIG_FILE = "AssetInventoryServer.ini";
//public WebServer HttpServer;
public IniConfigSource ConfigFile;
public AssetInventoryConfig ConfigFile;
public IAssetStorageProvider StorageProvider;
public IInventoryStorageProvider InventoryProvider;
@@ -57,72 +51,39 @@ namespace OpenSim.Grid.AssetInventoryServer
public IAuthorizationProvider AuthorizationProvider;
public IMetricsProvider MetricsProvider;
private List<IAssetInventoryServerPlugin> frontends = new List<IAssetInventoryServerPlugin>();
private List<IAssetInventoryServerPlugin> backends = new List<IAssetInventoryServerPlugin>();
private List<IAssetInventoryServerPlugin> m_frontends = new List<IAssetInventoryServerPlugin>();
private List<IAssetInventoryServerPlugin> m_backends = new List<IAssetInventoryServerPlugin>();
public AssetInventoryServer()
{
m_console = new ConsoleBase("Asset");
MainConsole.Instance = m_console;
//this.ServiceName = "OpenSimAssetInventoryServer";
}
public bool Start()
{
Logger.Log.Info("Starting Asset Server");
List<string> extensionList = null;
int port = 0;
X509Certificate2 serverCert = null;
uint port = 0;
try { ConfigFile = new IniConfigSource(CONFIG_FILE); }
try { ConfigFile = new AssetInventoryConfig("AssetInventory Server", (Path.Combine(Util.configDir(), "AssetInventoryServer.ini"))); }
catch (Exception)
{
Logger.Log.Error("Failed to load the config file " + CONFIG_FILE);
return false;
}
try
{
IConfig extensionConfig = ConfigFile.Configs["Config"];
StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", ConfigFile.AssetStorageProvider) as IAssetStorageProvider;
m_backends.Add(StorageProvider);
// Load the port number to listen on
port = extensionConfig.GetInt("ListenPort");
InventoryProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/InventoryProvider", ConfigFile.InventoryStorageProvider) as IInventoryStorageProvider;
m_backends.Add(InventoryProvider);
// Load the server certificate file
string certFile = extensionConfig.GetString("SSLCertFile");
if (!String.IsNullOrEmpty(certFile))
serverCert = new X509Certificate2(certFile);
}
catch (Exception)
{
Logger.Log.Error("Failed to load [Config] section from " + CONFIG_FILE);
return false;
}
MetricsProvider = LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/MetricsProvider", ConfigFile.MetricsProvider) as IMetricsProvider;
m_backends.Add(MetricsProvider);
try
{
// Load the extension list (and ordering) from our config file
IConfig extensionConfig = ConfigFile.Configs["Extensions"];
extensionList = new List<string>(extensionConfig.GetKeys());
}
catch (Exception)
{
Logger.Log.Error("Failed to load [Extensions] section from " + CONFIG_FILE);
return false;
}
StorageProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/StorageProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IAssetStorageProvider;
backends.Add(StorageProvider);
InventoryProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/InventoryProvider", "OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim.dll") as IInventoryStorageProvider;
backends.Add(InventoryProvider);
MetricsProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/MetricsProvider", String.Empty) as IMetricsProvider;
backends.Add(MetricsProvider);
try
{
InitHttpServer(port, serverCert);
InitHttpServer(ConfigFile.HttpPort);
}
catch (Exception ex)
{
@@ -131,13 +92,13 @@ namespace OpenSim.Grid.AssetInventoryServer
return false;
}
frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", String.Empty));
AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", ConfigFile.AuthenticationProvider) as IAuthenticationProvider;
m_backends.Add(AuthenticationProvider);
AuthenticationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthenticationProvider", String.Empty) as IAuthenticationProvider;
backends.Add(AuthenticationProvider);
AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", ConfigFile.AuthorizationProvider) as IAuthorizationProvider;
m_backends.Add(AuthorizationProvider);
AuthorizationProvider = LoadAssetInventoryServerPlugin("/OpenSim/AssetInventoryServer/AuthorizationProvider", String.Empty) as IAuthorizationProvider;
backends.Add(AuthorizationProvider);
m_frontends.AddRange(LoadAssetInventoryServerPlugins("/OpenSim/AssetInventoryServer/Frontend", ConfigFile.Frontends));
return true;
}
@@ -154,7 +115,7 @@ namespace OpenSim.Grid.AssetInventoryServer
public override void ShutdownSpecific()
{
foreach (IAssetInventoryServerPlugin plugin in frontends)
foreach (IAssetInventoryServerPlugin plugin in m_frontends)
{
Logger.Log.Debug("Disposing plugin " + plugin.Name);
try { plugin.Dispose(); }
@@ -162,7 +123,7 @@ namespace OpenSim.Grid.AssetInventoryServer
{ Logger.Log.ErrorFormat("Failure shutting down plugin {0}: {1}", plugin.Name, ex.Message); }
}
foreach (IAssetInventoryServerPlugin plugin in backends)
foreach (IAssetInventoryServerPlugin plugin in m_backends)
{
Logger.Log.Debug("Disposing plugin " + plugin.Name);
try { plugin.Dispose(); }
@@ -174,47 +135,14 @@ namespace OpenSim.Grid.AssetInventoryServer
HttpServer.Stop();
}
void InitHttpServer(int port, X509Certificate serverCert)
void InitHttpServer(uint port)
{
//if (serverCert != null)
// HttpServer = new WebServer(IPAddress.Any, port, serverCert, null, false);
//else
// HttpServer = new WebServer(IPAddress.Any, port);
//HttpServer.LogWriter = new log4netLogWriter(Logger.Log);
//HttpServer.Set404Handler(
// delegate(IHttpClientContext client, IHttpRequest request, IHttpResponse response)
// {
// Logger.Log.Warn("Requested page was not found: " + request.Uri.PathAndQuery);
// string notFoundString = "<html><head><title>Page Not Found</title></head><body>The requested page or method was not found</body></html>";
// byte[] buffer = System.Text.Encoding.UTF8.GetBytes(notFoundString);
// response.Body.Write(buffer, 0, buffer.Length);
// response.Status = HttpStatusCode.NotFound;
// return true;
// }
//);
m_httpServer = new BaseHttpServer(8003);
HttpServer.Start();
m_httpServer = new BaseHttpServer(port);
m_httpServer.Start();
Logger.Log.Info("Asset server is listening on port " + port);
}
#region ServiceBase Overrides
//protected override void OnStart(string[] args)
//{
// Start();
//}
//protected override void OnStop()
//{
// Shutdown();
//}
#endregion
private IAssetInventoryServerPlugin LoadAssetInventoryServerPlugin(string addinPath, string provider)
{
PluginLoader<IAssetInventoryServerPlugin> loader = new PluginLoader<IAssetInventoryServerPlugin>(new AssetInventoryServerPluginInitialiser(this));
@@ -222,7 +150,7 @@ namespace OpenSim.Grid.AssetInventoryServer
if (provider == String.Empty)
loader.Add(addinPath);
else
loader.Add(addinPath, new PluginProviderFilter(provider));
loader.Add(addinPath, new PluginIdFilter(provider));
//loader.Add(addinPath, new PluginCountConstraint(1));
loader.Load();
@@ -237,7 +165,7 @@ namespace OpenSim.Grid.AssetInventoryServer
if (provider == String.Empty)
loader.Add(addinPath);
else
loader.Add(addinPath, new PluginProviderFilter(provider));
loader.Add(addinPath, new PluginIdFilter(provider));
//loader.Add(addinPath, new PluginCountConstraint(1));
loader.Load();
@@ -245,37 +173,4 @@ namespace OpenSim.Grid.AssetInventoryServer
return loader.Plugins;
}
}
//public class log4netLogWriter : ILogWriter
//{
// ILog Log;
// public log4netLogWriter(ILog log)
// {
// Log = log;
// }
// public void Write(object source, LogPrio prio, string message)
// {
// switch (prio)
// {
// case LogPrio.Trace:
// case LogPrio.Debug:
// Log.DebugFormat("{0}: {1}", source, message);
// break;
// case LogPrio.Info:
// Log.InfoFormat("{0}: {1}", source, message);
// break;
// case LogPrio.Warning:
// Log.WarnFormat("{0}: {1}", source, message);
// break;
// case LogPrio.Error:
// Log.ErrorFormat("{0}: {1}", source, message);
// break;
// case LogPrio.Fatal:
// Log.FatalFormat("{0}: {1}", source, message);
// break;
// }
// }
//}
}

View File

@@ -1,78 +0,0 @@
/*
* Copyright (c) 2008 Intel Corporation
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* -- Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* -- Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* -- Neither the name of the Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR ITS
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Xml;
using ExtensionLoader.Config;
using MySql.Data.MySqlClient;
namespace OpenSim.Grid.AssetInventoryServer.Extensions
{
public static class DBConnString
{
private static string connectionString;
/// <summary>
/// Parses the MySQL connection string out of either the asset server
/// .ini or a OpenSim-style .xml file and caches the result for future
/// requests
/// </summary>
public static string GetConnectionString(IniConfigSource configFile)
{
if (connectionString == null)
{
// Try parsing from the ini file
try
{
// Load the extension list (and ordering) from our config file
IConfig extensionConfig = configFile.Configs["MySQL"];
connectionString = extensionConfig.GetString("database_connect", null);
}
catch (Exception) { }
if (connectionString != null)
{
// Force MySQL's broken connection pooling off
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(connectionString);
builder.Pooling = false;
if (String.IsNullOrEmpty(builder.Database))
Logger.Log.Error("No database selected in the connectionString: " + connectionString);
connectionString = builder.ToString();
}
else
{
Logger.Log.Error("Database connection string is missing, check that the database_connect line is " +
"correct and uncommented in AssetInventoryServer.ini");
}
}
return connectionString;
}
}
}

View File

@@ -35,7 +35,6 @@ using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Grid.AssetInventoryServer.Extensions;
using OpenSim.Data;
namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
@@ -58,7 +57,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
metadata = null;
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.AssetDatabaseConnect))
{
IDataReader reader;
@@ -104,7 +103,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
assetData = null;
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.AssetDatabaseConnect))
{
IDataReader reader;
@@ -156,7 +155,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.AssetDatabaseConnect))
{
try
{
@@ -205,7 +204,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{
int rowCount = 0;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.AssetDatabaseConnect))
{
MySqlDataReader reader;
@@ -255,7 +254,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
try
{
m_assetProvider = DataPluginFactory.LoadDataPlugin<IAssetDataPlugin>("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null));
m_assetProvider = DataPluginFactory.LoadDataPlugin<IAssetDataPlugin>("OpenSim.Data.MySQL.dll", server.ConfigFile.AssetDatabaseConnect);
if (m_assetProvider == null)
{
Logger.Log.Error("[ASSET]: Failed to load a database plugin, server halting.");

View File

@@ -35,7 +35,6 @@ using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Grid.AssetInventoryServer.Extensions;
using OpenSim.Data;
namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
@@ -58,7 +57,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
item = null;
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -120,7 +119,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
folder = null;
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -167,7 +166,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
contents = null;
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -267,7 +266,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -333,7 +332,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
// Fetch inventory items
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -405,7 +404,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
IDataReader reader;
@@ -470,7 +469,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
try
{
@@ -537,7 +536,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{
BackendResponse ret;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
try
{
@@ -593,7 +592,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
try
{
@@ -639,7 +638,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
try
{
@@ -685,7 +684,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
if (Utils.TryGetOpenSimUUID(owner, out ownerID))
{
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
try
{
@@ -739,7 +738,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
{
int rowCount = 0;
using (MySqlConnection dbConnection = new MySqlConnection(DBConnString.GetConnectionString(server.ConfigFile)))
using (MySqlConnection dbConnection = new MySqlConnection(server.ConfigFile.InventoryDatabaseConnect))
{
MySqlDataReader reader;
@@ -789,7 +788,7 @@ namespace OpenSim.Grid.AssetInventoryServer.Plugins.OpenSim
try
{
m_inventoryProvider = DataPluginFactory.LoadDataPlugin<IInventoryDataPlugin>("OpenSim.Data.MySQL.dll", server.ConfigFile.Configs["MySQL"].GetString("database_connect", null));
m_inventoryProvider = DataPluginFactory.LoadDataPlugin<IInventoryDataPlugin>("OpenSim.Data.MySQL.dll", server.ConfigFile.InventoryDatabaseConnect);
if (m_inventoryProvider == null)
{
Logger.Log.Error("[INVENTORY]: Failed to load a database plugin, server halting.");

View File

@@ -8,7 +8,7 @@
</Dependencies>
<Extension path="/OpenSim/AssetInventoryServer/MetricsProvider">
<Plugin id="AssetInventoryMetrics" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.NullMetricsPlugin" />
<Plugin id="NullMetrics" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.NullMetricsPlugin" />
</Extension>
<Extension path="/OpenSim/AssetInventoryServer/Frontend">
<Plugin id="BrowseFrontend" provider="OpenSim.Grid.AssetInventoryServer.Plugins.dll" type="OpenSim.Grid.AssetInventoryServer.Plugins.BrowseFrontendPlugin" />