예제 #1
0
        public ScoreDatabase(IScoreQuota quota, IAmazonDynamoDB dynamoDbClient, IConfiguration configuration)
        {
            var tableName = configuration[EnvironmentNames.ScoreDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreDynamoDbTableName}' is not found.");
            }
            ScoreTableName = tableName;

            var scoreDataTableName = configuration[EnvironmentNames.ScoreLargeDataDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(scoreDataTableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreLargeDataDynamoDbTableName}' is not found.");
            }
            ScoreDataTableName = scoreDataTableName;

            var scoreItemRelationDataTableName = configuration[EnvironmentNames.ScoreItemRelationDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(scoreItemRelationDataTableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreItemRelationDynamoDbTableName}' is not found.");
            }
            ScoreItemRelationTableName = scoreItemRelationDataTableName;

            _quota          = quota;
            _dynamoDbClient = dynamoDbClient;
        }
예제 #2
0
        public ScoreDeleter(IAmazonDynamoDB dynamoDbClient, IAmazonS3 s3Client, IScoreQuota scoreQuota, IConfiguration configuration, IScoreCommonLogic commonLogic)
        {
            _dynamoDbClient = dynamoDbClient;
            _s3Client       = s3Client;
            _scoreQuota     = scoreQuota;
            _configuration  = configuration;
            _commonLogic    = commonLogic;


            var tableName = configuration[EnvironmentNames.ScoreDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreDynamoDbTableName}' is not found.");
            }
            ScoreTableName = tableName;


            var scoreItemS3Bucket = configuration[EnvironmentNames.ScoreItemS3Bucket];

            if (string.IsNullOrWhiteSpace(scoreItemS3Bucket))
            {
                throw new InvalidOperationException(
                          $"'{EnvironmentNames.ScoreItemS3Bucket}' is not found.");
            }
            ScoreItemS3Bucket = scoreItemS3Bucket;
        }
예제 #3
0
 public ScoreItemLogics(IScoreQuota scoreQuota, IAmazonDynamoDB dynamoDbClient, IAmazonS3 s3Client, IConfiguration configuration)
 {
     this._scoreQuota     = scoreQuota;
     this._dynamoDbClient = dynamoDbClient;
     _s3Client            = s3Client;
     _configuration       = configuration;
 }
예제 #4
0
 public ScoreLogics(IScoreQuota scoreQuota, IAmazonDynamoDB dynamoDbClient, IAmazonS3 s3Client, IConfiguration configuration)
 {
     _scoreQuota     = scoreQuota;
     _dynamoDbClient = dynamoDbClient;
     _s3Client       = s3Client;
     _configuration  = configuration;
     _commonLogic    = new ScoreCommonLogic();
 }
예제 #5
0
        public ScoreCreator(IAmazonDynamoDB dynamoDbClient, IScoreQuota quota, IConfiguration configuration, IScoreCommonLogic commonLogic)
        {
            _dynamoDbClient = dynamoDbClient;
            _quota          = quota;
            _configuration  = configuration;
            _commonLogic    = commonLogic;

            var tableName = configuration[EnvironmentNames.ScoreDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreDynamoDbTableName}' is not found.");
            }
            ScoreTableName = tableName;
        }
예제 #6
0
        public ScoreItemDatabase(IScoreQuota quota, IAmazonDynamoDB dynamoDbClient, string tableName, string scoreItemRelationTableName)
        {
            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new ArgumentException(nameof(tableName));
            }
            if (string.IsNullOrWhiteSpace(scoreItemRelationTableName))
            {
                throw new ArgumentException(nameof(scoreItemRelationTableName));
            }

            TableName = tableName;
            ScoreItemRelationTableName = scoreItemRelationTableName;
            _quota          = quota;
            _dynamoDbClient = dynamoDbClient;
        }
        public ScoreSnapshotCreator(IAmazonDynamoDB dynamoDbClient, IAmazonS3 s3Client, IScoreQuota quota, IConfiguration configuration)
        {
            _dynamoDbClient = dynamoDbClient;
            _s3Client       = s3Client;
            _quota          = quota;
            _configuration  = configuration;


            var tableName = configuration[EnvironmentNames.ScoreDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreDynamoDbTableName}' is not found.");
            }
            ScoreTableName = tableName;

            var scoreDataTableName = configuration[EnvironmentNames.ScoreLargeDataDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(scoreDataTableName))
            {
                throw new InvalidOperationException(
                          $"'{EnvironmentNames.ScoreItemRelationDynamoDbTableName}' is not found.");
            }
            ScoreDataTableName = scoreDataTableName;

            var scoreItemRelationTableName = configuration[EnvironmentNames.ScoreItemRelationDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(scoreItemRelationTableName))
            {
                throw new InvalidOperationException(
                          $"'{EnvironmentNames.ScoreItemRelationDynamoDbTableName}' is not found.");
            }
            ScoreItemRelationTableName = scoreItemRelationTableName;


            var scoreDataSnapshotS3Bucket = configuration[EnvironmentNames.ScoreDataSnapshotS3Bucket];

            if (string.IsNullOrWhiteSpace(scoreDataSnapshotS3Bucket))
            {
                throw new InvalidOperationException(
                          $"'{EnvironmentNames.ScoreDataSnapshotS3Bucket}' is not found.");
            }
            ScoreDataSnapshotS3Bucket = scoreDataSnapshotS3Bucket;
        }
예제 #8
0
        public ScorePageRemover(IAmazonDynamoDB dynamoDbClient, IScoreQuota scoreQuota, IConfiguration configuration)
        {
            _dynamoDbClient = dynamoDbClient;
            _scoreQuota     = scoreQuota;
            _configuration  = configuration;


            var tableName = configuration[EnvironmentNames.ScoreDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(tableName))
            {
                throw new InvalidOperationException($"'{EnvironmentNames.ScoreDynamoDbTableName}' is not found.");
            }
            ScoreTableName = tableName;

            var scoreItemRelationTableName = configuration[EnvironmentNames.ScoreItemRelationDynamoDbTableName];

            if (string.IsNullOrWhiteSpace(scoreItemRelationTableName))
            {
                throw new InvalidOperationException(
                          $"'{EnvironmentNames.ScoreItemRelationDynamoDbTableName}' is not found.");
            }
            ScoreItemRelationTableName = scoreItemRelationTableName;
        }