public Response changeSchedulerStatus(@QueryParam(SchedulerJobApiConstants.COMMAND) final String commandParam) {
// check the logged in user have permissions to update scheduler status
final boolean hasNotPermission = this.context.authenticatedUser().hasNotPermissionForAnyOf("ALL_FUNCTIONS", "UPDATE_SCHEDULER");
if (hasNotPermission) {
final String authorizationMessage = "User has no authority to update scheduler status";
throw new NoAuthorizationException(authorizationMessage);
}
Response response = Response.status(400).build();
if (is(commandParam, SchedulerJobApiConstants.COMMAND_START_SCHEDULER)) {
this.jobRegisterService.startScheduler();
response = Response.status(202).build();