Examples of GSISecurityContext


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


    public ResourceConnection(HostMonitorData hostMonitorData,AuthenticationInfo authInfo) throws SSHApiException {
        MonitorID monitorID = hostMonitorData.getMonitorIDs().get(0);
        try {
            GSISecurityContext securityContext = (GSISecurityContext) monitorID.getJobExecutionContext().getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);
            if(securityContext != null) {
                cluster = (PBSCluster) securityContext.getPbsCluster();
            }else {
                SSHSecurityContext sshSecurityContext = (SSHSecurityContext) monitorID.getJobExecutionContext().getSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT);
                cluster = (PBSCluster)sshSecurityContext.getPbsCluster();
            }
View Full Code Here

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

    }

    public ResourceConnection(HostMonitorData hostMonitorData) throws SSHApiException {
        MonitorID monitorID = hostMonitorData.getMonitorIDs().get(0);
        try {
            GSISecurityContext securityContext = (GSISecurityContext) monitorID.getJobExecutionContext().getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);
            cluster = (PBSCluster) securityContext.getPbsCluster();

            // we just use cluster configuration from the incoming request and construct a new cluster because for monitoring
            // we are using our own credentials and not using one users account to do everything.
            cluster = new PBSCluster(cluster.getServerInfo(), authenticationInfo, cluster.getJobManagerConfiguration());
        } catch (GFacException e) {
View Full Code Here

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


    public ResourceConnection(HostMonitorData hostMonitorData) throws SSHApiException {
        MonitorID monitorID = hostMonitorData.getMonitorIDs().get(0);
        try {
            GSISecurityContext securityContext = (GSISecurityContext)monitorID.getJobExecutionContext().getSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT);
            cluster = (PBSCluster)securityContext.getPbsCluster();
        } catch (GFacException e) {
            log.error("Error reading data from job ExecutionContext");
        }
    }
View Full Code Here

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

        try {
            pbsCluster = new PBSCluster(serverInfo, authenticationInfo, CommonUtils.getPBSJobManager(app.getInstalledParentPath()));
        } catch (SSHApiException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
        GSISecurityContext sshSecurityContext = new GSISecurityContext(pbsCluster);
        return sshSecurityContext;
    }
View Full Code Here

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

        DerbyUtil.stopDerbyServer();
    }

    private GSSCredential getGSSCredentials() throws Exception {

        GSISecurityContext gsiSecurityContext = getGSISecurityContext();

        return gsiSecurityContext.getGssCredentials();
    }
View Full Code Here

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

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

        return new GSISecurityContext(credentialReader, requestData);
    }
View Full Code Here

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

    } */

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

    }
View Full Code Here

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

    }

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

    }
View Full Code Here

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

    public static final String SLURM_JOB_MANAGER = "slurm";
    public static final String SUN_GRID_ENGINE_JOB_MANAGER = "sge";

    public static void addSecurityContext(JobExecutionContext jobExecutionContext) throws GFacException, ApplicationSettingsException {
        RequestData requestData = new RequestData("default");
        GSISecurityContext context = null;
        try {
            //todo fix this
            context = new GSISecurityContext(null, requestData);
        } catch (Exception e) {
            throw new GFacException("An error occurred while creating GSI security context", e);
        }
        HostDescription registeredHost = jobExecutionContext.getApplicationContext().getHostDescription();
        if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType
                || registeredHost.getType() instanceof SSHHostType) {
            logger.error("This is a wrong method to invoke to non ssh host types,please check your gfac-config.xml");
        } else if (registeredHost.getType() instanceof GsisshHostType) {
            GSIAuthenticationInfo authenticationInfo
                    = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
                    requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
            GsisshHostType gsisshHostType = (GsisshHostType) registeredHost.getType();
            ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress(),
                    gsisshHostType.getPort());

            Cluster pbsCluster = null;
            try {
                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, authenticationInfo, jConfig);
            } catch (SSHApiException e) {
               throw new GFacException("An error occurred while creating GSI security context", e);
            }

            context.setPbsCluster(pbsCluster);
        }
        jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT,context);
    }
View Full Code Here

Examples of org.ogce.gfac.context.impl.GSISecurityContext

      InvocationContext ct = new InvocationContext();
      ct.setExecutionContext(new ExecutionContextImpl());
           
      ct.getExecutionContext().setNotificationService(new DummyNotification());

      GSISecurityContext gsiSecurityContext = new GSISecurityContext();
      gsiSecurityContext.setMyproxyServer("myproxy.teragrid.org");
      gsiSecurityContext.setMyproxyUserName("ogce");
      gsiSecurityContext.setMyproxyPasswd("Jdas7wph");
      gsiSecurityContext.setMyproxyLifetime(14400);     
      ct.addSecurityContext("myproxy", gsiSecurityContext);     
     
      ct.setServiceName("{http://www.extreme.indiana.edu/namespaces/2004/01/gFac}Echo_Service");
     
      //parameter
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.