Exemplo n.º 1
0
 public ValidationMessageHandler(
     ICorePackageService galleryPackageService,
     IValidationSetProvider validationSetProvider,
     IValidationSetProcessor validationSetProcessor,
     IValidationOutcomeProcessor validationOutcomeProcessor,
     ILogger <ValidationMessageHandler> logger)
 {
     _galleryPackageService      = galleryPackageService ?? throw new ArgumentNullException(nameof(galleryPackageService));
     _validationSetProvider      = validationSetProvider ?? throw new ArgumentNullException(nameof(validationSetProvider));
     _validationSetProcessor     = validationSetProcessor ?? throw new ArgumentNullException(nameof(validationSetProcessor));
     _validationOutcomeProcessor = validationOutcomeProcessor ?? throw new ArgumentNullException(nameof(validationOutcomeProcessor));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 2
0
 public ValidationMessageHandler(
     ICorePackageService galleryPackageService,
     IValidationSetProvider validationSetProvider,
     IValidationSetProcessor validationSetProcessor,
     IValidationOutcomeProcessor validationOutcomeProcessor,
     IShutdownNotificationTokenProvider shutdownNotificationTokenProvider,
     ILogger <ValidationMessageHandler> logger)
 {
     _galleryPackageService             = galleryPackageService ?? throw new ArgumentNullException(nameof(galleryPackageService));
     _validationSetProvider             = validationSetProvider ?? throw new ArgumentNullException(nameof(validationSetProvider));
     _validationSetProcessor            = validationSetProcessor ?? throw new ArgumentNullException(nameof(validationSetProcessor));
     _validationOutcomeProcessor        = validationOutcomeProcessor ?? throw new ArgumentNullException(nameof(validationOutcomeProcessor));
     _shutdownNotificationTokenProvider = shutdownNotificationTokenProvider ?? throw new ArgumentNullException(nameof(shutdownNotificationTokenProvider));
     if (shutdownNotificationTokenProvider.Token == null)
     {
         throw new ArgumentException($"{nameof(shutdownNotificationTokenProvider.Token)} property cannot be null", nameof(shutdownNotificationTokenProvider));
     }
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 3
0
        public BaseValidationMessageHandler(
            IOptionsSnapshot <ValidationConfiguration> validationConfigsAccessor,
            IEntityService <TEntity> entityService,
            IValidationSetProvider <TEntity> validationSetProvider,
            IValidationSetProcessor validationSetProcessor,
            IValidationOutcomeProcessor <TEntity> validationOutcomeProcessor,
            ILeaseService leaseService,
            IPackageValidationEnqueuer validationEnqueuer,
            IFeatureFlagService featureFlagService,
            ITelemetryService telemetryService,
            ILogger logger)
        {
            if (validationConfigsAccessor == null)
            {
                throw new ArgumentNullException(nameof(validationConfigsAccessor));
            }

            if (validationConfigsAccessor.Value == null)
            {
                throw new ArgumentException(
                          $"The {nameof(IOptionsSnapshot<ValidationConfiguration>)}.{nameof(IOptionsSnapshot<ValidationConfiguration>.Value)} property cannot be null",
                          nameof(validationConfigsAccessor));
            }

            if (validationConfigsAccessor.Value.MissingPackageRetryCount < 1)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(validationConfigsAccessor),
                          $"{nameof(ValidationConfiguration)}.{nameof(ValidationConfiguration.MissingPackageRetryCount)} must be at least 1");
            }

            _configs                    = validationConfigsAccessor.Value;
            _entityService              = entityService ?? throw new ArgumentNullException(nameof(entityService));
            _validationSetProvider      = validationSetProvider ?? throw new ArgumentNullException(nameof(validationSetProvider));
            _validationSetProcessor     = validationSetProcessor ?? throw new ArgumentNullException(nameof(validationSetProcessor));
            _validationOutcomeProcessor = validationOutcomeProcessor ?? throw new ArgumentNullException(nameof(validationOutcomeProcessor));
            _leaseService               = leaseService ?? throw new ArgumentNullException(nameof(leaseService));
            _validationEnqueuer         = validationEnqueuer ?? throw new ArgumentNullException(nameof(leaseService));
            _featureFlagService         = featureFlagService ?? throw new ArgumentNullException(nameof(featureFlagService));
            _telemetryService           = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }
 public PackageValidationMessageHandler(
     IOptionsSnapshot <ValidationConfiguration> validationConfigsAccessor,
     IEntityService <Package> entityService,
     IValidationSetProvider <Package> validationSetProvider,
     IValidationSetProcessor validationSetProcessor,
     IValidationOutcomeProcessor <Package> validationOutcomeProcessor,
     ILeaseService leaseService,
     IPackageValidationEnqueuer validationEnqueuer,
     IFeatureFlagService featureFlagService,
     ITelemetryService telemetryService,
     ILogger <PackageValidationMessageHandler> logger) : base(
         validationConfigsAccessor,
         entityService,
         validationSetProvider,
         validationSetProcessor,
         validationOutcomeProcessor,
         leaseService,
         validationEnqueuer,
         featureFlagService,
         telemetryService,
         logger)
 {
 }
Exemplo n.º 5
0
        public ValidationMessageHandler(
            IOptionsSnapshot <ValidationConfiguration> validationConfigsAccessor,
            ICorePackageService galleryPackageService,
            IValidationSetProvider validationSetProvider,
            IValidationSetProcessor validationSetProcessor,
            IValidationOutcomeProcessor validationOutcomeProcessor,
            ITelemetryService telemetryService,
            ILogger <ValidationMessageHandler> logger)
        {
            if (validationConfigsAccessor == null)
            {
                throw new ArgumentNullException(nameof(validationConfigsAccessor));
            }

            if (validationConfigsAccessor.Value == null)
            {
                throw new ArgumentException(
                          $"The {nameof(IOptionsSnapshot<ValidationConfiguration>)}.{nameof(IOptionsSnapshot<ValidationConfiguration>.Value)} property cannot be null",
                          nameof(validationConfigsAccessor));
            }

            if (validationConfigsAccessor.Value.MissingPackageRetryCount < 1)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(validationConfigsAccessor),
                          $"{nameof(ValidationConfiguration)}.{nameof(ValidationConfiguration.MissingPackageRetryCount)} must be at least 1");
            }

            _configs = validationConfigsAccessor.Value;
            _galleryPackageService      = galleryPackageService ?? throw new ArgumentNullException(nameof(galleryPackageService));
            _validationSetProvider      = validationSetProvider ?? throw new ArgumentNullException(nameof(validationSetProvider));
            _validationSetProcessor     = validationSetProcessor ?? throw new ArgumentNullException(nameof(validationSetProcessor));
            _validationOutcomeProcessor = validationOutcomeProcessor ?? throw new ArgumentNullException(nameof(validationOutcomeProcessor));
            _telemetryService           = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
        }