Source:
private void notify(AbstractBackupPath abp, String uploadStatus) { JSONObject jsonObject = new JSONObject(); try { if (notifiedBackupFileTypesSet.isEmpty() || notifiedBackupFileTypesSet.contains(abp.getType())) { jsonObject.put("s3bucketname", this.config.getBackupPrefix()); jsonObject.put("s3clustername", abp.getClusterName()); jsonObject.put("s3namespace", abp.getRemotePath()); jsonObject.put("keyspace", abp.getKeyspace()); jsonObject.put("cf", abp.getColumnFamily()); jsonObject.put("region", abp.getRegion()); jsonObject.put("rack", instanceInfo.getRac()); jsonObject.put("token", abp.getToken()); jsonObject.put("filename", abp.getFileName()); jsonObject.put("uncompressfilesize", abp.getSize()); jsonObject.put("compressfilesize", abp.getCompressedFileSize()); jsonObject.put("backuptype", abp.getType().name()); jsonObject.put("uploadstatus", uploadStatus); jsonObject.put("compression", abp.getCompression().name()); jsonObject.put("encryption", abp.getEncryption().name()); Map<String, MessageAttributeValue> messageAttributes = getMessageAttributes(abp.getType()); this.notificationService.notify(jsonObject.toString(), messageAttributes); } else { logger.info( "BackupFileType is not in the list of notified component types {}", abp.getType().name(), StringUtils.join(notifiedBackupFileTypesSet, ", ")); } } catch (JSONException exception) { logger.error( "JSON exception during generation of notification for upload {}. Local file {}. Ignoring to continue with rest of backup. Msg: {}", uploadStatus, abp.getFileName(), exception.getLocalizedMessage()); } }

Target:
private void notify(AbstractBackupPath abp, String uploadStatus) { JSONObject jsonObject = new JSONObject(); try { Set<AbstractBackupPath.BackupFileType> updatedNotifiedBackupFileTypeSet = getUpdatedNotifiedBackupFileTypesSet(this.notifiedBackupFileTypes); if (updatedNotifiedBackupFileTypeSet.isEmpty() || updatedNotifiedBackupFileTypeSet.contains(abp.getType())) { jsonObject.put("s3bucketname", this.config.getBackupPrefix()); jsonObject.put("s3clustername", abp.getClusterName()); jsonObject.put("s3namespace", abp.getRemotePath()); jsonObject.put("keyspace", abp.getKeyspace()); jsonObject.put("cf", abp.getColumnFamily()); jsonObject.put("region", abp.getRegion()); jsonObject.put("rack", instanceInfo.getRac()); jsonObject.put("token", abp.getToken()); jsonObject.put("filename", abp.getFileName()); jsonObject.put("uncompressfilesize", abp.getSize()); jsonObject.put("compressfilesize", abp.getCompressedFileSize()); jsonObject.put("backuptype", abp.getType().name()); jsonObject.put("uploadstatus", uploadStatus); jsonObject.put("compression", abp.getCompression().name()); jsonObject.put("encryption", abp.getEncryption().name()); Map<String, MessageAttributeValue> messageAttributes = getMessageAttributes(abp.getType()); this.notificationService.notify(jsonObject.toString(), messageAttributes); } else { logger.debug( "BackupFileType is not in the list of notified component types {}", abp.getType().name(), StringUtils.join(notifiedBackupFileTypesSet, ", ")); } } catch (JSONException exception) { logger.error( "JSON exception during generation of notification for upload {}. Local file {}. Ignoring to continue with rest of backup. Msg: {}", uploadStatus, abp.getFileName(), exception.getLocalizedMessage()); } }