@Test public void testValidate() { ReclaimerConfig config = new AWSReclaimerConfig() .setTableName("Table") .setIdFieldName("id") .setTimeFieldName("timeField"); Assert.assertNull(config.validate()); }
@Override public String validate() { String superValidationResult = super.validate(); List<String> validationIssues = new LinkedList<>(); if(StringUtils.isBlank(tableName)) validationIssues.add("tableName must be specified"); if(StringUtils.isBlank(idFieldName)) validationIssues.add("idFieldName must be specified"); if(StringUtils.isBlank(timeFieldName)) validationIssues.add("timeFieldName must be specified"); if(reclaimAgeMinutes < 0) validationIssues.add("reclaimAgeMinutes must be non-negative"); if(scanDelayMillis < 0) validationIssues.add("scanDelayMillis must be non-negative"); if(targetBatchSize < 1) validationIssues.add("targetBatchSize must be 1 or more"); if(objectScanLimit < 1) validationIssues.add("objectScanLimit must be 1 or more"); String result = validationIssues.size() == 0 ? null : String.join(",", validationIssues); if(superValidationResult == null && result == null) return null; if(superValidationResult == null) return result; return String.join(",", superValidationResult, result); }
AWSReclaimerConfig extends ReclaimerConfig { @Override public String validate() { String superValidationResult = super.validate(); List<String> validationIssues = new LinkedList<>(); if(StringUtils.isBlank(tableName)) validationIssues.add("tableName must be specified"); if(StringUtils.isBlank(idFieldName)) validationIssues.add("idFieldName must be specified"); if(StringUtils.isBlank(timeFieldName)) validationIssues.add("timeFieldName must be specified"); if(reclaimAgeMinutes < 0) validationIssues.add("reclaimAgeMinutes must be non-negative"); if(scanDelayMillis < 0) validationIssues.add("scanDelayMillis must be non-negative"); if(targetBatchSize < 1) validationIssues.add("targetBatchSize must be 1 or more"); if(objectScanLimit < 1) validationIssues.add("objectScanLimit must be 1 or more"); String result = validationIssues.size() == 0 ? null : String.join(",", validationIssues); if(superValidationResult == null && result == null) return null; if(superValidationResult == null) return result; return String.join(",", superValidationResult, result); } }
AWSReclaimerConfig extends ReclaimerConfig { @Override public String validate() { String superValidationResult = super.validate(); List<String> validationIssues = new LinkedList<>(); if(StringUtils.isBlank(tableName)) validationIssues.add("tableName must be specified"); if(StringUtils.isBlank(idFieldName)) validationIssues.add("idFieldName must be specified"); if(StringUtils.isBlank(timeFieldName)) validationIssues.add("timeFieldName must be specified"); if(reclaimAgeMinutes < 0) validationIssues.add("reclaimAgeMinutes must be non-negative"); if(scanDelayMillis < 0) validationIssues.add("scanDelayMillis must be non-negative"); if(targetBatchSize < 1) validationIssues.add("targetBatchSize must be 1 or more"); if(objectScanLimit < 1) validationIssues.add("objectScanLimit must be 1 or more"); String result = validationIssues.size() == 0 ? null : String.join(",", validationIssues); if(superValidationResult == null && result == null) return null; if(superValidationResult == null) return result; return String.join(",", superValidationResult, result); }  }
AWSReclaimerConfig extends ReclaimerConfig { @Override public String validate() { String superValidationResult = super.validate(); List<String> validationIssues = new LinkedList<>(); if(StringUtils.isBlank(tableName)) validationIssues.add("tableName must be specified"); if(StringUtils.isBlank(idFieldName)) validationIssues.add("idFieldName must be specified"); if(StringUtils.isBlank(timeFieldName)) validationIssues.add("timeFieldName must be specified"); if(reclaimAgeMinutes < 0) validationIssues.add("reclaimAgeMinutes must be non-negative"); if(scanDelayMillis < 0) validationIssues.add("scanDelayMillis must be non-negative"); if(targetBatchSize < 1) validationIssues.add("targetBatchSize must be 1 or more"); if(objectScanLimit < 1) validationIssues.add("objectScanLimit must be 1 or more"); String result = validationIssues.size() == 0 ? null : String.join(",", validationIssues); if(superValidationResult == null && result == null) return null; if(superValidationResult == null) return result; return String.join(",", superValidationResult, result); }  String getTableName(); AWSReclaimerConfig setTableName(String tableName); String getIdFieldName(); AWSReclaimerConfig setIdFieldName(String idFieldName); String getTimeFieldName(); AWSReclaimerConfig setTimeFieldName(String timeFieldName); int getReclaimAgeMinutes(); AWSReclaimerConfig setReclaimAgeMinutes(int reclaimAgeMinutes); long getScanDelayMillis(); AWSReclaimerConfig setScanDelayMillis(long scanDelayMillis); int getTargetBatchSize(); AWSReclaimerConfig setTargetBatchSize(int targetBatchSize); int getObjectScanLimit(); AWSReclaimerConfig setObjectScanLimit(int objectScanLimit); @Override String validate(); }
AWSReclaimerConfig extends ReclaimerConfig { @Override public String validate() { String superValidationResult = super.validate(); List<String> validationIssues = new LinkedList<>(); if(StringUtils.isBlank(tableName)) validationIssues.add("tableName must be specified"); if(StringUtils.isBlank(idFieldName)) validationIssues.add("idFieldName must be specified"); if(StringUtils.isBlank(timeFieldName)) validationIssues.add("timeFieldName must be specified"); if(reclaimAgeMinutes < 0) validationIssues.add("reclaimAgeMinutes must be non-negative"); if(scanDelayMillis < 0) validationIssues.add("scanDelayMillis must be non-negative"); if(targetBatchSize < 1) validationIssues.add("targetBatchSize must be 1 or more"); if(objectScanLimit < 1) validationIssues.add("objectScanLimit must be 1 or more"); String result = validationIssues.size() == 0 ? null : String.join(",", validationIssues); if(superValidationResult == null && result == null) return null; if(superValidationResult == null) return result; return String.join(",", superValidationResult, result); }  String getTableName(); AWSReclaimerConfig setTableName(String tableName); String getIdFieldName(); AWSReclaimerConfig setIdFieldName(String idFieldName); String getTimeFieldName(); AWSReclaimerConfig setTimeFieldName(String timeFieldName); int getReclaimAgeMinutes(); AWSReclaimerConfig setReclaimAgeMinutes(int reclaimAgeMinutes); long getScanDelayMillis(); AWSReclaimerConfig setScanDelayMillis(long scanDelayMillis); int getTargetBatchSize(); AWSReclaimerConfig setTargetBatchSize(int targetBatchSize); int getObjectScanLimit(); AWSReclaimerConfig setObjectScanLimit(int objectScanLimit); @Override String validate();  }