Examples of GatewayResource


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

    public ApplicationDescription getApplicationDescriptors(String serviceName, String hostname) throws RegistryException {
        if (descriptorRegistry != null){
            return descriptorRegistry.getApplicationDescriptors(serviceName, hostname);
        }
        GatewayResource gateway = jpa.getGateway();
    List<ApplicationDescriptorResource> applicationDescriptorResources = gateway.getApplicationDescriptorResources(serviceName, hostname);
    if (applicationDescriptorResources.size()>0){
      return createApplicationDescriptor(applicationDescriptorResources.get(0));
    }
    return null;
    }
View Full Code Here

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

    public Map<String, ApplicationDescription> getApplicationDescriptors(String serviceName) throws RegistryException {
        if (descriptorRegistry != null){
            return descriptorRegistry.getApplicationDescriptors(serviceName);
        }
        GatewayResource gateway = jpa.getGateway();
    Map<String, ApplicationDescription> map=new HashMap<String,ApplicationDescription>();
    List<ApplicationDescriptorResource> applicationDescriptorResources = gateway.getApplicationDescriptorResources(serviceName, null);
    for (ApplicationDescriptorResource resource : applicationDescriptorResources) {
      map.put(resource.getHostDescName(),createApplicationDescriptor(resource));
    }
    return map;
    }
View Full Code Here

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

    public Map<String[],ApplicationDescription> getApplicationDescriptors()throws MalformedDescriptorException, RegistryException{
        if (descriptorRegistry != null){
            return descriptorRegistry.getApplicationDescriptors();
        }
        GatewayResource gateway = jpa.getGateway();
    Map<String[], ApplicationDescription> map=new HashMap<String[],ApplicationDescription>();
    List<ApplicationDescriptorResource> applicationDescriptorResources = gateway.getApplicationDescriptorResources();
    for (ApplicationDescriptorResource resource : applicationDescriptorResources) {
      map.put(new String[]{resource.getServiceDescName(),resource.getHostDescName()},createApplicationDescriptor(resource));
    }
    return map;
    }
View Full Code Here

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

    public void removeApplicationDescriptor(String serviceName, String hostName, String applicationName) throws RegistryException {
        if (descriptorRegistry != null){
             descriptorRegistry.removeApplicationDescriptor(serviceName, hostName, applicationName);
        } else {
            GatewayResource gateway = jpa.getGateway();
            String appName = createAppName(serviceName, hostName, applicationName);
            if (!isApplicationDescriptorExists(serviceName,hostName,applicationName)){
                throw new DescriptorDoesNotExistsException(appName);
            }
            gateway.removeApplicationDescriptor(appName);
        }

    }
View Full Code Here

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

    public void publishWorkflow(String workflowName, String publishWorkflowName) throws RegistryException {
        if (publishedWorkflowRegistry != null){
            publishedWorkflowRegistry.publishWorkflow(workflowName, publishWorkflowName);
        } else {
            GatewayResource gateway = jpa.getGateway();
            String workflowGraphXML = getWorkflowGraphXML(workflowName);
            if (gateway.isPublishedWorkflowExists(publishWorkflowName)){
                throw new PublishedWorkflowAlreadyExistsException(publishWorkflowName);
            }
            PublishWorkflowResource publishedWorkflow = gateway.createPublishedWorkflow(publishWorkflowName);
            publishedWorkflow.setCreatedUser(getUser().getUserName());
            publishedWorkflow.setContent(workflowGraphXML);
            publishedWorkflow.setPublishedDate(new Timestamp(Calendar.getInstance().getTime().getTime()));
            publishedWorkflow.save();
        }
View Full Code Here

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

    public String getPublishedWorkflowGraphXML(String workflowName) throws RegistryException {
        if (publishedWorkflowRegistry != null){
            return publishedWorkflowRegistry.getPublishedWorkflowGraphXML(workflowName);
        }
        GatewayResource gateway = jpa.getGateway();
        if (!isPublishedWorkflowExists(workflowName)){
          throw new PublishedWorkflowDoesNotExistsException(workflowName);
        }
        return gateway.getPublishedWorkflow(workflowName).getContent();
    }
View Full Code Here

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

  public List<String> getPublishedWorkflowNames() throws RegistryException{
        if (publishedWorkflowRegistry != null){
            return publishedWorkflowRegistry.getPublishedWorkflowNames();
        }
    GatewayResource gateway = jpa.getGateway();
    List<String> result=new ArrayList<String>();
      List<PublishWorkflowResource> publishedWorkflows = gateway.getPublishedWorkflows();
      for (PublishWorkflowResource resource : publishedWorkflows) {
      result.add(resource.getName());
    }
      return result;
  }
View Full Code Here

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

    public Map<String,String> getPublishedWorkflows() throws RegistryException{
        if (publishedWorkflowRegistry != null){
            return publishedWorkflowRegistry.getPublishedWorkflows();
        }
      GatewayResource gateway = jpa.getGateway();
      Map<String,String> result=new HashMap<String, String>();
      List<PublishWorkflowResource> publishedWorkflows = gateway.getPublishedWorkflows();
      for (PublishWorkflowResource resource : publishedWorkflows) {
      result.put(resource.getName(), resource.getContent());
    }
      return result;
    }
View Full Code Here

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

    public void removePublishedWorkflow(String workflowName) throws RegistryException {
        if (publishedWorkflowRegistry != null){
            publishedWorkflowRegistry.removePublishedWorkflow(workflowName);
        } else {
            GatewayResource gateway = jpa.getGateway();
            if (!isPublishedWorkflowExists(workflowName)){
                throw new PublishedWorkflowDoesNotExistsException(workflowName);
            }
            gateway.removePublishedWorkflow(workflowName);
        }
    }
View Full Code Here

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

                logger.error(e.getMessage(), e);
                e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
            }
        }
        try{
            GatewayResource gatewayResource = new GatewayResource();
            gatewayResource.setGatewayName(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
            gatewayResource.setOwner(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
            gatewayResource.save();
            UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
            userResource.setUserName(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER));
            userResource.setPassword(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER_PASSWORD));
            userResource.save();
            WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
            workerResource.setUser(userResource.getUserName());
            workerResource.save();
        } catch (RegistrySettingsException e) {
            logger.error("Unable to read properties", e);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.