Package com.mks.api

Examples of com.mks.api.CmdRunner


    return MksBundle.message("action.checkin");
  }

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("ci");
        command.addOption(new Option("gui"));
        for (int i = 0; i < members.length; i++) {
            String member = members[i];
            command.addSelection(member);
        }

        runner.execute(command);
    }
View Full Code Here


public class ViewSandboxAPICommand extends AbstractSingleTargetAPICommand {
  private final Logger LOGGER = Logger.getInstance(getClass().getName());

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("viewsandbox");
        command.addOption(new Option("gui"));
        command.addOption(new Option("sandbox", sandbox.sandboxPath));

        runner.execute(command);
    }
View Full Code Here

    return MksBundle.message("action.differences");
  }

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("diff");
        command.addOption(new Option("gui"));
        for (int i = 0; i < members.length; i++) {
            String member = members[i];
            command.addSelection(member);
        }

        runner.execute(command);
    }
View Full Code Here

    return MksBundle.message("action.member.information");
  }

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("memberinfo");
        command.addOption(new Option("gui"));
        for (int i = 0; i < members.length; i++) {
            String member = members[i];
            command.addSelection(member);
        }

        runner.execute(command);
    }
View Full Code Here

    return MksBundle.message("action.checkout.members");
  }

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("co");
        command.addOption(new Option("gui"));
        for (int i = 0; i < members.length; i++) {
            String member = members[i];
            command.addSelection(member);
        }

        runner.execute(command);
    }
View Full Code Here

    return MksBundle.message("action.drop");
  }

    @Override
    protected void perform(@NotNull MksSandboxInfo sandbox, String[] members) throws APIException {
        final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
        Command command = new Command(Command.SI);
        command.setCommandName("drop");
        command.addOption(new Option("gui"));
        for (int i = 0; i < members.length; i++) {
            String member = members[i];
            command.addSelection(member);
        }

        runner.execute(command);
  }
View Full Code Here

public class AboutMksAPICommand extends AbstractAPICommand {

    public void executeCommand(@NotNull final MksVcs mksVcs, @NotNull List<VcsException> exceptions,
                               @NotNull VirtualFile[] affectedFiles) throws VcsException {
        try {
            final CmdRunner runner = MKSAPIHelper.getInstance().getSession().createCmdRunner();
            Command command = new Command(Command.SI);
            command.setCommandName("about");
            command.addOption(new Option("gui"));
            runner.execute(command);
        } catch (APIException e) {
            ArrayList<VcsException> errors = new ArrayList<VcsException>();
            //noinspection ThrowableInstanceNeverThrown
            errors.add(new VcsException(e));
            MksVcs.getInstance(mksVcs.getProject()).showErrors(errors, "About MKS");
View Full Code Here

    }

    @Override
    public void actionPerformed(final AnActionEvent anActionEvent) {
        try {
            final CmdRunner runner =  MKSAPIHelper.getInstance().getSession().createCmdRunner();
            Command command = new Command(Command.SI);
            command.setCommandName("viewprefs");
            command.addOption(new Option("gui"));
            runner.execute(command);
        } catch (APIException e) {
            final Project project = PlatformDataKeys.PROJECT.getData(anActionEvent.getDataContext());
            ArrayList<VcsException> errors = new ArrayList<VcsException>();
            //noinspection ThrowableInstanceNeverThrown
            errors.add(new VcsException(e));
View Full Code Here

     * @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

     * @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

TOP

Related Classes of com.mks.api.CmdRunner

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.