Examples of CmdRunner


Examples of com.mks.api.CmdRunner

            logger.info( "Using a common session.  Connection information is obtained from client preferences" );
            session = ip.getCommonSession();
        }
        // Test the connection to the MKS Integrity Server
        Command ping = new Command( Command.SI, "connect" );
        CmdRunner cmdRunner = session.createCmdRunner();
        // Initialize the command runner with valid connection information
        if ( null != host && host.length() > 0 )
        {
            cmdRunner.setDefaultHostname( host );
        }
        if ( portNum > 0 )
        {
            cmdRunner.setDefaultPort( portNum );
        }
        if ( null != user && user.length() > 0 )
        {
            cmdRunner.setDefaultUsername( user );
        }
        if ( null != paswd && paswd.length() > 0 )
        {
            cmdRunner.setDefaultPassword( paswd );
        }
        // Execute the connection
        Response res = cmdRunner.execute( ping );
        logger.debug( res.getCommandString() + " returned exit code " + res.getExitCode() );
        // Initialize class variables based on the connection information
        hostName = res.getConnectionHostname();
        port = res.getConnectionPort();
        userName = res.getConnectionUsername();
        password = paswd;
        cmdRunner.release();
        logger.info( "Successfully established connection " + userName + "@" + hostName + ":" + port );
        return res;
    }
View Full Code Here

Examples of com.mks.api.CmdRunner

            logger.info( "Using a common session.  Connection information is obtained from client preferences" );
            session = ip.getCommonSession();
        }
        // Test the connection to the MKS Integrity Server
        Command ping = new Command( Command.SI, "connect" );
        CmdRunner cmdRunner = session.createCmdRunner();
        // Initialize the command runner with valid connection information
        if ( null != host && host.length() > 0 )
        {
            cmdRunner.setDefaultHostname( host );
        }
        if ( portNum > 0 )
        {
            cmdRunner.setDefaultPort( portNum );
        }
        if ( null != user && user.length() > 0 )
        {
            cmdRunner.setDefaultUsername( user );
        }
        if ( null != paswd && paswd.length() > 0 )
        {
            cmdRunner.setDefaultPassword( paswd );
        }
        // Execute the connection
        Response res = cmdRunner.execute( ping );
        logger.debug( res.getCommandString() + " returned exit code " + res.getExitCode() );
        // Initialize class variables based on the connection information
        hostName = res.getConnectionHostname();
        port = res.getConnectionPort();
        userName = res.getConnectionUsername();
        password = paswd;
        cmdRunner.release();
        logger.info( "Successfully established connection " + userName + "@" + hostName + ":" + port );
        return res;
    }
View Full Code Here

Examples of com.mks.api.CmdRunner

     * @throws APIException
     */
    public Response runCommand( Command cmd )
        throws APIException
    {
        CmdRunner cmdRunner = session.createCmdRunner();
        cmdRunner.setDefaultHostname( hostName );
        cmdRunner.setDefaultPort( port );
        cmdRunner.setDefaultUsername( userName );
        if ( null != password && password.length() > 0 )
        {
            cmdRunner.setDefaultPassword( password );
        }
        Response res = cmdRunner.execute( cmd );
        logger.debug( res.getCommandString() + " returned exit code " + res.getExitCode() );
        cmdRunner.release();
        return res;
    }
View Full Code Here

Examples of com.mks.api.CmdRunner

     * @throws APIException
     */
    public Response runCommandAs( Command cmd, String impersonateUser )
        throws APIException
    {
        CmdRunner cmdRunner = session.createCmdRunner();
        cmdRunner.setDefaultHostname( hostName );
        cmdRunner.setDefaultPort( port );
        cmdRunner.setDefaultUsername( userName );
        if ( null != password && password.length() > 0 )
        {
            cmdRunner.setDefaultPassword( password );
        }
        cmdRunner.setDefaultImpersonationUser( impersonateUser );
        Response res = cmdRunner.execute( cmd );
        logger.debug( res.getCommandString() + " returned exit code " + res.getExitCode() );
        cmdRunner.release();
        return res;
    }
View Full Code Here

Examples of org.trifort.rootbeer.util.CmdRunner

      String nvcc_path = cuda_path.get();
      cmd[0] = nvcc_path;
      cmd[1] = "--version";
    }
   
    CmdRunner runner = new CmdRunner();
    runner.run(cmd, new File("."));
    List<String> lines = runner.getOutput();
    if(lines.isEmpty()){
      List<String> error_lines = runner.getError();
      for(String error_line : error_lines){
        System.out.println(error_line);
      }
      throw new RuntimeException("error detecting nvcc version.");
    }
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.