}
private void validateConfig(DiskQuotaConfig quotaConfig) throws ConfigurationException {
int cacheCleanUpFrequency = quotaConfig.getCacheCleanUpFrequency();
if (cacheCleanUpFrequency <= 0) {
throw new ConfigurationException("cacheCleanUpFrequency shall be a positive integer");
}
TimeUnit cacheCleanUpUnits = quotaConfig.getCacheCleanUpUnits();
if (cacheCleanUpUnits == null) {
throw new ConfigurationException(
"cacheCleanUpUnits shall be specified. Expected one of SECONDS, MINUTES, HOURS, DAYS. Got null");
}
int diskBlockSize = quotaConfig.getDiskBlockSize();
if (diskBlockSize <= 0) {
throw new ConfigurationException(
"Disk block size shall be specified and be a positive integer");
}
int maxConcurrentCleanUps = quotaConfig.getMaxConcurrentCleanUps();
if (maxConcurrentCleanUps <= 0) {
throw new ConfigurationException(
"maxConcurrentCleanUps shall be specified as a positive integer");
}
if (null != quotaConfig.getLayerQuotas()) {
for (LayerQuota lq : new ArrayList<LayerQuota>(quotaConfig.getLayerQuotas())) {