Package org.apache.airavata.gfac

Examples of org.apache.airavata.gfac.RequestData


        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) {
            String credentialStoreToken = jobExecutionContext.getCredentialStoreToken(); // this is set by the framework
            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();
View Full Code Here


        return gsiTokenizedMyProxyAuthInfo.getCredentials();
    }

    private TokenizedMyProxyAuthInfo getGSISecurityContext() throws Exception {

        RequestData requestData = new RequestData();

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

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

                || registeredHost.getType() instanceof GsisshHostType) {
            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 SSHHostType) {
            SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
            String credentialStoreToken = jobExecutionContext.getCredentialStoreToken(); // this is set by the framework
            RequestData requestData = new RequestData(ServerSettings.getDefaultUserGateway());
            requestData.setTokenId(credentialStoreToken);

            ServerInfo serverInfo = new ServerInfo(null, registeredHost.getType().getHostAddress());

            Cluster pbsCluster = null;
            try {
View Full Code Here

        return gsiSecurityContext.getGssCredentials();
    }

    private GSISecurityContext getGSISecurityContext() throws Exception {

        RequestData requestData = new RequestData();

        requestData.setMyProxyUserName(userName);
        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

    public static final String PBS_JOB_MANAGER = "pbs";
    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;
View Full Code Here

        return null;
    }

    private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
                                    JobExecutionContext jobExecutionContext, ContextHeaderDocument.ContextHeader contextHeader) throws WorkflowException {
        RequestData requestData;
            /* todo fix the credential store and uncomment following code block
            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
                    = getCredentialManagementService(contextHeader);

            GSISecurityContext context;


            if (credentialManagementService != null) {
                String gatewayId = credentialManagementService.getGatewayId();
                String tokenId
                        = credentialManagementService.getTokenId();
                String portalUser = credentialManagementService.getPortalUser();

                requestData = new RequestData(tokenId, portalUser, gatewayId);
            } else {
                requestData = new RequestData("default");
            }

            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }
            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));
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());

                Cluster pbsCluster = null;
                try {
                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
                            (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
                } catch (SSHApiException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }

                context.setPbsCluster(pbsCluster);
            }
            */
            requestData = new RequestData("default");
            GSISecurityContext context;
            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }

            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));
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());

                Cluster pbsCluster = null;
                try {
                    String installedParentPath = ((HpcApplicationDeploymentType)
                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
View Full Code Here

    }

    public GSISecurityContext getSecurityContext() throws Exception {
        GSISecurityContext.setUpTrustedCertificatePath(System.getProperty("gsi.certificate.path"));
        RequestData requestData = new RequestData();
        requestData.setMyProxyServerUrl("myproxy.teragrid.org");
        requestData.setMyProxyUserName(System.getProperty("myproxy.user"));
        requestData.setMyProxyPassword(System.getProperty("myproxy.password"));
        requestData.setMyProxyLifeTime(3600);
        CredentialReader credentialReader = new CredentialReaderImpl(getDbUtil());
        return new GSISecurityContext(credentialReader, requestData);
    }
View Full Code Here

    }

    public GSISecurityContext getSecurityContext() throws Exception {
        GSISecurityContext.setUpTrustedCertificatePath("/Users/raminder/.globus/certificates");
        RequestData requestData = new RequestData();
        requestData.setMyProxyServerUrl("myproxy.teragrid.org");
        requestData.setMyProxyUserName("******");
        requestData.setMyProxyPassword("*******");
        requestData.setMyProxyLifeTime(3600);
        CredentialReader credentialReader = new CredentialReaderImpl(getDbUtil());
        return new GSISecurityContext(credentialReader, requestData);
    }
View Full Code Here

        return gsiSecurityContext.getGssCredentials();
    }

    private GSISecurityContext getGSISecurityContext() throws Exception {

        RequestData requestData = new RequestData();

        requestData.setMyProxyUserName(userName);
        requestData.setMyProxyPassword(password);

        CredentialReader credentialReader = CredentialReaderFactory.createCredentialStoreReader(getDbUtil());

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

        return null;
    }

    private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
                                    JobExecutionContext jobExecutionContext, ContextHeaderDocument.ContextHeader contextHeader) throws WorkflowException {
        RequestData requestData;
        if (registeredHost.getType() instanceof GlobusHostType || registeredHost.getType() instanceof UnicoreHostType
                || registeredHost.getType() instanceof GsisshHostType) {

            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
                    = getCredentialManagementService(contextHeader);

            GSISecurityContext context;


            if (credentialManagementService != null) {
                String gatewayId = credentialManagementService.getGatewayId();
                String tokenId
                        = credentialManagementService.getTokenId();
                String portalUser = credentialManagementService.getPortalUser();

                requestData = new RequestData(tokenId, portalUser, gatewayId);
            } else {
               requestData = new RequestData("default");
            }

            try {
                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
            } catch (Exception e) {
                throw new WorkflowException("An error occurred while creating GSI security context", e);
            }
            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));
                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());

                Cluster pbsCluster = null;
                try {
                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
                            (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
View Full Code Here

TOP

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

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.