"Creating group \"" + this.d.nameToPrint + "\"...";
this.pr.info(PrCodes.CREATE__GROUP_CREATING_PRINT_WAITING_DOTS, msg);
this.pr.flush();
}
final Group group;
try {
group = this.groupCreate.createGroup();
} catch (WorkspaceResourceRequestDeniedFault e) {
final String err =
"Resource request denied: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (WorkspaceSchedulingFault e) {
final String err =
"Scheduling problem: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (WorkspaceMetadataFault e) {
final String err =
"Metadata problem: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (WorkspaceEnsembleFault e) {
final String err =
"Ensemble related problem: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (WorkspaceContextualizationFault e) {
final String err =
"Context broker related problem: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (WorkspaceCreationFault e) {
final String err = "General problem: " + CommonUtil.faultString(e);
throw new ExecutionProblem(err, e);
} catch (BaseFaultType e) {
final String err = CommonStrings.faultStringOrCommonCause(e, "group");
throw new ExecutionProblem(err, e);
}
if (this.pr.enabled() && this.pr.useThis()) {
final String msg = " done.";
this.pr.infoln(PrCodes.CREATE__GROUP_CREATING_PRINT_WAITING_DOTS, msg);
}
if (this.pr.enabled()) {
final String msg = "Group created: " + group.getGroupID();
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__EXTRALINES, "");
this.pr.infoln(PrCodes.CREATE__GROUP_ID_PRINT, msg);
} else if (this.pr.useLogging()) {
logger.info(msg);
}
}
final Workspace[] workspaces = group.getWorkspaces();
if (workspaces != null && workspaces.length > 0) {
final Schedule currentSchedule = workspaces[0].getCurrentSchedule();
if (currentSchedule != null) {
if (currentSchedule.getActualInstantiationTime() == null) {
this.wasBestEffort = true;
}
}
}
if (workspaces != null) {
for (int i = 0; i < workspaces.length; i++) {
final String netStr = NetUtils.oneLineNetString(workspaces[i]);
if (netStr == null) {
continue;
}
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__GROUP_CREATING_NET_ONELINE,
" - " + netStr);
} else if (this.pr.useLogging()) {
logger.info(netStr);
}
}
}
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__EXTRALINES, "");
}
if (workspaces != null && workspaces.length > 0) {
ScheduleUtils.instanceCreateResultSchedulePrint(this.pr,
workspaces[0]);
}
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__EXTRALINES, "");
}
if (this.d.createEnsemble) {
if (this.pr.enabled()) {
final String msg = "Ensemble created: " + group.getEnsembleID();
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__EXTRALINES, "");
this.pr.infoln(PrCodes.CREATE__ENSEMBLE_ID_PRINT,
msg);
} else if (this.pr.useLogging()) {
logger.info(msg);
}
}
}
if (this.d.groupEprPath != null) {
final QName eprQName =
new QName("", this.eitherCreate.getSettings().
getGeneratedGroupEprElementName());
try {
FileUtils.writeEprToFile(group.getGroupEPR(),
this.d.groupEprPath,
eprQName);
if (this.pr.enabled()) {
final String msg = "Wrote group EPR to \"" +
this.d.groupEprPath + "\"";
if (this.pr.useThis()) {
this.pr.infoln(PrCodes.CREATE__EXTRALINES, "");
this.pr.infoln(PrCodes.CREATE__EPRFILE_WRITES,
msg);
} else if (this.pr.useLogging()) {
logger.info(msg);
}
}
} catch (Exception e) {
final String err = "Problem writing group EPR to file: ";
throw new ExecutionProblem(err + e.getMessage(), e);
}
}
this.writeEnsembleEprPossibly(group.getEnsembleMemberEPR());
return group;
}