Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ExecutionProblem


        try {
            w = this.singleCreate.create();
        } 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 (WorkspaceContextualizationFault e) {
            final String err =
                    "Context broker related 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 (WorkspaceCreationFault e) {
            final String err =
                    "General: " + CommonUtil.faultString(e);
            throw new ExecutionProblem(err, e);
        } catch (BaseFaultType e) {
            final String err = CommonStrings.faultStringOrCommonCause(e);
            throw new ExecutionProblem(err, e);
        }

        if (this.pr.enabled() && this.pr.useThis()) {
            final String msg = " done.";
            this.pr.infoln(PrCodes.CREATE__INSTANCE_CREATING_PRINT_WAITING_DOTS, msg);
View Full Code Here


        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());
View Full Code Here

                        final File writeBlank = new File(writedir, fileName);
                        try {
                            FileUtils.writeStringToFile(id + "\n" + ip,
                                                        writeBlank.getAbsolutePath());
                        } catch (Exception e) {
                            throw new ExecutionProblem("Problem writing " +
                                    "id/ip file: " + e.getMessage(), e);
                        }
                    }
                }
            }
View Full Code Here

                }
            }

        } catch (Exception e) {
            final String err = "Problem writing EPR to file: ";
            throw new ExecutionProblem(err + e.getMessage(), e);
        }
    }
View Full Code Here

                }
            }

        } catch (Exception e) {
            final String err = "Problem writing EPR to file: ";
            throw new ExecutionProblem(err + e.getMessage(), e);
        }
    }
View Full Code Here

            }

        } catch (BaseFaultType e) {
            final String err =
                    CommonStrings.faultStringOrCommonCause(e, "context");
            throw new ExecutionProblem(err, e);
        }

        if (contextRP.isErrorPresent()) {

            if (this.pr.enabled()) {
                final String msg =
                        "Problem with " + this.nameToPrint + " context";
                if (this.pr.useThis()) {
                    this.pr.infoln(PrCodes.CTXMONITOR__ONE_ERROR, msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

        } else if (contextRP.isAllOK()) {

            if (this.pr.enabled()) {
                final String msg = this.nameToPrint + ": contextualized";
                if (this.pr.useThis()) {
                    this.pr.infoln(PrCodes.CTXMONITOR__ALL_OK, "  - " + msg);
                } else if (this.pr.useLogging()) {
                    logger.info(msg);
                }
            }

        } else {
            throw new ExecutionProblem("Incorrect analysis of ctx query?");
        }

        // both oneErrorExists and allOK trigger report(s) if path is configured
        if (this.args.reportDir != null) {
            try {
                this.writeSummary(contextRP);
            } catch (Exception e) {
                final String err = CommonUtil.genericExceptionMessageWrapper(e);
                throw new ExecutionProblem(
                        "Problem writing ctx summary: " + err, e);
            }
        }

        // in all cases get the full node report
        Node_Type[] nodes = null;
        try {
            this.identitiesQuery.setQueryAll(true);
            nodes = this.identitiesQuery.identities();
        } catch (NimbusContextualizationFault e) {
            final String err = CommonUtil.genericExceptionMessageWrapper(e);
            if (this.pr.enabled()) {
                final String errMsg = "Problem querying ctx nodes: " + err;
                if (this.pr.useThis()) {
                    this.pr.errln(errMsg);
                } else if (this.pr.useLogging()) {
                    logger.error(errMsg);
                }
            }
        }

        // both oneErrorExists and allOK trigger report(s) if path is configured
        if (nodes != null && this.args.reportDir != null) {
            try {
                this.writeReports(nodes);
            } catch (Exception e) {
                final String err = CommonUtil.genericExceptionMessageWrapper(e);
                throw new ExecutionProblem(
                        "Problem writing ctx summary: " + err, e);
            }
        }

        if (contextRP.isErrorPresent()) {
            throw new ExitNow(1);
        }
       
        if (nodes != null && this.adjustSshKnownHosts) {
            try {
                adjustKnownHosts(nodes,
                                 this.sshKnownHostsPath,
                                 this.sshKnownHostsDirPath,
                                 this.adjustTasks,
                                 this.pr);
            } catch (Exception e) {
                final String err = CommonUtil.genericExceptionMessageWrapper(e);
                throw new ExecutionProblem(
                        "Problem adjusting known_hosts file @ '" +
                                this.sshKnownHostsPath + "': " + err, e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.globus.workspace.client_core.ExecutionProblem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.