Package com.mks.api

Examples of com.mks.api.Command


        }

        // Now lets setup the create development path command
        api.getLogger().debug(
            "Creating development path '" + devPath + "' for project " + projectName + " at revision '" + chkpt + "'" );
        Command siCreateDevPath = new Command( Command.SI, "createdevpath" );
        siCreateDevPath.addOption( new Option( "devpath", devPath ) );
        // Set the project name
        siCreateDevPath.addOption( new Option( "project", projectName ) );
        // Set the checkpoint we want to create the development path from
        siCreateDevPath.addOption( new Option( "projectRevision", chkpt ) );
        // Run the create development path command
        return api.runCommand( siCreateDevPath );
    }
View Full Code Here


        {
            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 );
View Full Code Here

     * @throws APIException
     */
    private boolean isValidSandbox( String sandbox )
        throws APIException
    {
        Command cmd = new Command( Command.SI, "sandboxinfo" );
        cmd.addOption( new Option( "sandbox", sandbox ) );

        api.getLogger().debug( "Validating existing sandbox: " + sandbox );
        Response res = api.runCommand( cmd );
        WorkItemIterator wit = res.getWorkItems();
        try
View Full Code Here

    private Response add( File memberFile, String message )
        throws APIException
    {
        // Setup the add command
        api.getLogger().info( "Adding member: " + memberFile.getAbsolutePath() );
        Command siAdd = new Command( Command.SI, "add" );
        siAdd.addOption( new Option( "onExistingArchive", "sharearchive" ) );
        siAdd.addOption( new Option( "cpid", cpid ) );
        if ( null != message && message.length() > 0 )
        {
            siAdd.addOption( new Option( "description", message ) );
        }
        siAdd.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        siAdd.addSelection( memberFile.getName() );
        return api.runCommand( siAdd );
    }
View Full Code Here

    private Response checkin( File memberFile, String relativeName, String message )
        throws APIException
    {
        // Setup the check-in command
        api.getLogger().info( "Checking in member:  " + memberFile.getAbsolutePath() );
        Command sici = new Command( Command.SI, "ci" );
        sici.addOption( new Option( "cpid", cpid ) );
        if ( null != message && message.length() > 0 )
        {
            sici.addOption( new Option( "description", message ) );
        }
        sici.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        sici.addSelection( relativeName );
        return api.runCommand( sici );
    }
View Full Code Here

    private Response dropMember( File memberFile, String relativeName )
        throws APIException
    {
        // Setup the drop command
        api.getLogger().info( "Dropping member " + memberFile.getAbsolutePath() );
        Command siDrop = new Command( Command.SI, "drop" );
        siDrop.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        siDrop.addOption( new Option( "noconfirm" ) );
        siDrop.addOption( new Option( "cpid", cpid ) );
        siDrop.addOption( new Option( "delete" ) );
        siDrop.addSelection( relativeName );
        return api.runCommand( siDrop );
    }
View Full Code Here

     * @return MKS API Response object
     */
    private boolean hasMemberChanged( File memberFile, String relativeName )
    {
        // Setup the differences command
        Command siDiff = new Command( Command.SI, "diff" );
        siDiff.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        siDiff.addSelection( relativeName );
        try
        {
            // Run the diff command...
            Response res = api.runCommand( siDiff );
            try
View Full Code Here

    public Response lock( File memberFile, String relativeName )
        throws APIException
    {
        // Setup the lock command
        api.getLogger().debug( "Locking member: " + memberFile.getAbsolutePath() );
        Command siLock = new Command( Command.SI, "lock" );
        siLock.addOption( new Option( "revision", ":member" ) );
        siLock.addOption( new Option( "cpid", cpid ) );
        siLock.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        siLock.addSelection( relativeName );
        // Execute the lock command
        return api.runCommand( siLock );
    }
View Full Code Here

    public Response unlock( File memberFile, String relativeName )
        throws APIException
    {
        // Setup the unlock command
        api.getLogger().debug( "Unlocking member: " + memberFile.getAbsolutePath() );
        Command siUnlock = new Command( Command.SI, "unlock" );
        siUnlock.addOption( new Option( "revision", ":member" ) );
        siUnlock.addOption( new Option( "action", "remove" ) );
        siUnlock.addOption( new Option( "cwd", memberFile.getParentFile().getAbsolutePath() ) );
        siUnlock.addSelection( relativeName );
        // Execute the unlock command
        return api.runCommand( siUnlock );
    }
View Full Code Here

        File project = new File( siProject.getProjectName() );
        File sandboxpj = new File( sandboxDir + fs + project.getName() );

        // Check to see if the sandbox file already exists and its OK to use
        api.getLogger().debug( "Sandbox Project File: " + sandboxpj.getAbsolutePath() );
        Command cmd = new Command( Command.SI, "dropsandbox" );
        cmd.addOption( new Option( "delete", "members" ) );
        cmd.addOption( new Option( "sandbox", sandboxpj.getAbsolutePath() ) );
        cmd.addOption( new Option( "cwd", sandboxDir ) );
        return api.runCommand( cmd );
    }
View Full Code Here

TOP

Related Classes of com.mks.api.Command

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.