Files
Umbraco-CMS/src/Umbraco.Core/Sync/ConfigServerRegistration.cs
Shannon Deminick 4e6bdd1fc7 Fixed some med trust issues with UmbracoExamine. Created new framework for distributed cache providers with unit tests. Still uses the
old ICacheRefresher but now we can plugin 2 new providers - one for resolving a list of servers and the other to notify the servers of changes.
By default we have the configuration based providers which uses the umbracoSettings.
2013-02-12 03:46:27 +06:00

29 lines
1.2 KiB
C#

using System.Xml;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
namespace Umbraco.Core.Sync
{
/// <summary>
/// A server registration based on the legacy umbraco xml configuration in umbracoSettings
/// </summary>
internal class ConfigServerRegistration : IServerRegistration
{
public ConfigServerRegistration(XmlNode n)
{
var webServicesUrl = IOHelper.ResolveUrl(SystemDirectories.WebServices);
var protocol = GlobalSettings.UseSSL ? "https" : "http";
if (n.Attributes.GetNamedItem("forceProtocol") != null && !string.IsNullOrEmpty(n.Attributes.GetNamedItem("forceProtocol").Value))
protocol = n.Attributes.GetNamedItem("forceProtocol").Value;
var domain = XmlHelper.GetNodeValue(n);
if (n.Attributes.GetNamedItem("forcePortnumber") != null && !string.IsNullOrEmpty(n.Attributes.GetNamedItem("forcePortnumber").Value))
domain += string.Format(":{0}", n.Attributes.GetNamedItem("forcePortnumber").Value);
ServerAddress = string.Format("{0}://{1}{2}/cacheRefresher.asmx", protocol, domain, webServicesUrl);
}
public string ServerAddress { get; private set; }
}
}