JsonNode bodyJson= body.asJson();
JsonNode newDBAlert = bodyJson.get(BBConfiguration.DB_ALERT_THRESHOLD);
JsonNode newDBSize = bodyJson.get(BBConfiguration.DB_SIZE_THRESHOLD);
try{
if (newDBAlert!=null && !newDBAlert.isInt() && newDBAlert.asInt()<1) throw new IllegalArgumentException(BBConfiguration.DB_ALERT_THRESHOLD + " must be a positive integer value");
if (newDBSize!=null && !newDBSize.isLong() && newDBSize.asInt()<0) throw new IllegalArgumentException(BBConfiguration.DB_SIZE_THRESHOLD + " must be a positive integer value, or 0 to disable it");
}catch (Throwable e){
return badRequest(e.getMessage());
}
if (newDBAlert!=null) BBConfiguration.setDBAlertThreshold(newDBAlert.asInt());
if (newDBSize!=null) BBConfiguration.setDBSizeThreshold(BigInteger.valueOf(newDBSize.asLong()));