org.apache.airavata.persistance.registry.jpa.resources
Class WorkerResource
java.lang.Object
org.apache.airavata.persistance.registry.jpa.resources.AbstractResource
org.apache.airavata.persistance.registry.jpa.resources.WorkerResource
- All Implemented Interfaces:
- Resource
public class WorkerResource
- extends AbstractResource
| 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 |
| 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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WorkerResource
public WorkerResource()
WorkerResource
public WorkerResource(String user,
GatewayResource gateway)
- Parameters:
user - usernamegateway - gatewayResource
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 typename - 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 typename - 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.