roadie/Roadie.Api.Library/SearchEngines/MetaData/MetaDataProviderBase.cs

69 lines
1.8 KiB
C#
Raw Normal View History

2018-11-11 21:13:19 +00:00
using Microsoft.Extensions.Logging;
using Roadie.Library.Caching;
2018-11-04 20:33:37 +00:00
using Roadie.Library.Configuration;
2018-11-03 21:21:36 +00:00
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-11 21:13:19 +00:00
protected readonly ILogger _logger = null;
2018-11-03 21:21:36 +00:00
2019-06-02 04:27:17 +00:00
protected IApiKey _apiKey = null;
2018-11-04 20:33:37 +00:00
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
}
}
2019-06-02 04:27:17 +00:00
protected IApiKey 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-11 21:13:19 +00:00
return this._logger;
2018-11-03 21:21:36 +00:00
}
}
2018-11-11 21:13:19 +00:00
public MetaDataProviderBase(IRoadieSettings configuration, ICacheManager cacheManager, ILogger logger)
2018-11-03 21:21:36 +00:00
{
this._configuration = configuration;
this._cacheManager = cacheManager;
2018-11-11 21:13:19 +00:00
this._logger = logger;
2018-11-03 21:21:36 +00:00
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
};
}
}
}