LOGGER.info("event=EXPERIMENT_METADATA_CHANGE, message=EXPERIMENT_CREATED, applicationName={}, configuration={}",newExperiment.getApplicationName(),newExperiment);
final String authorizationHeader) { try { if (newExperiment.getApplicationName() == null || isBlank(newExperiment.getApplicationName().toString())) { throw new IllegalArgumentException("Experiment application name cannot be null or an empty string"); authorization.checkUserPermissions(userName, newExperiment.getApplicationName(), CREATE);
/** * {@inheritDoc} */ // TODO - Why is this method is on the interface - if the client does not call it, the indices will be inconsistent ? @Override public void createIndicesForNewExperiment(NewExperiment newExperiment) { // Point the experiment index to this experiment LOGGER.debug("Create indices for new experiment Experiment {}", newExperiment); updateExperimentLabelIndex(newExperiment.getID(), newExperiment.getApplicationName(), newExperiment.getLabel(), newExperiment.getStartTime(), newExperiment.getEndTime(), State.DRAFT); try { updateStateIndex(newExperiment.getID(), ExperimentState.NOT_DELETED); } catch (Exception e) { LOGGER.error("Create indices for new experiment Experiment {} failed", newExperiment, e); // remove the created ExperimentLabelIndex removeExperimentLabelIndex(newExperiment.getApplicationName(), newExperiment.getLabel()); throw new RepositoryException("Could not update indices for experiment \"" + newExperiment + "\"", e); } }
DRAFT.name(), newExperiment.getLabel().toString(), newExperiment.getApplicationName().toString(), NOW, NOW, batchStmt.add(applicationListAccessor.insert(newExperiment.getApplicationName().toString())); batchStmt.add(updateExperimentTags(newExperiment.getApplicationName(), newExperiment.getId(), newExperiment.getTags())); batchStmt.add(prioritiesAccessor.appendToPriorities(newArrayList(newExperiment.getId().getRawID()), newExperiment.getApplicationName().toString())); newExperiment.getStartTime(), newExperiment.getEndTime(), DRAFT.name(), newExperiment.getApplicationName().toString(), newExperiment.getLabel().toString()));
newExperiment.getStartTime(), newExperiment.getEndTime(), newExperiment.getApplicationName().toString(), State.DRAFT.toString()); return newExperiment.getID();