Search in sources :

Example 1 with SPMDApplicationType

use of org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType in project airavata by apache.

the class JSDLUtils method getSPMDApplication.

public static SPMDApplicationType getSPMDApplication(JobDefinitionType value) {
    if (value != null && value.getJobDescription() != null && value.getJobDescription().isSetApplication()) {
        XmlCursor acursor = value.getJobDescription().getApplication().newCursor();
        if (acursor.toFirstChild()) {
            do {
                if (acursor.getName().equals(SPMD_APPLICATION)) {
                    XmlObject result = acursor.getObject();
                    acursor.dispose();
                    return (SPMDApplicationType) result;
                }
            } while (acursor.toNextSibling());
            acursor.dispose();
            return null;
        } else {
            acursor.dispose();
            return null;
        }
    } else {
        return null;
    }
}
Also used : SPMDApplicationType(org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType) XmlObject(org.apache.xmlbeans.XmlObject) XmlCursor(org.apache.xmlbeans.XmlCursor)

Example 2 with SPMDApplicationType

use of org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType in project airavata by apache.

the class JSDLUtils method getOrCreateSPMDApplication.

public static SPMDApplicationType getOrCreateSPMDApplication(JobDefinitionType value) {
    ApplicationType application = getOrCreateApplication(value);
    if (getSPMDApplication(value) == null) {
        XmlCursor acursor = application.newCursor();
        acursor.toEndToken();
        acursor.insertElement(SPMD_APPLICATION);
        acursor.dispose();
    }
    return getSPMDApplication(value);
}
Also used : POSIXApplicationType(org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType) HPCProfileApplicationType(org.ggf.schemas.jsdl.x2006.x07.jsdlHpcpa.HPCProfileApplicationType) SPMDApplicationType(org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType) XmlCursor(org.apache.xmlbeans.XmlCursor)

Example 3 with SPMDApplicationType

use of org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType in project airavata by apache.

the class JSDLUtils method getOrCreateSPMDApplication.

public static SPMDApplicationType getOrCreateSPMDApplication(JobDefinitionType value) {
    ApplicationType application = getOrCreateApplication(value);
    if (getSPMDApplication(value) == null) {
        XmlCursor acursor = application.newCursor();
        acursor.toEndToken();
        acursor.insertElement(SPMD_APPLICATION);
        acursor.dispose();
    }
    return getSPMDApplication(value);
}
Also used : HPCProfileApplicationType(org.ggf.schemas.jsdl.x2006.x07.jsdlHpcpa.HPCProfileApplicationType) POSIXApplicationType(org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType) ApplicationType(org.ggf.schemas.jsdl.x2005.x11.jsdl.ApplicationType) SPMDApplicationType(org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType) XmlCursor(org.apache.xmlbeans.XmlCursor)

Example 4 with SPMDApplicationType

use of org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType in project airavata by apache.

the class JSDLUtils method getSPMDApplication.

public static SPMDApplicationType getSPMDApplication(JobDefinitionType value) {
    if (value != null && value.getJobDescription() != null && value.getJobDescription().isSetApplication()) {
        XmlCursor acursor = value.getJobDescription().getApplication().newCursor();
        if (acursor.toFirstChild()) {
            do {
                if (acursor.getName().equals(SPMD_APPLICATION)) {
                    XmlObject result = acursor.getObject();
                    acursor.dispose();
                    return (SPMDApplicationType) result;
                }
            } while (acursor.toNextSibling());
            acursor.dispose();
            return null;
        } else {
            acursor.dispose();
            return null;
        }
    } else {
        return null;
    }
}
Also used : SPMDApplicationType(org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType) XmlObject(org.apache.xmlbeans.XmlObject) XmlCursor(org.apache.xmlbeans.XmlCursor)

Aggregations

XmlCursor (org.apache.xmlbeans.XmlCursor)4 SPMDApplicationType (org.ogf.schemas.jsdl.x2007.x02.jsdlSpmd.SPMDApplicationType)4 XmlObject (org.apache.xmlbeans.XmlObject)2 POSIXApplicationType (org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType)2 HPCProfileApplicationType (org.ggf.schemas.jsdl.x2006.x07.jsdlHpcpa.HPCProfileApplicationType)2 ApplicationType (org.ggf.schemas.jsdl.x2005.x11.jsdl.ApplicationType)1