/// <summary>
        /// Initializes a new instance of the <see cref="CompressibleExtractor" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="ArgumentNullException">configuration</exception>
        public CompressibleExtractor(IAmiConfigurationManager configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            MaxCompressibleEntries = configuration.MaxCompressedEntries;
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageService"/> class.
        /// </summary>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        /// <param name="appInfoFactory">The application information factory.</param>
        /// <param name="jsonWriter">The JSON writer.</param>
        /// <param name="imageExtractor">The image extractor.</param>
        /// <param name="gifImageWriter">The GIF image writer.</param>
        /// <exception cref="ArgumentNullException">
        /// loggerFactory
        /// or
        /// configuration
        /// or
        /// fileSystemStrategy
        /// or
        /// appInfoFactory
        /// or
        /// jsonWriter
        /// or
        /// imageExtractor
        /// or
        /// gifImageWriter
        /// </exception>
        public ImageService(
            ILoggerFactory loggerFactory,
            IAmiConfigurationManager configuration,
            IFileSystemStrategy fileSystemStrategy,
            IAppInfoFactory appInfoFactory,
            IDefaultJsonWriter jsonWriter,
            IImageExtractor imageExtractor,
            IGifImageWriter gifImageWriter)
        {
            logger = loggerFactory?.CreateLogger <ImageService>();
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            this.configuration = configuration;
            if (this.configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            this.fileSystemStrategy = fileSystemStrategy;
            if (this.fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            this.appInfoFactory = appInfoFactory;
            if (this.appInfoFactory == null)
            {
                throw new ArgumentNullException(nameof(appInfoFactory));
            }

            this.jsonWriter = jsonWriter;
            if (this.jsonWriter == null)
            {
                throw new ArgumentNullException(nameof(jsonWriter));
            }

            this.imageExtractor = imageExtractor;
            if (this.imageExtractor == null)
            {
                throw new ArgumentNullException(nameof(imageExtractor));
            }

            this.gifImageWriter = gifImageWriter;
            if (this.gifImageWriter == null)
            {
                throw new ArgumentNullException(nameof(gifImageWriter));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetImageQueryHandler"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        public GetImageQueryHandler(
            IAmiUnitOfWork context,
            IAmiConfigurationManager configuration,
            IFileSystemStrategy fileSystemStrategy)
        {
            this.context       = context ?? throw new ArgumentNullException(nameof(context));
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

            if (fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            fileSystem = fileSystemStrategy.Create(configuration.WorkingDirectory);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateCommandHandler"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="idGenService">The service to generate unique identifiers.</param>
        /// <param name="constants">The application constants.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        public CreateCommandHandler(
            IAmiUnitOfWork context,
            IIdGenService idGenService,
            IApplicationConstants constants,
            IAmiConfigurationManager configuration,
            IFileSystemStrategy fileSystemStrategy)
            : base()
        {
            this.context       = context ?? throw new ArgumentNullException(nameof(context));
            this.idGenService  = idGenService ?? throw new ArgumentNullException(nameof(idGenService));
            this.constants     = constants ?? throw new ArgumentNullException(nameof(constants));
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

            if (fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            fileSystem = fileSystemStrategy.Create(configuration.WorkingDirectory);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ChunkedObjectUploader" /> class.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        /// <param name="constants">The application constants.</param>
        /// <param name="mediator">The mediator.</param>
        /// <exception cref="ArgumentNullException">
        /// configuration
        /// or
        /// fileSystemStrategy
        /// or
        /// objectService
        /// </exception>
        public ChunkedObjectUploader(
            IAmiConfigurationManager configuration,
            IFileSystemStrategy fileSystemStrategy,
            IApplicationConstants constants,
            IMediator mediator)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            fileSystem     = fileSystemStrategy.Create(configuration.WorkingDirectory);
            baseUploadPath = fileSystem.Path.Combine(configuration.WorkingDirectory, "Upload", "Objects");

            this.constants = constants ?? throw new ArgumentNullException(nameof(constants));
            this.mediator  = mediator ?? throw new ArgumentNullException(nameof(mediator));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessCommandHandler"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="idGenService">The service to generate unique identifiers.</param>
        /// <param name="serializer">The JSON serializer.</param>
        /// <param name="mediator">The mediator.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        public ProcessCommandHandler(
            IAmiUnitOfWork context,
            IIdGenService idGenService,
            IDefaultJsonSerializer serializer,
            IMediator mediator,
            IAmiConfigurationManager configuration,
            IFileSystemStrategy fileSystemStrategy)
            : base()
        {
            this.context       = context ?? throw new ArgumentNullException(nameof(context));
            this.idGenService  = idGenService ?? throw new ArgumentNullException(nameof(idGenService));
            this.serializer    = serializer ?? throw new ArgumentNullException(nameof(serializer));
            this.mediator      = mediator ?? throw new ArgumentNullException(nameof(mediator));
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

            if (fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            fileSystem = fileSystemStrategy.Create(configuration.WorkingDirectory);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomExceptionHandler"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="loggerFactory">The logger factory.</param>
 /// <param name="serializer">The serializer.</param>
 /// <exception cref="ArgumentNullException">
 /// configuration
 /// or
 /// loggerFactory
 /// or
 /// serializer
 /// </exception>
 public CustomExceptionHandler(IAmiConfigurationManager configuration, ILoggerFactory loggerFactory, IDefaultJsonSerializer serializer)
 {
     this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     logger             = loggerFactory?.CreateLogger <CustomExceptionHandler>() ?? throw new ArgumentNullException(nameof(loggerFactory));
     this.serializer    = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SharpCompressExtractor"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 public SharpCompressExtractor(IAmiConfigurationManager configuration)
     : base(configuration)
 {
 }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SharpCompressReader"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 public SharpCompressReader(IAmiConfigurationManager configuration)
     : base(configuration)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomExceptionFilterAttribute"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="handler">The exception handler.</param>
 /// <exception cref="ArgumentNullException">handler</exception>
 public CustomExceptionFilterAttribute(IAmiConfigurationManager configuration, ICustomExceptionHandler handler)
     : base()
 {
     this.handler = handler ?? throw new ArgumentNullException(nameof(handler));
 }