private static JobListenerType map(final org.tuxdevelop.spring.batch.lightmin.api.resource.admin.JobListenerType jobListenerType) { final JobListenerType response; switch (jobListenerType) { case LOCAL_FOLDER_LISTENER: response = JobListenerType.LOCAL_FOLDER_LISTENER; break; default: throw new SpringBatchLightminApplicationException("Unknown JobListenerType: " + jobListenerType); } return response; }
private static JobListenerType map(final org.tuxdevelop.spring.batch.lightmin.domain.JobListenerType jobListenerType) { final JobListenerType response; switch (jobListenerType) { case LOCAL_FOLDER_LISTENER: response = JobListenerType.LOCAL_FOLDER_LISTENER; break; default: throw new SpringBatchLightminApplicationException("Unknown JobListenerType: " + jobListenerType); } return response; }
private static JobListenerType map(final org.tuxdevelop.spring.batch.lightmin.api.resource.admin.JobListenerType jobListenerType) { final JobListenerType response; switch (jobListenerType) { case LOCAL_FOLDER_LISTENER: response = JobListenerType.LOCAL_FOLDER_LISTENER; break; default: throw new SpringBatchLightminApplicationException("Unknown JobListenerType: " + jobListenerType); } return response; }
private void validateJobConfigurationBody(final JobConfiguration jobConfiguration) { if (jobConfiguration == null) { throw new SpringBatchLightminApplicationException("jobConfiguration must not be null"); } } }
private static JobListenerType map(final org.tuxdevelop.spring.batch.lightmin.domain.JobListenerType jobListenerType) { final JobListenerType response; switch (jobListenerType) { case LOCAL_FOLDER_LISTENER: response = JobListenerType.LOCAL_FOLDER_LISTENER; break; default: throw new SpringBatchLightminApplicationException("Unknown JobListenerType: " + jobListenerType); } return response; }
void throwExceptionAndLogError(final String message) { log.error(message); throw new SpringBatchLightminApplicationException(message); } }
static Date castDate(final Object input) { final Date date; if (input instanceof Date) { date = (Date) input; } else if (input instanceof Long) { date = new Date((Long) input); } else { throw new SpringBatchLightminApplicationException("could not parse date for input class " + input.getClass()); } return date; } }
@Override public void stopJobExecution(final Long jobExecutionId) { try { this.jobOperator.stop(jobExecutionId); } catch (final Exception e) { throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
private void checkHttpOk(final ResponseEntity<?> responseEntity) { if (!HttpStatus.OK.equals(responseEntity.getStatusCode())) { final String errorMessage = "ERROR - HTTP STATUS: " + responseEntity.getStatusCode(); throw new SpringBatchLightminApplicationException(errorMessage); } }
private void checkHttpOk(final ResponseEntity<?> responseEntity) { if (!HttpStatus.OK.equals(responseEntity.getStatusCode())) { final String errorMessage = "ERROR - HTTP STATUS: " + responseEntity.getStatusCode(); throw new SpringBatchLightminApplicationException(errorMessage); } }
@Override public void restartJobExecution(final Long jobExecutionId) { try { this.jobOperator.restart(jobExecutionId); } catch (final Exception e) { throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
private void evaluateReponse(final ResponseEntity<?> responseEntity, final HttpStatus expectedStatus) { if (!expectedStatus.equals(responseEntity.getStatusCode())) { throw new SpringBatchLightminApplicationException("Could not execute remote call HttpStatusCode: " + responseEntity.getStatusCode()); } }
public static void checkHttpOk(final ResponseEntity<?> responseEntity) { if (!HttpStatus.OK.equals(responseEntity.getStatusCode())) { final String errorMessage = "ERROR - HTTP STATUS: " + responseEntity.getStatusCode(); throw new SpringBatchLightminApplicationException(errorMessage); } else { log.debug("Response {} ok", responseEntity); } } }
private void evaluateReponse(final ResponseEntity<?> responseEntity, final HttpStatus expectedStatus) { if (!expectedStatus.equals(responseEntity.getStatusCode())) { throw new SpringBatchLightminApplicationException("Could not execute remote call HttpStatusCode: " + responseEntity.getStatusCode()); } }
@Override public void restartJobExecution(final Long jobExecutionId) { try { this.jobOperator.restart(jobExecutionId); } catch (final Exception e) { throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
@Override public void stopJobExecution(final Long jobExecutionId) { try { this.jobOperator.stop(jobExecutionId); } catch (final Exception e) { throw new SpringBatchLightminApplicationException(e, e.getMessage()); } }
public static void checkHttpOk(final ResponseEntity<?> responseEntity) { if (!HttpStatus.OK.equals(responseEntity.getStatusCode())) { final String errorMessage = "ERROR - HTTP STATUS: " + responseEntity.getStatusCode(); throw new SpringBatchLightminApplicationException(errorMessage); } else { log.debug("Response {} ok", responseEntity); } } }
public static TaskExecutorType getById(final Long id) { final TaskExecutorType type; if (SYNCHRONOUS.getId().equals(id)) { type = SYNCHRONOUS; } else if (ASYNCHRONOUS.getId().equals(id)) { type = ASYNCHRONOUS; } else { throw new SpringBatchLightminApplicationException("Unknown TaskExecutorType for id: " + id); } return type; } }
public static ListenerStatus getByValue(final String value) { final ListenerStatus listenerStatus; if (ACTIVE.getValue().equals(value)) { listenerStatus = ACTIVE; } else if (STOPPED.getValue().equals(value)) { listenerStatus = STOPPED; } else { throw new SpringBatchLightminApplicationException("Unknown ListenerStatus : " + value); } return listenerStatus; } }
public static JobIncrementer getByIdentifier(final String incrementerIdentifier) { final JobIncrementer jobIncrementer; if (JobIncrementer.DATE.getIncrementerIdentifier().equals(incrementerIdentifier)) { jobIncrementer = DATE; } else if (JobIncrementer.NONE.getIncrementerIdentifier().equals(incrementerIdentifier)) { jobIncrementer = NONE; } else { throw new SpringBatchLightminApplicationException( "Unknown JobIncrementer for identifier: " + incrementerIdentifier); } return jobIncrementer; } }