org.apache.airavata.persistance.registry.jpa.resources
Class GatewayResource

java.lang.Object
  extended by org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
      extended by org.apache.airavata.persistance.registry.jpa.resources.GatewayResource
All Implemented Interfaces:
Resource

public class GatewayResource
extends AbstractResource


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
AbstractResource.ApplicationDescriptorConstants, AbstractResource.ConfigurationConstants, AbstractResource.ExperimentConstants, AbstractResource.ExperimentDataConstants, AbstractResource.GatewayConstants, AbstractResource.GatewayWorkerConstants, AbstractResource.GramDataConstants, AbstractResource.HostDescriptorConstants, AbstractResource.NodeDataConstants, AbstractResource.ProjectConstants, AbstractResource.PublishedWorkflowConstants, AbstractResource.ServiceDescriptorConstants, AbstractResource.UserConstants, AbstractResource.UserWorkflowConstants, AbstractResource.WorkflowDataConstants
 
Field Summary
 
Fields inherited from class org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
APPLICATION_DESCRIPTOR, CONFIGURATION, EXPERIMENT, EXPERIMENT_DATA, EXPERIMENT_METADATA, GATEWAY, GATEWAY_WORKER, HOST_DESCRIPTOR, PROJECT, PUBLISHED_WORKFLOW, SERVICE_DESCRIPTOR, USER_WORKFLOW, USERS, WORKFLOW_DATA
 
Constructor Summary
GatewayResource()
           
GatewayResource(String gatewayName)
           
 
Method Summary
 Resource create(ResourceType type)
          Gateway is at the root level.
 ApplicationDescriptorResource createApplicationDescriptorResource(String descriptorName)
           
 HostDescriptorResource createHostDescriptorResource(String hostDescriptorName)
           
 PublishWorkflowResource createPublishedWorkflow(String workflowTemplateName)
           
 ServiceDescriptorResource createServiceDescriptorResource(String descriptorName)
           
 List<Resource> get(ResourceType type)
          This method will list all the child resources for the given resource type
 Resource get(ResourceType type, Object name)
          Gateway can get information of his children
 ApplicationDescriptorResource getApplicationDescriptorResource(String descriptorName)
           
 List<ApplicationDescriptorResource> getApplicationDescriptorResources()
           
 List<ApplicationDescriptorResource> getApplicationDescriptorResources(String serviceName, String hostName)
           
 String getGatewayName()
           
 HostDescriptorResource getHostDescriptorResource(String hostDescriptorName)
           
 List<HostDescriptorResource> getHostDescriptorResources()
           
 String getOwner()
           
 PublishWorkflowResource getPublishedWorkflow(String workflowTemplateName)
           
 List<PublishWorkflowResource> getPublishedWorkflows()
           
 ServiceDescriptorResource getServiceDescriptorResource(String descriptorName)
           
 List<ServiceDescriptorResource> getServiceDescriptorResources()
           
 boolean isApplicationDescriptorExists(String descriptorName)
           
 boolean isExists(ResourceType type, Object name)
          check whether child resource already exist in the database
 boolean isHostDescriptorExists(String descriptorName)
           
 boolean isPublishedWorkflowExists(String workflowTemplateName)
           
 boolean isServiceDescriptorExists(String descriptorName)
           
 void remove(ResourceType type, Object name)
          Child resources can be removed from a gateway
 void removeApplicationDescriptor(String descriptorName)
           
 void removeHostDescriptor(String descriptorName)
           
 void removePublishedWorkflow(String workflowTemplateName)
           
 void removeServiceDescriptor(String descriptorName)
           
 void save()
          save the gateway to the database
 void setGatewayName(String gatewayName)
           
 void setOwner(String owner)
           
 
Methods inherited from class org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
getResourceList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GatewayResource

public GatewayResource(String gatewayName)
Parameters:
gatewayName - gateway name

GatewayResource

public GatewayResource()
Method Detail

getGatewayName

public String getGatewayName()
Returns:
gateway name

setGatewayName

public void setGatewayName(String gatewayName)
Parameters:
gatewayName -

getOwner

public String getOwner()
Returns:
owner of the gateway

setOwner

public void setOwner(String owner)
Parameters:
owner - owner of the gateway

create

public Resource create(ResourceType type)
Gateway is at the root level. So it can populate his child resources. Project, User, Published Workflows, User workflows, Host descriptors, Service Descriptors, Application descriptors and Experiments are all its children

Parameters:
type - resource type of the children
Returns:
specific child resource type

remove

