Package org.ietf.jgss

Examples of org.ietf.jgss.GSSCredential


                    tempTrustedCas.deleteOnExit();
                }else{
                    throw new XregistryException("Server is secured, but can not find trusted certificates file");       
                }
            }
            GSSCredential credential = globalConfiguration.getCredential();
            invoker = new GsiInvoker(credential,certs);
            globalConfiguration.setUserDN(credential.getName().toString());
        }
        return invoker;
    }
View Full Code Here


        try {
            // load the x509 proxy. if not found, quit.
            String proxyPath = System.getProperty("X509_USER_PROXY");
            System.out.println("Proxy location = " + proxyPath);
            GlobusCredential globusCred;
            GSSCredential gssCred;

            // if delegated proxy is used, then the proxy path is denoted by the
            // env variable X509_USER_PROXY
            if (proxyPath != null && !"".equals(proxyPath)) {
                globusCred = new GlobusCredential(proxyPath);
View Full Code Here

    public GSSCredential renewProxy() throws XregistryException{
      init();
        try {
            String proxyloc = null;
            MyProxy myproxy = new MyProxy( hostname, port );
            GSSCredential proxy =
                myproxy.get(username, password, lifetime);


            GlobusCredential globusCred = null;
            if(proxy instanceof GlobusGSSCredentialImpl) {
View Full Code Here

                    ctx.setPolicy(policy);
                }else{
                    //Use Globous crednatials if it is there
                    try {
                        ctx = new PureTLSContext();
                        GSSCredential gssCredntial = globalContext.getCredential();
                        if(gssCredntial instanceof GlobusGSSCredentialImpl){
                            GlobusCredential globusCred = ((GlobusGSSCredentialImpl)gssCredntial).getGlobusCredential();
                            TrustedCertificates tc = TrustedCertificates.getDefaultTrustedCertificates();
                            if (tc == null)
                            {
View Full Code Here

  public void waitFor() throws InterruptedException,GSSException, GfacException, GramException {
    while (!finished) {
      int proxyExpTime = job.getCredentials().getRemainingLifetime();
      if(proxyExpTime < 900){
        log.info("Job proxy expired. Trying to renew proxy");
        GSSCredential newgssCred = ((GSISecurityContext)executionContext.getSecurityContext()).getGssCredentails();
        job.renew(newgssCred);
      }
      // job status is changed but method isn't invoked
      if (status != 0) {
        if (job.getStatus() != status) {
View Full Code Here

    ExecutionModel model = appExecContext.getExecutionModel();

    GridFtp ftp = new GridFtp();

    try {
      GSSCredential gssCred = ((GSISecurityContext) invocationContext.getSecurityContext(MYPROXY_SECURITY_CONTEXT)).getGssCredentails();

      // get Hostname
      String hostgridFTP = null;

      if (model.getHostDesc().getHostConfiguration().getGridFTPArray() != null && model.getHostDesc().getHostConfiguration().getGridFTPArray().length > 0) {
View Full Code Here

    String rsl = "";
    int errCode = 0;

    try {
      GSSCredential gssCred = ((GSISecurityContext) context.getSecurityContext()).getGssCredentails();

      log.info("Host desc = " + context.getExecutionModel().getHostDesc().xmlText());

      GramAttributes jobAttr = GramRSLGenerator.configureRemoteJob(context);
      rsl = jobAttr.toRSL();
      job = new GramJob(rsl);
      job.setCredentials(gssCred);

      log.info("RSL = " + rsl);

      NotificationService notifier = context.getNotificationService();
      DurationObj compObj = notifier.computationStarted();
      StringBuffer buf = new StringBuffer();

      JobSubmissionListener listener = new JobSubmissionListener(job, context);
      job.addListener(listener);
      log.info("Request to contact:" + contact);
      // The first boolean is to specify the job is a batch job - use true
      // for interactive and false for batch.
      // the second boolean is to specify to use the full proxy and not
      // delegate a limited proxy.
      job.request(contact, false, false);

      log.info("JobID = " + job.getIDAsString());

      // Gram.request(contact, job, false, false);

      buf.append("Finished launching job, Host = ").append(context.getExecutionModel().getHost()).append(" RSL = ").append(job.getRSL()).append("working directory =").append(context.getExecutionModel().getWorkingDir()).append("tempDirectory =").append(context.getExecutionModel().getTmpDir())
          .append("Globus GateKeeper cantact = ").append(contact);
      context.getNotificationService().info(buf.toString());
      String gramJobid = job.getIDAsString();
      context.getNotificationService().info("JobID=" + gramJobid);
      log.info(buf.toString());
      // Send Audit Notifications
      notifier.appAudit(invocationContext.getServiceName(), new URI(job.getIDAsString()), contact, null, null, gssCred.getName().toString(), null, job.getRSL());

      listener.waitFor();
      job.removeListener(listener);

      int jobStatus = listener.getStatus();
      if (jobStatus == GramJob.STATUS_FAILED) {
        errCode = listener.getError();
        // Adding retry for error code to properties files as
        // gfac.retryonJobErrorCodes with comma separated
        if (context.getServiceContext().getGlobalConfiguration().getRetryonErrorCodes().contains(Integer.toString(errCode))) {
          try {
            log.info("Job Failed with Error code " + errCode + " and job id: " + gramJobid);
            log.info("Retry job sumttion one more time for error code" + errCode);
            job = new GramJob(rsl);
            job.setCredentials(gssCred);
            listener = new JobSubmissionListener(job, context);
            job.addListener(listener);
            job.request(contact, false, false);
            String newGramJobid = job.getIDAsString();
            String jobStatusMessage = GfacUtils.formatJobStatus(newGramJobid, "RETRY");
            context.getNotificationService().info(jobStatusMessage);
            context.getNotificationService().info("JobID=" + newGramJobid);
            notifier.appAudit(context.getServiceContext().getService().getService().getServiceName().getStringValue(), new URI(job.getIDAsString()), contact, null, null, gssCred.getName().toString(), null, job.getRSL());
            listener.waitFor();
            job.removeListener(listener);
            int jobStatus1 = listener.getStatus();
            if (jobStatus1 == GramJob.STATUS_FAILED) {
              int errCode1 = listener.getError();
View Full Code Here

        client.setPassive();
        client.setLocalActive();
        //client.setPassiveMode(true);
        client.setType(GridFTPSession.TYPE_IMAGE);
        log.debug("Creating GridFTP Input Stream to: " + host + ":" + port + getName().getPath());
        GSSCredential proxy = (GSSCredential) this.fileSystem.getAttribute(GridFtpFileSystem.CREDENTIAL);
        return new GridFTPInputStream(proxy, host, port, getName().getPath());

    /* // using inner class approach (as commented out below) caused probs.
    InputStreamDataSink sink = new InputStreamDataSink();
    //TransferState state = client.asynchGet(this.relPath, sink, null); // commented out
View Full Code Here

        client.setPassive();
        client.setLocalActive();
        //client.setPassiveMode(true);
        client.setType(GridFTPSession.TYPE_IMAGE);
        log.debug("Creating GridFTP Output Stream to: " + host + ":" + port + getName().getPath());
        GSSCredential proxy = (GSSCredential) this.fileSystem.getAttribute(GridFtpFileSystem.CREDENTIAL);
        return new GridFTPOutputStream(proxy, host, port, getName().getPath(), append);

    /*
    // using inner class approach (as commented out below) caused probs.
    OutputStreamDataSource source = new OutputStreamDataSource(1024);
View Full Code Here

    public void setVomsProxyInit(VomsProxyInit vomsClient) {
        this.vomsClient = vomsClient;
    }

    public GSSCredential getVomsProxy(String subject) throws Exception {
        GSSCredential cred = myproxyClient.get(subject);
        return vomsClient.getVOMSProxy(cred);
    }
View Full Code Here

TOP

Related Classes of org.ietf.jgss.GSSCredential

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.