public Response addExperiment(@FormParam("projectName") String projectName,
@FormParam("experimentID") String experimentID,
@FormParam("submittedDate") String submittedDate) {
AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
try {
AiravataExperiment experiment = new AiravataExperiment();
experiment.setExperimentId(experimentID);
Gateway gateway = airavataRegistry.getGateway();
AiravataUser airavataUser = airavataRegistry.getAiravataUser();
experiment.setGateway(gateway);
experiment.setUser(airavataUser);
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date formattedDate = dateFormat.parse(submittedDate);
experiment.setSubmittedDate(formattedDate);
airavataRegistry.addExperiment(projectName, experiment);
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
builder.entity("Experiment added successfully...");
return builder.build();
} catch (ExperimentDoesNotExistsException e) {