Class AppConfigurationController
java.lang.Object
cf.maybelambda.httpvalidator.springboot.controller.AppConfigurationController
Controller for handling configuration updates of the application.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionupdateValidatorDataFile
(org.springframework.web.multipart.MultipartFile file) Updates the validator data file with the contents from the provided multipart file.Updates the validator run schedule based on the provided cron expression.
-
Field Details
-
UPD_RUN_SCHEDULE_ENDPOINT
- See Also:
-
UPD_DATA_FILE_ENDPOINT
- See Also:
-
CRON_EXPRESSION_KEY
- See Also:
-
INVALID_CRON_EXPRESSION_ERROR_MSG
- See Also:
-
INVALID_DATA_FILE_ERROR_MSG
- See Also:
-
UPD_DATA_FILE_ERROR_MSG
- See Also:
-
-
Constructor Details
-
AppConfigurationController
public AppConfigurationController()
-
-
Method Details
-
updateValidatorRunSchedule
@PutMapping("/api/validator/runschedule") public org.springframework.http.ResponseEntity<Map<String,String>> updateValidatorRunSchedule(@RequestBody Map<String, String> body) Updates the validator run schedule based on the provided cron expression. Returns bad request status with error message for invalid expression.- Parameters:
body
- The request body containing the cron expression.- Returns:
- ResponseEntity indicating success or failure of the update operation.
-
updateValidatorDataFile
@PutMapping("/api/validator/datafile") public org.springframework.http.ResponseEntity<Map<String,String>> updateValidatorDataFile(@RequestBody org.springframework.web.multipart.MultipartFile file) Updates the validator data file with the contents from the provided multipart file. Returns internal server error status with error message for data file update failure (IO error). Returns bad request status with error message for invalid data file.- Parameters:
file
- The multipart file containing the updated data.- Returns:
- ResponseEntity indicating success or failure of the update operation.
-