Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Create BucketS3 channelTag.json.
- * Log the error if json cannot be created to the S3 location
- *
- * @param awsClient S3 bucket builder
- * @param channelTag The channel name in tag-version (eg.I1,C5,R4)
- * @param content NowNextResponse the now&next content of the channel
- * @param tID current transaction ID
- * @log error on saving fail, nothing otherwise
- * @see AmazonS3
- * @see NowNextResponse
- */
- private void saveNowNextChannelFile(AmazonS3 awsClient, String channelTag, NowNextResponse content, String tID){
- String S3jsonName = StringFormatter.format(StringFormatter.PLACEHOLDER_DIGITS, NOW_NEXT_BUCKET_CHANNEL_KEY, channelTag);
- NowNextResult nowNextResult = new NowNextResult("NowNextTask", true, tID, content);
- //TODO to change
- try {
- if(!S3Manager.uploadFile( awsClient, configuration.getAwsS3Env(), configuration.getAwsS3BucketNameShare(), S3jsonName, JSONHelper.stringify(nowNextResult), configuration.getCacheControl() ))
- log.error("Error during updating json on S3 bucket.");
- if (configuration.isNowNextDuplicationEnabled()) {
- S3jsonName = StringUtils.substring(S3jsonName, S3jsonName.indexOf('/') + 1);
- if(!S3Manager.uploadFile( awsClient, configuration.getAwsS3Env(), configuration.getAwsS3BucketNameShare(), S3jsonName, JSONHelper.stringify(nowNextResult), configuration.getCacheControl() ))
- log.error("Error during updating json on S3 bucket.");
- }
- }catch(IOException e) {
- log.error("Error during building json from SchedulerNowNextResult.", e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement