@Override public void validate(ConfigProblemSetBuilder p, AwsCanaryServiceIntegration n) { if (n.isS3Enabled()) { List<AwsCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one AWS account must specify a bucket if S3 is enabled."); } } } }
@Override public void validate(ConfigProblemSetBuilder p, AwsCanaryServiceIntegration n) { if (n.isS3Enabled()) { List<AwsCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one AWS account must specify a bucket if S3 is enabled."); } } } }
@Override protected AbstractCanaryAccount editAccount(AwsCanaryAccount account) { account.setBucket(isSet(bucket) ? bucket : account.getBucket()); account.setRegion(isSet(region) ? region : account.getRegion()); account.setRootFolder(isSet(rootFolder) ? rootFolder : account.getRootFolder()); account.setProfileName(isSet(profileName) ? profileName : account.getProfileName()); account.setEndpoint(isSet(endpoint) ? endpoint : account.getEndpoint()); account.setAccessKeyId(isSet(accessKeyId) ? accessKeyId : account.getAccessKeyId()); account.setSecretAccessKey(isSet(secretAccessKey) ? secretAccessKey : account.getSecretAccessKey()); return account; } }
@Override protected AbstractCanaryAccount editAccount(AwsCanaryAccount account) { account.setBucket(isSet(bucket) ? bucket : account.getBucket()); account.setRegion(isSet(region) ? region : account.getRegion()); account.setRootFolder(isSet(rootFolder) ? rootFolder : account.getRootFolder()); account.setProfileName(isSet(profileName) ? profileName : account.getProfileName()); account.setEndpoint(isSet(endpoint) ? endpoint : account.getEndpoint()); account.setAccessKeyId(isSet(accessKeyId) ? accessKeyId : account.getAccessKeyId()); account.setSecretAccessKey(isSet(secretAccessKey) ? secretAccessKey : account.getSecretAccessKey()); return account; } }