use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionType in project airavata by apache.
the class JSDLGenerator method buildJSDLInstance.
public static synchronized JobDefinitionDocument buildJSDLInstance(JobExecutionContext context, String smsUrl) throws Exception {
JobDefinitionDocument jobDefDoc = JobDefinitionDocument.Factory.newInstance();
JobDefinitionType value = jobDefDoc.addNewJobDefinition();
// build Identification
createJobIdentification(value, context);
ResourceProcessor.generateResourceElements(value, context);
ApplicationProcessor.generateJobSpecificAppElements(value, context);
UASDataStagingProcessor.generateDataStagingElements(value, context, smsUrl);
return jobDefDoc;
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionType in project airavata by apache.
the class JSDLUtils method addEnvVariable.
public static EnvironmentType addEnvVariable(JobDefinitionType def, String name, String value) {
POSIXApplicationType posixApp = getOrCreatePOSIXApplication(def);
EnvironmentType newEnv = posixApp.addNewEnvironment();
newEnv.setName(name);
newEnv.setStringValue(value);
return newEnv;
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionType in project airavata by apache.
the class JSDLUtils method addDataStagingTargetElement.
public static void addDataStagingTargetElement(JobDefinitionType value, String fileSystem, String file, String uri, int flags) {
JobDescriptionType jobDescr = getOrCreateJobDescription(value);
DataStagingType newDS = jobDescr.addNewDataStaging();
CreationFlagEnumeration.Enum creationFlag = CreationFlagEnumeration.DONT_OVERWRITE;
if ((flags & FLAG_OVERWRITE) != 0)
creationFlag = CreationFlagEnumeration.OVERWRITE;
if ((flags & FLAG_APPEND) != 0)
creationFlag = CreationFlagEnumeration.APPEND;
boolean deleteOnTerminate = (flags & FLAG_DELETE_ON_TERMINATE) != 0;
newDS.setCreationFlag(creationFlag);
newDS.setDeleteOnTermination(deleteOnTerminate);
SourceTargetType target = newDS.addNewTarget();
try {
if (uri != null) {
URIUtils.encodeAll(uri);
target.setURI(uri);
}
} catch (URIException e) {
}
newDS.setFileName(file);
if (fileSystem != null && !fileSystem.equals("Work")) {
// $NON-NLS-1$
newDS.setFilesystemName(fileSystem);
}
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionType in project airavata by apache.
the class JSDLUtils method getOrCreateHPCProfileApplication.
public static HPCProfileApplicationType getOrCreateHPCProfileApplication(JobDefinitionType value) {
ApplicationType application = getOrCreateApplication(value);
if (getPOSIXApplication(value) != null) {
// TODO handle: creating HPC element if POSIX already exists
return getHPCProfileApplication(value);
}
if (getHPCProfileApplication(value) == null) {
XmlCursor acursor = application.newCursor();
acursor.toEndToken();
acursor.insertElement(HPC_PROFILE_APPLICATION);
acursor.dispose();
}
return getHPCProfileApplication(value);
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDefinitionType in project airavata by apache.
the class JSDLUtils method addEnvVariable.
public static EnvironmentType addEnvVariable(JobDefinitionType def, String name, String value) {
POSIXApplicationType posixApp = getOrCreatePOSIXApplication(def);
EnvironmentType newEnv = posixApp.addNewEnvironment();
newEnv.setName(name);
newEnv.setStringValue(value);
return newEnv;
}
Aggregations