use of org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType in project airavata by apache.
the class JSDLUtils method getPOSIXApplication.
public static POSIXApplicationType getPOSIXApplication(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(POSIX_APPLICATION)) {
XmlObject result = acursor.getObject();
acursor.dispose();
return (POSIXApplicationType) result;
}
} while (acursor.toNextSibling());
acursor.dispose();
return null;
} else {
acursor.dispose();
return null;
}
} else {
return null;
}
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType 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.jsdlPosix.POSIXApplicationType 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.jsdlPosix.POSIXApplicationType in project airavata by apache.
the class JSDLUtils method getOrCreatePOSIXApplication.
public static POSIXApplicationType getOrCreatePOSIXApplication(JobDefinitionType value) {
ApplicationType application = getOrCreateApplication(value);
if (getHPCProfileApplication(value) != null) {
// TODO handle: not creating POSIX element if HPCProfile already exists
return getPOSIXApplication(value);
}
if (getPOSIXApplication(value) == null) {
XmlCursor acursor = application.newCursor();
acursor.toEndToken();
acursor.insertElement(POSIX_APPLICATION);
acursor.dispose();
}
return getPOSIXApplication(value);
}
use of org.ggf.schemas.jsdl.x2005.x11.jsdlPosix.POSIXApplicationType in project airavata by apache.
the class JSDLUtils method getPOSIXApplication.
public static POSIXApplicationType getPOSIXApplication(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(POSIX_APPLICATION)) {
XmlObject result = acursor.getObject();
acursor.dispose();
return (POSIXApplicationType) result;
}
} while (acursor.toNextSibling());
acursor.dispose();
return null;
} else {
acursor.dispose();
return null;
}
} else {
return null;
}
}
Aggregations