@PUT
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/acceleration/settings")
public void saveSystemSettings(final SystemSettingsApiDescriptor descriptor) {
Preconditions.checkArgument(descriptor.getLimit() != null, "limit is required");
Preconditions.checkArgument(descriptor.getLimit() > 0, "limit must be positive");
Preconditions.checkArgument(descriptor.getAccelerateAggregation() != null, "accelerateAggregation is required");
Preconditions.checkArgument(descriptor.getAccelerateRaw() != null, "accelerateRaw is required");
SystemOptionManager optionManager = context.getOptionManager();
optionManager.setOption(OptionValue.createLong(OptionValue.OptionType.SYSTEM, ReflectionOptions.MAX_AUTOMATIC_REFLECTIONS.getOptionName(), descriptor.getLimit()));
optionManager.setOption(OptionValue.createBoolean(OptionValue.OptionType.SYSTEM, ReflectionOptions.ENABLE_AUTOMATIC_AGG_REFLECTIONS.getOptionName(), descriptor.getAccelerateAggregation()));
optionManager.setOption(OptionValue.createBoolean(OptionValue.OptionType.SYSTEM, ReflectionOptions.ENABLE_AUTOMATIC_RAW_REFLECTIONS.getOptionName(), descriptor.getAccelerateRaw()));
if (descriptor.getLayoutRefreshMaxAttempts() != null) {
optionManager.setOption(OptionValue.createLong(OptionValue.OptionType.SYSTEM, ExecConstants.LAYOUT_REFRESH_MAX_ATTEMPTS.getOptionName(), descriptor.getLayoutRefreshMaxAttempts()));
}
}
}