Search in sources :

Example 1 with SourceTargetType

use of org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType 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);
    }
}
Also used : DataStagingType(org.ggf.schemas.jsdl.x2005.x11.jsdl.DataStagingType) SourceTargetType(org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType) URIException(org.apache.commons.httpclient.URIException) JobDescriptionType(org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDescriptionType) CreationFlagEnumeration(org.ggf.schemas.jsdl.x2005.x11.jsdl.CreationFlagEnumeration)

Example 2 with SourceTargetType

use of org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType 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);
    }
}
Also used : DataStagingType(org.ggf.schemas.jsdl.x2005.x11.jsdl.DataStagingType) SourceTargetType(org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType) URIException(org.apache.commons.httpclient.URIException) JobDescriptionType(org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDescriptionType) CreationFlagEnumeration(org.ggf.schemas.jsdl.x2005.x11.jsdl.CreationFlagEnumeration)

Aggregations

URIException (org.apache.commons.httpclient.URIException)2 CreationFlagEnumeration (org.ggf.schemas.jsdl.x2005.x11.jsdl.CreationFlagEnumeration)2 DataStagingType (org.ggf.schemas.jsdl.x2005.x11.jsdl.DataStagingType)2 JobDescriptionType (org.ggf.schemas.jsdl.x2005.x11.jsdl.JobDescriptionType)2 SourceTargetType (org.ggf.schemas.jsdl.x2005.x11.jsdl.SourceTargetType)2