use of org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDescriptionType 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.JobDescriptionType in project airavata by apache.
the class JSDLUtils method addDataStagingSourceElement.
public static void addDataStagingSourceElement(JobDefinitionType value, String uri, String fileSystem, String file, int flags) {
JobDescriptionType jobDescr = getOrCreateJobDescription(value);
try {
uri = (uri == null) ? null : URIUtils.encodeAll(uri);
} catch (URIException e) {
}
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 source = newDS.addNewSource();
source.setURI(uri);
newDS.setFileName(file);
if (fileSystem != null && !fileSystem.equals("Work")) {
// $NON-NLS-1$
newDS.setFilesystemName(fileSystem);
}
}
Aggregations