Package org.apache.airavata.gfac

Examples of org.apache.airavata.gfac.GFacException


      status.setJobState(state);
      status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
          details.setJobStatus(status);
      registry.update(org.apache.airavata.registry.cpi.RegistryModelType.JOB_DETAIL, details, details.getJobID());
    } catch (Exception e) {
      throw new GFacException("Error persisting job status" + e.getLocalizedMessage(),e);
    }
  }
View Full Code Here


      details.setActionableGroup(ActionableGroup.GATEWAYS_ADMINS);
      details.setCreationTime(Calendar.getInstance().getTimeInMillis());
      details.setErrorCategory(errorCatogory);
      registry.add(ChildDataType.ERROR_DETAIL, details, jobExecutionContext.getTaskData().getTaskID());
      } catch (Exception e) {
      throw new GFacException("Error persisting job status" + e.getLocalizedMessage(),e);
    }
    }
View Full Code Here

        for (int i = 0; i < parameters.length; i++) {
          DataObjectType input = map.get(parameters[i].getParameterName());
            if (input != null) {
                stringObjectHashMap.put(parameters[i].getParameterName(), GFacUtils.getInputActualParameter(parameters[i], input));
            } else {
                throw new GFacException("Error finding the parameter: parameter Name" + parameters[i].getParameterName());
            }
        }
        return stringObjectHashMap;
    }
View Full Code Here

                try {
                    job.signal(GramJob.SIGNAL_COMMIT_REQUEST);

                } catch (GramException gramException) {
                    throw new GFacException("Error while sending commit request. Job Id - "
                            + job.getIDAsString(), gramException);
                } catch (GSSException gssException) {

                    // User credentials are invalid
                    log.error("Error while submitting commit request - Credentials provided are invalid. Job Id - "
                            + job.getIDAsString(), e);
                    log.info("Attempting to renew credentials and re-submit commit signal...");

                    renewCredentials(jobExecutionContext);

                    try {
                        job.signal(GramJob.SIGNAL_COMMIT_REQUEST);
                    } catch (GramException e1) {
                        throw new GFacException("Error while sending commit request. Job Id - "
                                + job.getIDAsString(), e1);
                    } catch (GSSException e1) {
                        throw new GFacException("Error while sending commit request. Job Id - "
                                + job.getIDAsString() + ". Credentials provided invalid", e1);
                    }
                }

                jobStatusMessage = "Submitted JobID= " + job.getIDAsString();
                log.info(jobStatusMessage);
                jobExecutionContext.getNotifier().publish(new JobIDEvent(jobStatusMessage));

            } catch (GSSException e) {
                // Renew credentials and re-submit
                reSubmitJob(gateKeeper, jobExecutionContext, globusHostType, e);

            } catch (GramException e) {
                throw new GFacException("An error occurred while submitting a job, job id = " + job.getIDAsString(), e);
            }
        } else {

            /*
            * The first boolean is to force communication through SSLv3
            * The second boolean is to specify the job is a batch job - use true for interactive and false for
             * batch.
            * The third boolean is to specify to use the full proxy and not delegate a limited proxy.
            */
            try {

                job.request(true, gateKeeper, false, false);
                renewCredentialsAttempt = false;

            } catch (GramException e) {
                throw new GFacException("An error occurred while submitting a job, job id = " + job.getIDAsString(), e);
            } catch (GSSException e) {

                // Renew credentials and re-submit
                reSubmitJob(gateKeeper, jobExecutionContext, globusHostType, e);
            }
View Full Code Here

                getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).renewCredentials();

        try {
            gramJob.renew(gssCred);
        } catch (GramException e1) {
            throw new GFacException("Unable to renew credentials. Job Id - "
                    + gramJob.getIDAsString(), e1);
        } catch (GSSException e1) {
            throw new GFacException("Unable to renew credentials. Job Id - "
                    + gramJob.getIDAsString(), e1);
        }
    }
View Full Code Here

            renewCredentials(jobExecutionContext);

            submitJobs(gateKeeper, jobExecutionContext, globusHostType);

        } else {
            throw new GFacException("Error while submitting job - Credentials provided are invalid. Job Id - "
                    + job.getIDAsString(), e);
        }

    }
View Full Code Here

            GramJob gramJob = new GramJob(null);
            try {
                gramJob.setID(jobId);
            } catch (MalformedURLException e) {
                throw new GFacException("Invalid job id - " + jobId, e);
            }
            gramJob.setCredentials(gssCred);

            synchronized (this) {
                if (gramJob.getStatus() != GRAMConstants.STATUS_DONE ||
View Full Code Here

    private void cancelJob(GramJob gramJob, JobExecutionContext context) throws GFacException{

        try {
            gramJob.cancel();
        } catch (GramException e) {
            throw new GFacException("Error cancelling job, id - " + gramJob.getIDAsString(), e);
        } catch (GSSException e) {

            log.warn("Credentials invalid to cancel job. Attempting to renew credentials and re-try. " +
                    "Job id - " + gramJob.getIDAsString());
            renewCredentials(gramJob, context);

            try {
                gramJob.cancel();
                gramJob.signal(GramJob.SIGNAL_COMMIT_END);
            } catch (GramException e1) {
                throw new GFacException("Error cancelling job, id - " + gramJob.getIDAsString(), e1);
            } catch (GSSException e1) {
                throw new GFacException("Error cancelling job, invalid credentials. Job id - "
                        + gramJob.getIDAsString(), e);
            }
        }

    }
View Full Code Here

            cluster = ((GSISecurityContext) jobExecutionContext.getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT)).getPbsCluster();
        } else {
            cluster = ((SSHSecurityContext) jobExecutionContext.getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT)).getPbsCluster();
        }
        if (cluster == null) {
            throw new GFacException("Security context is not set properly");
        } else {
            log.info("Successfully retrieved the Security Context");
        }
        ApplicationDeploymentDescriptionType app = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType();
        int i = paramValue.lastIndexOf(File.separator);
View Full Code Here

                    FileInputStream fis = null;
                    try {
                      fis = new FileInputStream(localFile);
                      ftp.uploadFile(destURI, gssCred, fis);
                    } catch (IOException e) {
                        throw new GFacException("Unable to create file : " + localFile ,e);
                    } finally {
                        if (fis != null) {
                            fis.close();
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.GFacException

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.