/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceCallHistoryStorageService">Service to store Media Services call history</param> /// <param name="configService">configuration container that stores data about Azure Media Service instances</param> public MediaServiceInstanceFactory(IMediaServiceCallHistoryStorageService mediaServiceCallHistoryStorageService, IConfigService configService) { this.mediaServiceCallHistoryStorageService = mediaServiceCallHistoryStorageService ?? throw new ArgumentNullException(nameof(mediaServiceCallHistoryStorageService)); this.configService = configService ?? throw new ArgumentNullException(nameof(configService)); this.azureMediaServicesClientLockObject = new object(); this.resetRequested = false; }
/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceInstanceHealthStorageService">Storage service to persist status of all calls to Media Services APIs</param> /// <param name="jobOutputStatusStorageService">Job output status storage service is used to recalculate Azure Media Services instance health</param> /// <param name="mediaServiceCallHistoryStorageService">Service to store Media Services call history</param> /// <param name="configService">Configuration container</param> public MediaServiceInstanceHealthService(IMediaServiceInstanceHealthStorageService mediaServiceInstanceHealthStorageService, IJobOutputStatusStorageService jobOutputStatusStorageService, IMediaServiceCallHistoryStorageService mediaServiceCallHistoryStorageService, IConfigService configService) { this.mediaServiceInstanceHealthStorageService = mediaServiceInstanceHealthStorageService ?? throw new ArgumentNullException(nameof(mediaServiceInstanceHealthStorageService)); this.jobOutputStatusStorageService = jobOutputStatusStorageService ?? throw new ArgumentNullException(nameof(jobOutputStatusStorageService)); this.mediaServiceCallHistoryStorageService = mediaServiceCallHistoryStorageService ?? throw new ArgumentNullException(nameof(mediaServiceCallHistoryStorageService)); this.numberOfMinutesInProcessToMarkJobStuck = configService.NumberOfMinutesInProcessToMarkJobStuck; this.timeWindowToLoadJobsInMinutes = configService.TimeWindowToLoadJobsInMinutes; this.timeWindowToLoadMediaServiceCallsInMinutes = configService.TimeWindowToLoadMediaServiceCallsInMinutes; this.successRateForHealthyState = configService.SuccessRateForHealthyState; this.successRateForUnHealthyState = configService.SuccessRateForUnHealthyState; }
/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceCallHistoryStorageService">Service to store Media Services call history</param> /// <param name="mediaServiceInstanceFactory">Factory to get Azure Media Service instance client</param> /// <param name="logger">Logger to log data</param> public CallHistoryHandler(IMediaServiceCallHistoryStorageService mediaServiceCallHistoryStorageService, IMediaServiceInstanceFactory mediaServiceInstanceFactory, ILogger logger) { this.mediaServiceCallHistoryStorageService = mediaServiceCallHistoryStorageService ?? throw new ArgumentNullException(nameof(mediaServiceCallHistoryStorageService)); this.mediaServiceInstanceFactory = mediaServiceInstanceFactory ?? throw new ArgumentNullException(nameof(mediaServiceInstanceFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); }