public Resource create(ResourceType type) {
   switch (type) {
     case WORKFLOW_DATA:
       WorkflowDataResource workflowDataResource = new WorkflowDataResource();
       workflowDataResource.setExperimentID(experimentID);
       return workflowDataResource;
     case EXECUTION_ERROR:
       ExecutionErrorResource executionErrorResource = new ExecutionErrorResource();
       executionErrorResource.setExperimentDataResource(this);
       return executionErrorResource;
     case EXPERIMENT_METADATA:
       ExperimentMetadataResource experimentMetadataResource = new ExperimentMetadataResource();
       experimentMetadataResource.setExpID(experimentID);
       return experimentMetadataResource;
     case GFAC_JOB_DATA:
       GFacJobDataResource gFacJobDataResource = new GFacJobDataResource();
       gFacJobDataResource.setExperimentDataResource(this);
       return gFacJobDataResource;
     default:
       logger.error(
           "Unsupported resource type for experiment data resource... ",
           new UnsupportedOperationException());
       throw new IllegalArgumentException(
           "Unsupported resource type for experiment data resource.");
   }
 }
 public GFacJobDataResource createGFacJob(String jobID) {
   GFacJobDataResource r = (GFacJobDataResource) create(ResourceType.GFAC_JOB_DATA);
   r.setLocalJobID(jobID);
   return r;
 }