/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceInstanceHealthService">Media services instance health service</param> /// <param name="jobVerificationRequestStorageService">Job verification requests storage service </param> /// <param name="jobOutputStatusStorageService">Job output status service to persist job output status after initial job submission</param> /// <param name="mediaServiceInstanceFactory">Factory to get Azure Media Service instance client</param> /// <param name="configService">Configuration container</param> public JobSchedulingService(IMediaServiceInstanceHealthService mediaServiceInstanceHealthService, IJobVerificationRequestStorageService jobVerificationRequestStorageService, IJobOutputStatusStorageService jobOutputStatusStorageService, IMediaServiceInstanceFactory mediaServiceInstanceFactory, IConfigService configService) { this.mediaServiceInstanceHealthService = mediaServiceInstanceHealthService ?? throw new ArgumentNullException(nameof(mediaServiceInstanceHealthService)); this.jobVerificationRequestStorageService = jobVerificationRequestStorageService ?? throw new ArgumentNullException(nameof(jobVerificationRequestStorageService)); this.jobOutputStatusStorageService = jobOutputStatusStorageService ?? throw new ArgumentNullException(nameof(jobOutputStatusStorageService)); this.mediaServiceInstanceFactory = mediaServiceInstanceFactory ?? throw new ArgumentNullException(nameof(mediaServiceInstanceFactory)); this.configService = configService ?? throw new ArgumentNullException(nameof(configService)); this.verificationDelay = new TimeSpan(0, this.configService.TimeDurationInMinutesToVerifyJobStatus, 0); }
/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceInstanceHealthService">Service to load Azure Media Service instance health information</param> /// <param name="jobOutputStatusStorageService">Storage service for job output status records</param> /// <param name="provisioningRequestStorageService">Storage service to persist provisioning requests</param> /// <param name="jobVerificationRequestStorageService">Storage service to persist job verification requests</param> /// <param name="mediaServiceInstanceFactory">Factory to create Azure Media Services instance</param> /// <param name="configService">Configuration container</param> public JobVerificationService(IMediaServiceInstanceHealthService mediaServiceInstanceHealthService, IJobOutputStatusStorageService jobOutputStatusStorageService, IProvisioningRequestStorageService provisioningRequestStorageService, IJobVerificationRequestStorageService jobVerificationRequestStorageService, IMediaServiceInstanceFactory mediaServiceInstanceFactory, IConfigService configService) { this.mediaServiceInstanceHealthService = mediaServiceInstanceHealthService ?? throw new ArgumentNullException(nameof(mediaServiceInstanceHealthService)); this.jobOutputStatusStorageService = jobOutputStatusStorageService ?? throw new ArgumentNullException(nameof(jobOutputStatusStorageService)); this.provisioningRequestStorageService = provisioningRequestStorageService ?? throw new ArgumentNullException(nameof(provisioningRequestStorageService)); this.jobVerificationRequestStorageService = jobVerificationRequestStorageService ?? throw new ArgumentNullException(nameof(jobVerificationRequestStorageService)); this.mediaServiceInstanceFactory = mediaServiceInstanceFactory ?? throw new ArgumentNullException(nameof(mediaServiceInstanceFactory)); this.configService = configService ?? throw new ArgumentNullException(nameof(configService)); }
/// <summary> /// Constructor /// </summary> /// <param name="mediaServiceInstanceHealthService">Service to load Azure Media Service instance health information</param> /// <param name="jobOutputStatusStorageService">Storage service for job output status records</param> /// <param name="mediaServiceInstanceFactory">Factory to create Azure Media Services instance</param> /// <param name="provisioningRequestStorageService">Storage services to persist provisioning requests.</param> /// <param name="configService">Configuration container</param> public JobOutputStatusSyncService(IMediaServiceInstanceHealthService mediaServiceInstanceHealthService, IJobOutputStatusStorageService jobOutputStatusStorageService, IMediaServiceInstanceFactory mediaServiceInstanceFactory, IProvisioningRequestStorageService provisioningRequestStorageService, IConfigService configService) { this.mediaServiceInstanceHealthService = mediaServiceInstanceHealthService ?? throw new ArgumentNullException(nameof(mediaServiceInstanceHealthService)); this.jobOutputStatusStorageService = jobOutputStatusStorageService ?? throw new ArgumentNullException(nameof(jobOutputStatusStorageService)); this.mediaServiceInstanceFactory = mediaServiceInstanceFactory ?? throw new ArgumentNullException(nameof(mediaServiceInstanceFactory)); this.provisioningRequestStorageService = provisioningRequestStorageService ?? throw new ArgumentNullException(nameof(provisioningRequestStorageService)); this.configService = configService ?? throw new ArgumentNullException(nameof(configService)); this.timeWindowToLoadJobsInMinutes = this.configService.TimeWindowToLoadJobsInMinutes; this.timeSinceLastUpdateToForceJobResyncInMinutes = this.configService.TimeSinceLastUpdateToForceJobResyncInMinutes; }
/// <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="jobOutputStatusStorageService">Storage services to persist job output status events.</param> /// <param name="provisioningRequestStorageService">Storage services to persist provisioning requests.</param> public JobOutputStatusService(IJobOutputStatusStorageService jobOutputStatusStorageService, IProvisioningRequestStorageService provisioningRequestStorageService) { this.jobOutputStatusStorageService = jobOutputStatusStorageService ?? throw new ArgumentNullException(nameof(jobOutputStatusStorageService)); this.provisioningRequestStorageService = provisioningRequestStorageService ?? throw new ArgumentNullException(nameof(provisioningRequestStorageService)); }