コード例 #1
0
ファイル: S3.cs プロジェクト: zhxjdwh/revenj
        static S3()
        {
            StaticRepository = Static.Locator.Resolve <IS3Repository>();
            var config = Static.Locator.Resolve <Configuration>();

            BucketName = config["S3BucketName"];
        }
コード例 #2
0
 public App(ILogger <App> logger, IS3Repository s3Repository, IDataConverter dataConverterService, IDataUploader dataUploader)
 {
     _logger               = logger ?? throw new ArgumentNullException(nameof(logger));
     _s3Repository         = s3Repository ?? throw new ArgumentNullException(nameof(s3Repository));
     _dataConverterService = dataConverterService ?? throw new ArgumentNullException(nameof(dataConverterService));
     _dataUploader         = dataUploader ?? throw new ArgumentNullException(nameof(dataUploader));
 }
コード例 #3
0
ファイル: S3Repository.cs プロジェクト: zhxjdwh/revenj
        static S3Repository()
        {
            var customRepository = ConfigurationManager.AppSettings["S3Repository"];

            BucketName = ConfigurationManager.AppSettings["S3BucketName"];
            if (customRepository != null)
            {
                var type = Type.GetType(customRepository);
                if (type == null)
                {
                    throw new ConfigurationErrorsException("Custom S3 repository (" + customRepository + @") not found. 
Please check your settings.");
                }
                Repository = Activator.CreateInstance(type) as IS3Repository;
                if (Repository == null)
                {
                    throw new ConfigurationErrorsException("Custom S3 repository (" + customRepository + @") does not implement IS3Repository interface. 
Please check your settings.");
                }
            }
            else
            {
                Repository = new LitS3Repository();
            }
        }
コード例 #4
0
ファイル: PartitionService.cs プロジェクト: mdjukic/repos
 public PartitionService(ILogger logger, IS3Repository s3Repository, IEphemeralRepository ephemeralRepository, IScenarioSummaryRepository scenarioSummaryRepository)
 {
     _logger                    = logger.ForContext <PartitionService>();
     _s3Repository              = s3Repository;
     _ephemeralRepository       = ephemeralRepository;
     _scenarioSummaryRepository = scenarioSummaryRepository;
 }
コード例 #5
0
 public FileUploadService(IAmazonS3 s3Client, IFileUploadSettings fileUploadSettings, IFileUploadRepository fileUploadRepository, IS3CsvRepository s3Repository, IFileUploadScenarioRepository fileUploadScenarioRepository)
 {
     _s3Client                     = s3Client;
     _fileUploadSettings           = fileUploadSettings;
     _fileUploadRepository         = fileUploadRepository;
     _s3Repository                 = s3Repository;
     _fileUploadScenarioRepository = fileUploadScenarioRepository;
 }
コード例 #6
0
        public static Task Upload(this IS3Repository repository, string bucket, string key, byte[] bytes)
        {
#if PORTABLE
            return(repository.Upload(bucket, key, new MemoryStream(bytes), bytes.Length, null));
#else
            return(repository.Upload(bucket, key, new MemoryStream(bytes), bytes.LongLength, null));
#endif
        }
コード例 #7
0
 public FileDomainService(IFileRepository repository, IS3Repository s3Repository
                          , IRepository <byte[], FileContent> fileContentRepository, IConfigService configService)
 {
     this._repository            = repository;
     this._s3Repository          = s3Repository;
     this._fileContentRepository = fileContentRepository;
     this._configService         = configService;
     ;
 }
コード例 #8
0
ファイル: S3.cs プロジェクト: zhxjdwh/revenj
        private void OnDeserialized(StreamingContext context)
        {
            var locator = context.Context as IServiceProvider;

            if (locator == null)
            {
                return;
            }
            InstanceRepository = locator.Resolve <IS3Repository>();
        }
コード例 #9
0
 public DbToS3DomainService(
     IConfigService configService,
     IFileDomainService fileDomainService,
     IS3Repository s3Repository,
     IRepository <byte[], FileContent> linkRepository)
 {
     this._configService     = configService;
     this._fileDomainService = fileDomainService;
     this._s3Repository      = s3Repository;
     this._linkRepository    = linkRepository;
 }
コード例 #10
0
 public FileDomainService(IConfigService configService,
                          IFileLimitDomainService fileLimitDomainService,
                          IRepository <string, File> repository,
                          IS3Repository s3Repository,
                          IRepository <string, FileContent> fileContentRepository)
 {
     this._configService          = configService;
     this._fileLimitDomainService = fileLimitDomainService;
     this._repository             = repository;
     this._s3Repository           = s3Repository;
     this._fileContentRepository  = fileContentRepository;
 }
コード例 #11
0
        public async Task <object> GetResourceDetails(MonitoringResourceRequest monitoringResourceRequest)
        {
            s3Repository        = new S3Repository();
            s3Repository.Region = monitoringResourceRequest.Region;
            var response = await s3Repository.GetS3Details();

            var mapResponse = response.Buckets.Select(x => new S3Response()
            {
                BucketName  = x.BucketName,
                CreatedDate = x.CreationDate.ToString(),
                Region      = monitoringResourceRequest.Region
            });

            return(response);
        }
コード例 #12
0
        public async Task <MonitoringSummaryResponse> GetResources(string region)
        {
            s3Repository        = new S3Repository();
            s3Repository.Region = region;
            var response = await s3Repository.GetS3Details();

            var resources = response.Buckets.Select(x => x.BucketName).ToList();

            return(new MonitoringSummaryResponse()
            {
                Label = "AWS/S3",
                Count = resources.Count,
                ResourcesId = resources
            });
        }
コード例 #13
0
ファイル: S3Repository.cs プロジェクト: nutrija/revenj
 static S3Repository()
 {
     var customRepository = ConfigurationManager.AppSettings["S3Repository"];
     BucketName = ConfigurationManager.AppSettings["S3BucketName"];
     if (customRepository != null)
     {
         var type = Type.GetType(customRepository);
         if (type == null)
             throw new ConfigurationErrorsException("Custom S3 repository (" + customRepository + @") not found.
     Please check your settings.");
         Repository = Activator.CreateInstance(type) as IS3Repository;
         if (Repository == null)
             throw new ConfigurationErrorsException("Custom S3 repository (" + customRepository + @") does not implement IS3Repository interface.
     Please check your settings.");
     }
     else Repository = new LitS3Repository();
 }
コード例 #14
0
ファイル: S3.cs プロジェクト: ngs-doo/revenj
 static S3()
 {
     StaticRepository = Static.Locator.Resolve<IS3Repository>();
     var config = Static.Locator.Resolve<Configuration>();
     BucketName = config["S3BucketName"];
 }
コード例 #15
0
 public S3Operations(IS3Repository _s3Repository)
 {
     s3Repository = _s3Repository;
 }
コード例 #16
0
ファイル: S3.cs プロジェクト: zhxjdwh/revenj
 public S3(IS3Repository repository = null)
 {
     this.InstanceRepository = repository;
     this.Metadata           = new Dictionary <string, string>();
 }
コード例 #17
0
ファイル: PolicyService.cs プロジェクト: jrventaja/rsventaja
 public PolicyService(IPolicyRepository policyRepository, IS3Repository s3Repository, ICrypRepository crypRepository)
 {
     _policyRepository = policyRepository;
     _s3Repository     = s3Repository;
     _crypRepository   = crypRepository;
 }
コード例 #18
0
 public MarkdownService(ILogger logger, IMemoryCache cache, IS3Repository s3Repository)
 {
     _logger          = logger;
     _ladderPathCache = cache;
     _s3Repository    = s3Repository;
 }
コード例 #19
0
 public DocumentRepository(IS3Repository s3Repository, IKSMRepository kSMRepository)
 {
     this.s3Repository  = s3Repository;
     this.kSMRepository = kSMRepository;
 }
コード例 #20
0
 public ScenarioResultService(IS3Repository s3Repository, IRecommendationRepository recommendationRepository, IRecommendationProductRepository recommendationProductRepository)
 {
     _s3Repository                    = s3Repository;
     _recommendationRepository        = recommendationRepository;
     _recommendationProductRepository = recommendationProductRepository;
 }
コード例 #21
0
 public ModelService(ILogger logger, IS3Repository s3Repository, IEphemeralRepository ephemeralRepository)
 {
     _logger              = logger.ForContext <ModelService>();
     _s3Repository        = s3Repository;
     _ephemeralRepository = ephemeralRepository;
 }
コード例 #22
0
 public static Task Upload(this IS3Repository repository, string bucket, string key, Stream stream)
 {
     return(repository.Upload(bucket, key, stream, stream.Length, null));
 }
コード例 #23
0
ファイル: S3.cs プロジェクト: ngs-doo/revenj
 private void OnDeserialized(StreamingContext context)
 {
     var locator = context.Context as IServiceProvider;
     if (locator == null)
         return;
     InstanceRepository = locator.Resolve<IS3Repository>();
 }
コード例 #24
0
 public DocumentController(IDocumentRepository documentRepository, IS3Repository s3Repository, Whitelists whitelists)
 {
     this.documentRepository = documentRepository;
     this.s3Repository       = s3Repository;
     this.whitelists         = whitelists;
 }
コード例 #25
0
ファイル: S3.cs プロジェクト: ngs-doo/revenj
 public S3(IS3Repository repository = null)
 {
     this.InstanceRepository = repository;
     this.Metadata = new Dictionary<string, string>();
 }
コード例 #26
0
 public ScenarioService(ILogger logger, IS3Repository s3Repository)
 {
     _logger       = logger;
     _s3Repository = s3Repository;
 }