Package org.globus.workspace.client_core

Examples of org.globus.workspace.client_core.ExecutionProblem


                        print.errln("\nProblem registering " + memberName);
                        throw new ExitNow(retCode.intValue(),
                            "Failed to register "+ memberName);
                    }
                } catch (InterruptedException e) {
                    throw new ExecutionProblem(e.getMessage(), e);
                } catch (ExecutionException e) {
                    throw new ExecutionProblem(e.getMessage(), e);
                }

                if (i == 0) {
                    firstSucceeded = true;
                   
View Full Code Here


            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ExecutionException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
    }
View Full Code Here

            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ExecutionException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
    }
View Full Code Here

            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ExecutionException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
    }
View Full Code Here

            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() != BaseClient.SUCCESS_EXIT_CODE) {
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ExecutionException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
    }
View Full Code Here

        final File topdir;
        try {
            topdir = CloudClientUtil.getHistoryDir(historyDir);
        } catch (ParameterProblem e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }

        final int nextnum = HistoryUtil.findNextSingleNumber(topdir, print);

        final String suffix = HistoryUtil.format.format(nextnum);
        final String newDirName = HistoryUtil.historyDirPrefix + suffix;

        print.debugln("Next directory: " + newDirName);

        final File newdir = new File(topdir, newDirName);
        final String newdirPath = newdir.getAbsolutePath();
        if (newdir.mkdir()) {
            print.debugln("Created directory: " + newdirPath);
        } else {
            // could be a race condition on the name, or odd perm problem
            // (note we checked parent dir was writeable)
            throw new ExecutionProblem(
                    "Could not create directory '" + newdirPath + "'");
        }

        final File runLog =
                HistoryUtil.newLogFile(newdir, RunTask.LOG_FILE_NAME, print);
        if (runLog != null) {
            try {
                print.getOpts().setInfoErrFile(runLog.getAbsolutePath());
            } catch (Exception e) {
                print.errln("Problem setting InfoErrFile: " + e.getMessage());
                // carry on
            }
        }

        final File debugLog =
               HistoryUtil.newLogFile(newdir, RunTask.DEBUG_LOG_FILE_NAME, print);
        if (debugLog != null) {
            try {
                print.getOpts().setAllOutFile(debugLog.getAbsolutePath());
            } catch (Exception e) {
                print.errln("Problem setting AllOutFile: " + e.getMessage());
                // carry on
            }
        }

        final File eprFile = new File(newdir, HistoryUtil.SINGLE_EPR_FILE_NAME);
        final String eprPath = eprFile.getAbsolutePath();
        print.debugln("EPR will be written to:");
        print.debugln("  - '" + eprPath + "'");
        print.debugln("");

        final FutureTask task =
                  this.getWorkspaceTask(workspaceFactoryURL,
                                        eprPath,
                                        metadata,
                                        metadata_fileName,
                                        deploymentRequest,
                                        deploymentRequest_fileName,
                                        sshfile,
                                        newdir,
                                        newDirName,
                                        pollMs,
                                        identityAuthorization,
                                        disableAllStateChecks,
                                        "Running",
                                        null,
                                        false,
                                        false,
                                        print,
                                        null,
                                        null);

        this.executor.submit(task);

        try {
            final Integer retCode = (Integer) task.get();
            if (retCode.intValue() == BaseClient.SUCCESS_EXIT_CODE) {
                print.infoln("\nRunning: '" + newDirName + "'");
            } else {
                print.errln("\nProblem running '" + newDirName + "'.");
                throw new ExitNow(retCode.intValue());
            }
        } catch (InterruptedException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        } catch (ExecutionException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }
    }
View Full Code Here

            final URL url = new URL(workspaceFactoryURL);
            hostport = url.getHost();
            hostport += ":";
            hostport += url.getPort();
        } catch (MalformedURLException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }

        try {
      final String newDirName_nospaces = newDirName.replace(' ', '_');
      final String runNameString = "https://" + hostport + "/" + newDirName_nospaces;
      print.debugln("name for metadata: '" + runNameString + "'");
            final URI runName = new URI(runNameString);
            metadata.setName(runName);
        } catch (URI.MalformedURIException e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }

        final String metadataPath;
        try {
            metadataPath = HistoryUtil.writeMetadata(newdir,
                                                     metadata_fileName,
                                                     metadata);
        } catch (Exception e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }

        print.debugln("Created workspace description:");
        print.debugln("  - '" + metadataPath + "'");

        final String deploymentPath;
        try {
            deploymentPath =
                    HistoryUtil.writeDeployment(newdir,
                                                deploymentRequest_fileName,
                                                deploymentRequest);
        } catch (Exception e) {
            throw new ExecutionProblem(e.getMessage(), e);
        }

        print.debugln("Created deployment request:");
        print.debugln("  - '" + deploymentPath + "'");
View Full Code Here

                }

                if (task.perHostDir) {
                    if (this.knownHostsDir == null) {
                        if (task.perHostDirPath == null) {
                            throw new ExecutionProblem("expecting path here");
                        }
                        this.knownHostsDir = task.perHostDirPath;
                    }
                    if (this.knownHostsDir != null) {
                        if (!this.knownHostsDir.equals(task.perHostDirPath)) {
                            throw new ExecutionProblem("expecting identical " +
                                    "path here, not supporting per-sshkey " +
                                    "file/directory paths yet");
                        }
                    }
                }
            }
           
            this.knownHostsTasksStr = buf.toString();
        }

        if (this.knownHostsTasksStr != null) {
            if (this.knownHostsFile == null && this.knownHostsDir == null) {
                throw new ExecutionProblem("known-host tasks " +
                        "but no path/dir to adjust");
            }
        }
    }
View Full Code Here

                task.get(timeoutMinutes, TimeUnit.MINUTES);
            }
        }
        catch (InterruptedException e)
        {
            throw new ExecutionProblem(e);
        }
        catch (ExecutionException e)
        {
            throw new ExecutionProblem("Problem transferring: " +
                                                        e.getMessage());
        }
        catch (TimeoutException e)
        {
            throw new ExecutionProblem("Timeout limit exceeded.");
        }
    }
View Full Code Here

            } catch (ParameterProblem e) {
                throw e;
            } catch (ExecutionProblem e) {
                throw e;
            } catch (Exception e) {
                throw new ExecutionProblem(e.getMessage(), 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.