2018-11-04 20:33:37 +00:00
|
|
|
|
using Roadie.Library.Caching;
|
|
|
|
|
using Roadie.Library.Configuration;
|
2018-11-03 21:21:36 +00:00
|
|
|
|
using Roadie.Library.Logging;
|
|
|
|
|
|
|
|
|
|
namespace Roadie.Library.MetaData
|
|
|
|
|
{
|
|
|
|
|
public abstract class MetaDataProviderBase
|
|
|
|
|
{
|
|
|
|
|
protected readonly ICacheManager _cacheManager = null;
|
2018-11-04 20:33:37 +00:00
|
|
|
|
protected readonly IRoadieSettings _configuration = null;
|
2018-11-03 21:21:36 +00:00
|
|
|
|
protected readonly ILogger _loggingService = null;
|
|
|
|
|
|
2018-11-04 20:33:37 +00:00
|
|
|
|
protected ApiKey _apiKey = null;
|
|
|
|
|
|
|
|
|
|
public virtual bool IsEnabled
|
2018-11-03 21:21:36 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2018-11-04 20:33:37 +00:00
|
|
|
|
return true;
|
2018-11-03 21:21:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-04 20:33:37 +00:00
|
|
|
|
protected ApiKey ApiKey
|
2018-11-03 21:21:36 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2018-11-04 20:33:37 +00:00
|
|
|
|
return this._apiKey;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected ICacheManager CacheManager
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return this._cacheManager;
|
2018-11-03 21:21:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-04 20:33:37 +00:00
|
|
|
|
protected IRoadieSettings Configuration
|
2018-11-03 21:21:36 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return this._configuration;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-04 20:33:37 +00:00
|
|
|
|
protected ILogger Logger
|
2018-11-03 21:21:36 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2018-11-04 20:33:37 +00:00
|
|
|
|
return this._loggingService;
|
2018-11-03 21:21:36 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-04 20:33:37 +00:00
|
|
|
|
public MetaDataProviderBase(IRoadieSettings configuration, ICacheManager cacheManager, ILogger loggingService)
|
2018-11-03 21:21:36 +00:00
|
|
|
|
{
|
|
|
|
|
this._configuration = configuration;
|
|
|
|
|
this._cacheManager = cacheManager;
|
|
|
|
|
this._loggingService = loggingService;
|
|
|
|
|
|
|
|
|
|
System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
|
|
|
|
|
System.Security.Cryptography.X509Certificates.X509Chain chain,
|
|
|
|
|
System.Net.Security.SslPolicyErrors sslPolicyErrors)
|
|
|
|
|
{
|
|
|
|
|
return true; // **** Always accept
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|