Package org.apache.airavata.gfac.gsissh.security

Examples of org.apache.airavata.gfac.gsissh.security.TokenizedMyProxyAuthInfo


            RequestData requestData = new RequestData(ServerSettings.getDefaultUserGateway());
            requestData.setTokenId(credentialStoreToken);
            PBSCluster pbsCluster = null;
            GSISecurityContext context = null;
            try {
                TokenizedMyProxyAuthInfo tokenizedMyProxyAuthInfo = new TokenizedMyProxyAuthInfo(requestData);
                GsisshHostType gsisshHostType = (GsisshHostType) registeredHost.getType();
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress(),
                        gsisshHostType.getPort());

                JobManagerConfiguration jConfig = null;
                String installedParentPath = ((HpcApplicationDeploymentType)
                        jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
                String jobManager = ((GsisshHostType) registeredHost.getType()).getJobManager();
                if (jobManager == null) {
                    logger.error("No Job Manager is configured, so we are picking pbs as the default job manager");
                    jConfig = CommonUtils.getPBSJobManager(installedParentPath);
                } else {
                    if (PBS_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getPBSJobManager(installedParentPath);
                    } else if (SLURM_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getSLURMJobManager(installedParentPath);
                    } else if (SUN_GRID_ENGINE_JOB_MANAGER.equalsIgnoreCase(jobManager)) {
                        jConfig = CommonUtils.getSGEJobManager(installedParentPath);
                    }
                }
                pbsCluster = new PBSCluster(serverInfo, tokenizedMyProxyAuthInfo, jConfig);
                context = new GSISecurityContext(tokenizedMyProxyAuthInfo.getCredentialReader(), requestData,pbsCluster);
            } catch (Exception e) {
                throw new GFacException("An error occurred while creating GSI security context", e);
            }
            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
        }
View Full Code Here


        DerbyUtil.stopDerbyServer();
    }

    private GSSCredential getGSSCredentials() throws Exception {

        TokenizedMyProxyAuthInfo gsiTokenizedMyProxyAuthInfo = getGSISecurityContext();
        return gsiTokenizedMyProxyAuthInfo.getCredentials();
    }
View Full Code Here

        requestData.setMyProxyPassword(password);
        requestData.setMyProxyServerUrl(ServerSettings.getMyProxyServer());
        requestData.setMyProxyLifeTime(ServerSettings.getMyProxyLifetime());
        CredentialReader credentialReader = CredentialReaderFactory.createCredentialStoreReader(getDbUtil());

        return new TokenizedMyProxyAuthInfo(requestData);
    }
View Full Code Here

    } */

    @Test
    public void testGetDefaultCredentials() throws Exception {
        TokenizedMyProxyAuthInfo gsiSecurityContext = getGSISecurityContext();
        Assert.assertNotNull(gsiSecurityContext.getDefaultCredentials());

    }
View Full Code Here

    }

    @Test
    public void testGetProxyCredentials() throws Exception {
        TokenizedMyProxyAuthInfo gsiSecurityContext = getGSISecurityContext();
        Assert.assertNotNull(gsiSecurityContext.getProxyCredentials());

    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.gfac.gsissh.security.TokenizedMyProxyAuthInfo

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.