Another bit of refactoring to try to make sense of OpenSim.Framework.Communications. Everything that looks like a service, with service handlers, moved to .Services -- i.e. LoginService and Response, and GridInfoService. The rest of the changes were to adapt to the new locations of those files.
parent
08732b65be
commit
f7eac63e01
|
@ -30,6 +30,7 @@ using System.Reflection;
|
||||||
using log4net;
|
using log4net;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Region.Communications.Hypergrid;
|
using OpenSim.Region.Communications.Hypergrid;
|
||||||
|
@ -210,7 +211,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager
|
||||||
{
|
{
|
||||||
// Standalone mode
|
// Standalone mode
|
||||||
|
|
||||||
HGInventoryService inventoryService = new HGInventoryService(m_openSim.NetServersInfo.InventoryURL, null, false);
|
HGInventoryServiceClient inventoryService = new HGInventoryServiceClient(m_openSim.NetServersInfo.InventoryURL, null, false);
|
||||||
inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource);
|
inventoryService.AddPlugin(m_openSim.ConfigurationSettings.StandaloneInventoryPlugin, m_openSim.ConfigurationSettings.StandaloneInventorySource);
|
||||||
|
|
||||||
LocalUserServices userService =
|
LocalUserServices userService =
|
||||||
|
|
|
@ -36,6 +36,7 @@ using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Communications.Capabilities;
|
using OpenSim.Framework.Communications.Capabilities;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
|
|
@ -35,7 +35,7 @@ using Nini.Config;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications.Services
|
||||||
{
|
{
|
||||||
public class GridInfoService
|
public class GridInfoService
|
||||||
{
|
{
|
|
@ -52,19 +52,41 @@ namespace OpenSim.Framework.Communications.Services
|
||||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private InventoryServiceBase m_inventoryService;
|
private InventoryServiceBase m_inventoryService;
|
||||||
private UserManagerBase m_userService;
|
|
||||||
IAssetDataPlugin m_assetProvider;
|
|
||||||
IHttpServer httpServer;
|
IHttpServer httpServer;
|
||||||
private string m_thisInventoryUrl = "http://localhost:9000";
|
private string m_thisInventoryUrl = "http://localhost:9000";
|
||||||
private string m_thisHostname = "127.0.0.1";
|
private string m_thisHostname = "127.0.0.1";
|
||||||
private uint m_thisPort = 9000;
|
private uint m_thisPort = 9000;
|
||||||
|
|
||||||
|
// These two used for local access, standalone mode
|
||||||
|
private UserManagerBase m_userService = null;
|
||||||
|
IAssetDataPlugin m_assetProvider = null;
|
||||||
|
|
||||||
public HGInventoryService(InventoryServiceBase invService, IAssetDataPlugin assetService, UserManagerBase userService, IHttpServer httpserver, string url)
|
// These two used for remote access
|
||||||
|
string m_UserServerURL = string.Empty;
|
||||||
|
string m_AssetServerURL = string.Empty;
|
||||||
|
|
||||||
|
// Constructor for grid inventory server
|
||||||
|
public HGInventoryService(InventoryServiceBase invService, string assetServiceURL, string userServiceURL, IHttpServer httpserver, string thisurl)
|
||||||
|
{
|
||||||
|
m_UserServerURL = userServiceURL;
|
||||||
|
m_AssetServerURL = assetServiceURL;
|
||||||
|
|
||||||
|
Init(invService, thisurl, httpserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Constructor for standalone mode
|
||||||
|
public HGInventoryService(InventoryServiceBase invService, IAssetDataPlugin assetService, UserManagerBase userService, IHttpServer httpserver, string thisurl)
|
||||||
|
{
|
||||||
|
m_userService = userService;
|
||||||
|
m_assetProvider = assetService;
|
||||||
|
|
||||||
|
Init(invService, thisurl, httpserver);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Init(InventoryServiceBase invService, string thisurl, IHttpServer httpserver)
|
||||||
{
|
{
|
||||||
m_inventoryService = invService;
|
m_inventoryService = invService;
|
||||||
m_userService = userService;
|
m_thisInventoryUrl = thisurl;
|
||||||
m_thisInventoryUrl = url;
|
|
||||||
if (!m_thisInventoryUrl.EndsWith("/"))
|
if (!m_thisInventoryUrl.EndsWith("/"))
|
||||||
m_thisInventoryUrl += "/";
|
m_thisInventoryUrl += "/";
|
||||||
|
|
||||||
|
@ -75,7 +97,6 @@ namespace OpenSim.Framework.Communications.Services
|
||||||
m_thisPort = (uint)uri.Port;
|
m_thisPort = (uint)uri.Port;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_assetProvider = assetService;
|
|
||||||
httpServer = httpserver;
|
httpServer = httpserver;
|
||||||
|
|
||||||
AddHttpHandlers();
|
AddHttpHandlers();
|
||||||
|
|
|
@ -34,7 +34,7 @@ using Nwc.XmlRpc;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenMetaverse.StructuredData;
|
using OpenMetaverse.StructuredData;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications.Services
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A temp class to handle login response.
|
/// A temp class to handle login response.
|
|
@ -40,7 +40,7 @@ using OpenMetaverse.StructuredData;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Statistics;
|
using OpenSim.Framework.Statistics;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
namespace OpenSim.Framework.Communications.Services
|
||||||
{
|
{
|
||||||
public abstract class LoginService
|
public abstract class LoginService
|
||||||
{
|
{
|
|
@ -34,6 +34,7 @@ using NUnit.Framework;
|
||||||
using NUnit.Framework.SyntaxHelpers;
|
using NUnit.Framework.SyntaxHelpers;
|
||||||
using Nwc.XmlRpc;
|
using Nwc.XmlRpc;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Region.Communications.Local;
|
using OpenSim.Region.Communications.Local;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
using OpenSim.Client.Linden;
|
using OpenSim.Client.Linden;
|
||||||
|
|
|
@ -34,6 +34,7 @@ using log4net.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Grid.Communications.OGS1;
|
using OpenSim.Grid.Communications.OGS1;
|
||||||
|
|
|
@ -36,6 +36,7 @@ using OpenMetaverse;
|
||||||
using OpenSim.Data;
|
using OpenSim.Data;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Communications.Capabilities;
|
using OpenSim.Framework.Communications.Capabilities;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
|
|
@ -36,6 +36,7 @@ using Nini.Config;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Services;
|
||||||
using OpenSim.Framework.Communications.Cache;
|
using OpenSim.Framework.Communications.Cache;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||||
m_osw = gridInterComms;
|
m_osw = gridInterComms;
|
||||||
|
|
||||||
// The HG InventoryService always uses secure handlers
|
// The HG InventoryService always uses secure handlers
|
||||||
HGInventoryService invService = new HGInventoryService(serversInfo.InventoryURL, this.m_userProfileCacheService, true);
|
HGInventoryServiceClient invService = new HGInventoryServiceClient(serversInfo.InventoryURL, this.m_userProfileCacheService, true);
|
||||||
AddSecureInventoryService(invService);
|
AddSecureInventoryService(invService);
|
||||||
m_defaultInventoryHost = invService.Host;
|
m_defaultInventoryHost = invService.Host;
|
||||||
if (SecureInventoryService != null)
|
if (SecureInventoryService != null)
|
||||||
|
|
|
@ -40,7 +40,7 @@ using OpenSim.Region.Communications.Local;
|
||||||
|
|
||||||
namespace OpenSim.Region.Communications.Hypergrid
|
namespace OpenSim.Region.Communications.Hypergrid
|
||||||
{
|
{
|
||||||
public class HGInventoryService : LocalInventoryService, ISecureInventoryService
|
public class HGInventoryServiceClient : LocalInventoryService, ISecureInventoryService
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log
|
private static readonly ILog m_log
|
||||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -58,7 +58,7 @@ namespace OpenSim.Region.Communications.Hypergrid
|
||||||
set { m_userProfileCache = value; }
|
set { m_userProfileCache = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public HGInventoryService(string inventoryServerUrl, UserProfileCacheService userProfileCacheService, bool gridmode)
|
public HGInventoryServiceClient(string inventoryServerUrl, UserProfileCacheService userProfileCacheService, bool gridmode)
|
||||||
{
|
{
|
||||||
_inventoryServerUrl = HGNetworkServersInfo.ServerURI(inventoryServerUrl);
|
_inventoryServerUrl = HGNetworkServersInfo.ServerURI(inventoryServerUrl);
|
||||||
//m_Uri = new Uri(_inventoryServerUrl);
|
//m_Uri = new Uri(_inventoryServerUrl);
|
||||||
|
|
Loading…
Reference in New Issue