Package org.apache.airavata.registry.api

Examples of org.apache.airavata.registry.api.AiravataExperiment


    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) {
View Full Code Here


  @Override
  public void addExperiment(String projectName, String experimentId, String experimentName)
      throws AiravataAPIInvocationException {
    try {
      AiravataExperiment experiment = new AiravataExperiment();
      experiment.setExperimentId(experimentId);
      getClient().getRegistryClient().addExperiment(projectName, experiment);
      getClient().getRegistryClient().updateExperimentName(experimentId, experimentName);
    } catch (Exception e) {
      throw new AiravataAPIInvocationException(e);
   
View Full Code Here

  @Override
  public void addExperiment(String projectName, String experimentId, String experimentName)
      throws AiravataAPIInvocationException {
    try {
      AiravataExperiment experiment = new AiravataExperiment();
      experiment.setExperimentId(experimentId);
      getClient().getRegistryClient().addExperiment(projectName, experiment);
      getClient().getRegistryClient().updateExperimentName(experimentId, experimentName);
    } catch (Exception e) {
      throw new AiravataAPIInvocationException(e);
   
View Full Code Here

  @Override
  public void addExperiment(String projectName, String experimentId, String experimentName)
      throws AiravataAPIInvocationException {
    try {
      AiravataExperiment experiment = new AiravataExperiment();
      experiment.setExperimentId(experimentId);
      getClient().getRegistry().addExperiment(projectName, experiment);
      getClient().getRegistry().updateExperimentName(experimentId, experimentName);
    } catch (RegistryException e) {
      throw new AiravataAPIInvocationException(e);
   
View Full Code Here

    public List<AiravataExperiment> getExperiments() throws RegistryException{
      WorkerResource worker = jpa.getWorker();
      List<AiravataExperiment> result=new ArrayList<AiravataExperiment>();
      List<ExperimentResource> experiments = worker.getExperiments();
      for (ExperimentResource resource : experiments) {
      AiravataExperiment e = createAiravataExperimentObj(resource);
      result.add(e);
    }
        return result;
    }
View Full Code Here

        return result;
    }

  private AiravataExperiment createAiravataExperimentObj(
      ExperimentResource resource) {
    AiravataExperiment e = new AiravataExperiment();
    e.setExperimentId(resource.getExpID());
    e.setUser(new AiravataUser(resource.getWorker().getUser()));
    e.setSubmittedDate(new Date(resource.getSubmittedDate().getTime()));
    e.setGateway(new Gateway(resource.getGateway().getGatewayName()));
    e.setProject(new WorkspaceProject(getProjName(resource.getProject().getName()), this));
    return e;
  }
View Full Code Here

    public List<AiravataExperiment> getExperiments(String projectName)throws RegistryException {
      ProjectResource project = jpa.getWorker().getProject(createProjName(projectName));
      List<ExperimentResource> experiments = project.getExperiments();
      List<AiravataExperiment> result=new ArrayList<AiravataExperiment>();
      for (ExperimentResource resource : experiments) {
      AiravataExperiment e = createAiravataExperimentObj(resource);
      result.add(e);
    }
        return result;
    }
View Full Code Here

      return true;
    }else if (createIfNotPresent){
      if (!isWorkspaceProjectExists(DEFAULT_PROJECT_NAME, true)){
        throw new WorkspaceProjectDoesNotExistsException(createProjName(DEFAULT_PROJECT_NAME));
      }
      AiravataExperiment experiment = new AiravataExperiment();
      experiment.setExperimentId(experimentId);
      experiment.setSubmittedDate(Calendar.getInstance().getTime());
      experiment.setGateway(getGateway());
      experiment.setUser(getUser());
      addExperiment(DEFAULT_PROJECT_NAME, experiment);
      return jpa.getWorker().isExperimentExists(experimentId);
    }else{
      return false;
    }
View Full Code Here

        }
        WorkerResource worker = jpa.getWorker();
      List<AiravataExperiment> result=new ArrayList<AiravataExperiment>();
      List<ExperimentResource> experiments = worker.getExperiments();
      for (ExperimentResource resource : experiments) {
      AiravataExperiment e = createAiravataExperimentObj(resource);
      result.add(e);
    }
        return result;
    }
View Full Code Here

        return result;
    }

  private AiravataExperiment createAiravataExperimentObj(
      ExperimentResource resource) {
    AiravataExperiment e = new AiravataExperiment();
    e.setExperimentId(resource.getExpID());
    e.setUser(new AiravataUser(resource.getWorker().getUser()));
    e.setSubmittedDate(new Date(resource.getSubmittedDate().getTime()));
    e.setGateway(new Gateway(resource.getGateway().getGatewayName()));
    e.setProject(new WorkspaceProject(getProjName(resource.getProject().getName()), this));
    return e;
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.AiravataExperiment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.