* @param appBean ApplicationBean
* @return ApplicationDeploymentDescription
*/
public static ApplicationDeploymentDescription createAppDeploymentDescription(
String applicationName, ApplicationBean appBean) {
ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
if(appBean.getJobType() != null) {
appDesc.getType().changeType(GramApplicationDeploymentType.type);
GramApplicationDeploymentType gram = (GramApplicationDeploymentType) appDesc.getType();
ApplicationDeploymentDescriptionType.ApplicationName name =
ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
name.setStringValue(applicationName);
gram.setApplicationName(name);
gram.setExecutableLocation(appBean.getExecutable());
gram.setScratchWorkingDirectory(appBean.getTmpDir());
gram.setMaxWallTime(appBean.getMaxWallTime());
if (appBean.getPcount() != null) {
gram.setCpuCount(appBean.getPcount());
}
if (appBean.getMinMemory() != null) {
gram.setMinMemory(appBean.getMinMemory());
}
gram.setJobType(getJobTypeEnum(appBean.getJobType()));
ProjectAccountType projectAccount;
projectAccount = getProjectAccountType(gram);
projectAccount.setProjectAccountNumber(appBean.getProjectName());
projectAccount.setProjectAccountDescription("");
QueueType queueName;
queueName = getQueueType(gram);
queueName.setQueueName(appBean.getQueue());
} else {
ApplicationDeploymentDescriptionType app = appDesc.getType();
ApplicationDeploymentDescriptionType.ApplicationName name =
ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
name.setStringValue(applicationName);
app.setApplicationName(name);