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

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

public class WorkerResource
extends AbstractResource


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
AbstractResource.ApplicationDescriptorConstants, AbstractResource.ConfigurationConstants, AbstractResource.ExecutionErrorConstants, AbstractResource.ExperimentConstants, AbstractResource.ExperimentDataConstants, AbstractResource.GatewayConstants, AbstractResource.GatewayWorkerConstants, AbstractResource.GFacJobDataConstants, AbstractResource.GFacJobStatusConstants, 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, EXECUTION_ERROR, EXPERIMENT, EXPERIMENT_DATA, EXPERIMENT_METADATA, GATEWAY, GATEWAY_WORKER, GFAC_JOB_DATA, GFAC_JOB_STATUS, HOST_DESCRIPTOR, PROJECT, PUBLISHED_WORKFLOW, SERVICE_DESCRIPTOR, USER_WORKFLOW, USERS, WORKFLOW_DATA
 
Constructor Summary
WorkerResource()
           
WorkerResource(String user, GatewayResource gateway)
           
 
Method Summary
 Resource create(ResourceType type)
          Gateway worker can create child data structures such as projects and user workflows
 ProjectResource createProject(String name)
           
 UserWorkflowResource createWorkflowTemplate(String templateName)
           
 List<Resource> get(ResourceType type)
          This method will list all the child resources for the given resource type
 Resource get(ResourceType type, Object name)
          This method will return the given child resource from the database
 ExperimentResource getExperiment(String name)
           
 List<ExperimentResource> getExperiments()
           
 GatewayResource getGateway()
           
 GFacJobDataResource getGFacJob(String jobId)
           
 List<GFacJobDataResource> getGFacJobs(String serviceDescriptionId, String hostDescriptionId, String applicationDescriptionId)
           
 List<GFacJobStatusResource> getGFacJobStatuses(String jobId)
           
 ProjectResource getProject(String name)
           
 List<ProjectResource> getProjects()
           
 String getUser()
           
 WorkflowDataResource getWorkflowInstance(String workflowInstanceId)
           
 UserWorkflowResource getWorkflowTemplate(String templateName)
           
 List<UserWorkflowResource> getWorkflowTemplates()
           
 boolean isExperimentExists(String name)
           
 boolean isGFacJobExists(String jobId)
          Returns of the gfac job record is present for the job id
 boolean isProjectExists(String name)
           
 boolean isWorkflowInstancePresent(String workflowInstanceId)
           
 boolean isWorkflowTemplateExists(String templateName)
           
 void remove(ResourceType type, Object name)
          This method will remove the given child resource from the database
 void removeExperiment(String experimentId)
           
 void removeProject(String name)
           
 void removeWorkflowInstance(String workflowInstanceId)
           
 void removeWorkflowTemplate(String templateName)
           
 void save()
          save gateway worker to database
 void setGateway(GatewayResource gateway)
           
 void setUser(String user)
           
 
Methods inherited from class org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
getResourceList, isExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkerResource

public WorkerResource()

WorkerResource

public WorkerResource(String user,
                      GatewayResource gateway)
Parameters:
user - username
gateway - gatewayResource
Method Detail

create

public Resource create(ResourceType type)
Gateway worker can create child data structures such as projects and user workflows

Parameters:
type - child resource type
Returns:
child resource

remove

public void remove(ResourceType type,
                   Object name)
Description copied from interface: Resource
This method will remove the given child resource from the database

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

get

public Resource get(ResourceType type,
                    Object name)
Description copied from interface: Resource
This method will return the given child resource from the database

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

getGFacJobs

public List<GFacJobDataResource> getGFacJobs(String serviceDescriptionId,
                                             String hostDescriptionId,
                                             String applicationDescriptionId)

getGFacJobStatuses

public List<GFacJobStatusResource> getGFacJobStatuses(String jobId)

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 gateway worker to database


getUser

public String getUser()
Returns:
user name

setUser

public void setUser(String user)
Parameters:
user - user name

getGateway

public GatewayResource getGateway()
Returns:
gateway resource

setGateway

public void setGateway(GatewayResource gateway)
Parameters:
gateway - gateway resource

isProjectExists

public boolean isProjectExists(String name)
Parameters:
name - project name
Returns:
whether the project is available under the user

createProject

public ProjectResource createProject(String name)
Parameters:
name - project name
Returns:
project resource for the user

getProject

public ProjectResource getProject(String name)
Parameters:
name - project name
Returns:
project resource

removeProject

public void removeProject(String name)
Parameters:
name - project name

getProjects

public List<ProjectResource> getProjects()
Returns:
list of projects for the user

isWorkflowTemplateExists

public boolean isWorkflowTemplateExists(String templateName)
Parameters:
templateName - user workflow template
Returns:
whether the workflow is already exists under the given user

createWorkflowTemplate

public UserWorkflowResource createWorkflowTemplate(String templateName)
Parameters:
templateName - user workflow template
Returns:
user workflow resource

getWorkflowTemplate

public UserWorkflowResource getWorkflowTemplate(String templateName)
Parameters:
templateName - user workflow template
Returns:
user workflow resource

removeWorkflowTemplate

public void removeWorkflowTemplate(String templateName)
Parameters:
templateName - user workflow template

getWorkflowTemplates

public List<UserWorkflowResource> getWorkflowTemplates()
Returns:
list of user workflows for the given user

isExperimentExists

public boolean isExperimentExists(String name)
Parameters:
name - experiment name
Returns:
whether experiment is already exist for the given user

isGFacJobExists

public boolean isGFacJobExists(String jobId)
Returns of the gfac job record is present for the job id

Parameters:
jobId -
Returns:

getExperiment

public ExperimentResource getExperiment(String name)
Parameters:
name - experiment name
Returns:
experiment resource

getGFacJob

public GFacJobDataResource getGFacJob(String jobId)

getExperiments

public List<ExperimentResource> getExperiments()
Returns:
list of experiments for the user

removeExperiment

public void removeExperiment(String experimentId)
Parameters:
experimentId - experiment name

isWorkflowInstancePresent

public boolean isWorkflowInstancePresent(String workflowInstanceId)

getWorkflowInstance

public WorkflowDataResource getWorkflowInstance(String workflowInstanceId)

removeWorkflowInstance

public void removeWorkflowInstance(String workflowInstanceId)


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