Package org.apache.airavata.persistance.registry.jpa.resources

Examples of org.apache.airavata.persistance.registry.jpa.resources.ProjectResource


        } else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkspaceProjectExists(project.getProjectName())){
                throw new WorkspaceProjectAlreadyExistsException(createProjName(project.getProjectName()));
            }
            ProjectResource projectResource = worker.createProject(createProjName(project.getProjectName()));
            projectResource.save();
        }
    }
View Full Code Here


        }else {
            WorkerResource worker = jpa.getWorker();
            if (!isWorkspaceProjectExists(project.getProjectName())){
                throw new WorkspaceProjectDoesNotExistsException(createProjName(project.getProjectName()));
            }
            ProjectResource projectResource = worker.getProject(createProjName(project.getProjectName()));
            projectResource.save();
        }
    }
View Full Code Here

        }
      WorkerResource worker = jpa.getWorker();
    if (!isWorkspaceProjectExists(projectName)){
          throw new WorkspaceProjectDoesNotExistsException(createProjName(projectName));
        }
    ProjectResource projectResource = worker.getProject(createProjName(projectName));
    return new WorkspaceProject(getProjName(projectResource.getName()), this);
    }
View Full Code Here

    public void addExperiment(String projectName, AiravataExperiment experiment) throws RegistryException {
      if (projectsRegistry != null){
            projectsRegistry.addExperiment(projectName, experiment);
        }else {
            WorkspaceProject workspaceProject = getWorkspaceProject(projectName);
            ProjectResource project = jpa.getWorker().getProject(createProjName(workspaceProject.getProjectName()));
            String experimentId = experiment.getExperimentId();
            if (isExperimentExists(experimentId)){
                throw new ExperimentDoesNotExistsException(experimentId);
            }
            ExperimentResource experimentResource = project.createExperiment(experimentId);
            if (experiment.getSubmittedDate()!=null) {
                experimentResource.setSubmittedDate(new Timestamp(experiment.getSubmittedDate().getTime()));
            }
            experimentResource.save();
        }
View Full Code Here

    public List<AiravataExperiment> getExperiments(String projectName)throws RegistryException {
        if (projectsRegistry != null){
            return projectsRegistry.getExperiments(projectName);
        }
        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);
    }
View Full Code Here

                UserResource user = ResourceUtils.createUser(ServerSettings.getSystemUser(), ServerSettings.getSystemUserPassword());
                user.save();
                WorkerResource workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
                workerResource.setUser(user.getUserName());
                workerResource.save();
                ProjectResource projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
                projectResource.setName(DEFAULT_PROJECT_NAME);
                projectResource.setGateway(gateway);
                projectResource.save();
            } catch (ApplicationSettingsException e) {
                logger.error("Unable to read airavata-server properties...", e.getMessage());
            }
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
View Full Code Here

                UserResource user = ResourceUtils.createUser(ServerSettings.getSystemUser(), ServerSettings.getSystemUserPassword());
                user.save();
                WorkerResource workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
                workerResource.setUser(user.getUserName());
                workerResource.save();
                ProjectResource projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
                projectResource.setName(DEFAULT_PROJECT_NAME);
                projectResource.setGateway(gateway);
                projectResource.save();
            } catch (ApplicationSettingsException e) {
                logger.error("Unable to read airavata-server properties...", e.getMessage());
            }
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
View Full Code Here

            WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
            workerResource.setUser(userResource.getUserName());
            workerResource.save();
           
            ProjectResource projectResource = (ProjectResource)workerResource.create(ResourceType.PROJECT);
            projectResource.setGateway(gatewayResource);
            projectResource.setId("default");
            projectResource.setName("default");
            projectResource.setWorker(workerResource);
            projectResource.save();
       
         
        } catch (RegistrySettingsException e) {
            logger.error("Unable to read properties", e);
        } catch (RegistryException e) {
View Full Code Here

        } else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkspaceProjectExists(project.getProjectName())){
                throw new WorkspaceProjectAlreadyExistsException(createProjName(project.getProjectName()));
            }
            ProjectResource projectResource = worker.createProject(createProjName(project.getProjectName()));
            projectResource.save();
        }
    }
View Full Code Here

        }else {
            WorkerResource worker = jpa.getWorker();
            if (!isWorkspaceProjectExists(project.getProjectName())){
                throw new WorkspaceProjectDoesNotExistsException(createProjName(project.getProjectName()));
            }
            ProjectResource projectResource = worker.getProject(createProjName(project.getProjectName()));
            projectResource.save();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.resources.ProjectResource

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.