public void remove(ResourceType type,
                   Object name)
Child resources can be removed from a gateway

Parameters:
type - child resource type
name - child resource name

get

public Resource get(ResourceType type,
                    Object name)
Gateway can get information of his children

Parameters:
type - child resource type
name - child resource name
Returns:
specific child resource type

get

public List<Resource> get(ResourceType type)
Description copied from interface: Resource
This method will list all the child resources for the given resource type

Parameters:
type - child resource type
Returns:
list of child resources

save

public void save()
save the gateway to the database


isExists

public boolean isExists(ResourceType type,
                        Object name)
check whether child resource already exist in the database

Specified by:
isExists in interface Resource
Overrides:
isExists in class AbstractResource
Parameters:
type - child resource type
name - name of the child resource
Returns:
true or false

isHostDescriptorExists

public boolean isHostDescriptorExists(String descriptorName)
Parameters:
descriptorName - host descriptor name
Returns:
whether host descriptor already available

createHostDescriptorResource

public HostDescriptorResource createHostDescriptorResource(String hostDescriptorName)
Parameters:
hostDescriptorName - host descriptor name
Returns:
HostDescriptorResource

getHostDescriptorResource

public HostDescriptorResource getHostDescriptorResource(String hostDescriptorName)
Parameters:
hostDescriptorName - host descriptor name
Returns:
HostDescriptorResource

removeHostDescriptor

public void removeHostDescriptor(String descriptorName)
Parameters:
descriptorName - host descriptor name

getHostDescriptorResources

public List<HostDescriptorResource> getHostDescriptorResources()
Returns:
list of host descriptors available for the gateway

isServiceDescriptorExists

public boolean isServiceDescriptorExists(String descriptorName)
Parameters:
descriptorName - service descriptor name
Returns:
whether service descriptor already available

createServiceDescriptorResource

public ServiceDescriptorResource createServiceDescriptorResource(String descriptorName)
Parameters:
descriptorName - service descriptor name
Returns:
ServiceDescriptorResource

getServiceDescriptorResource

public ServiceDescriptorResource getServiceDescriptorResource(String descriptorName)
Parameters:
descriptorName - service descriptor name
Returns:
ServiceDescriptorResource

removeServiceDescriptor

public void removeServiceDescriptor(String descriptorName)
Parameters:
descriptorName - Service descriptor name

getServiceDescriptorResources

public List<ServiceDescriptorResource> getServiceDescriptorResources()
Returns:
list of service descriptors for the gateway

isApplicationDescriptorExists

public boolean isApplicationDescriptorExists(String descriptorName)
Parameters:
descriptorName - application descriptor name
Returns:
whether application descriptor already available

createApplicationDescriptorResource

public ApplicationDescriptorResource createApplicationDescriptorResource(String descriptorName)
Parameters:
descriptorName - application descriptor name
Returns:
ApplicationDescriptorResource

getApplicationDescriptorResource

public ApplicationDescriptorResource getApplicationDescriptorResource(String descriptorName)
Parameters:
descriptorName - application descriptor name
Returns:
ApplicationDescriptorResource

removeApplicationDescriptor

public void removeApplicationDescriptor(String descriptorName)
Parameters:
descriptorName - application descriptor name

getApplicationDescriptorResources

public List<ApplicationDescriptorResource> getApplicationDescriptorResources()
Returns:
list of application descriptors for the gateway

getApplicationDescriptorResources

public List<ApplicationDescriptorResource> getApplicationDescriptorResources(String serviceName,
                                                                             String hostName)
Parameters:
serviceName - service descriptor name
hostName - host descriptor name
Returns:
list of application descriptors for the gateway

isPublishedWorkflowExists

public boolean isPublishedWorkflowExists(String workflowTemplateName)
Parameters:
workflowTemplateName - published workflow template name
Returns:
boolean - whether workflow with the same name exists

createPublishedWorkflow

public PublishWorkflowResource createPublishedWorkflow(String workflowTemplateName)
Parameters:
workflowTemplateName - published workflow template name
Returns:
publish workflow resource

getPublishedWorkflow

public PublishWorkflowResource getPublishedWorkflow(String workflowTemplateName)
Parameters:
workflowTemplateName - published workflow template name
Returns:
publish workflow resource

getPublishedWorkflows

public List<PublishWorkflowResource> getPublishedWorkflows()
Returns:
list of publish workflows for the gateway

removePublishedWorkflow

public void removePublishedWorkflow(String workflowTemplateName)
Parameters:
workflowTemplateName - published workflow template name


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.