Package com.mks.api

Examples of com.mks.api.Command


        // By default we're going to group-by change package
        // Non change package changes will be lumped into one big Change Set
        Hashtable<String, ChangeSet> changeSetHash = new Hashtable<String, ChangeSet>();

        // Lets prepare our si rlog command for execution
        Command siRlog = new Command( Command.SI, "rlog" );
        siRlog.addOption( new Option( "recurse" ) );
        MultiValue rFilter = new MultiValue( ":" );
        rFilter.add( "daterange" );
        rFilter.add( "'" + RLOG_DATEFORMAT.format( startDate ) + "'-'" + RLOG_DATEFORMAT.format( endDate ) + "'" );
        siRlog.addOption( new Option( "rfilter", rFilter ) );
        siRlog.addOption( new Option( "cwd", sandboxDir ) );
        // Execute the si rlog command
        Response response = api.runCommand( siRlog );
        for ( WorkItemIterator wit = response.getWorkItems(); wit.hasNext(); )
        {
            WorkItem wi = wit.next();
View Full Code Here


        if ( !targetFile.getParentFile().isDirectory() )
        {
            targetFile.getParentFile().mkdirs();
        }
        // Construct the project check-co command
        Command coCMD = new Command( Command.SI, "projectco" );
        coCMD.addOption( new Option( overwriteExisting ) );
        coCMD.addOption( new Option( "nolock" ) );
        coCMD.addOption( new Option( "project", projectConfigPath ) );
        coCMD.addOption( new FileOption( "targetFile", targetFile ) );
        coCMD.addOption( new Option( restoreTimestamp ) );
        coCMD.addOption( new Option( "lineTerminator", lineTerminator ) );
        coCMD.addOption( new Option( "revision", memberRev ) );
        // Add the member selection
        coCMD.addSelection( memberID );

        // Execute the checkout command
        Response res = api.runCommand( coCMD );

        // Return true if we were successful
View Full Code Here

        // Initialize our local APISession
        this.api = api;
        try
        {
            // Get the project information for this project
            Command siProjectInfoCmd = new Command( Command.SI, "projectinfo" );
            siProjectInfoCmd.addOption( new Option( "project", configPath ) );
            api.getLogger().info( "Preparing to execute si projectinfo for " + configPath );
            Response infoRes = api.runCommand( siProjectInfoCmd );
            // Get the only work item from the response
            WorkItem wi = infoRes.getWorkItems().next();
            // Get the metadata information about the project
View Full Code Here

        pjConfigHash.put( projectName, fullConfigSyntax );
        // Compute the project root directory
        String projectRoot = projectName.substring( 0, projectName.lastIndexOf( '/' ) );

        // Now, lets parse this project
        Command siViewProjectCmd = new Command( Command.SI, "viewproject" );
        siViewProjectCmd.addOption( new Option( "recurse" ) );
        siViewProjectCmd.addOption( new Option( "project", fullConfigSyntax ) );
        MultiValue mvFields = new MultiValue( "," );
        mvFields.add( "name" );
        mvFields.add( "context" );
        mvFields.add( "memberrev" );
        mvFields.add( "membertimestamp" );
        mvFields.add( "memberdescription" );
        siViewProjectCmd.addOption( new Option( "fields", mvFields ) );
        api.getLogger().info( "Preparing to execute si viewproject for " + fullConfigSyntax );
        Response viewRes = api.runCommand( siViewProjectCmd );

        // Iterate through the list of members returned by the API
        WorkItemIterator wit = viewRes.getWorkItems();
View Full Code Here

        throws APIException
    {
        // Setup the checkpoint command
        api.getLogger().debug( "Checkpointing project " + fullConfigSyntax + " with label '" + tag + "'" );
        // Construct the checkpoint command
        Command siCheckpoint = new Command( Command.SI, "checkpoint" );
        siCheckpoint.addOption( new Option( "recurse" ) );
        // Set the project name
        siCheckpoint.addOption( new Option( "project", fullConfigSyntax ) );
        // Set the label
        siCheckpoint.addOption( new Option( "label", tag ) );
        // Set the description, if specified
        if ( null != message && message.length() > 0 )
        {
            siCheckpoint.addOption( new Option( "description", message ) );
        }
        // Run the checkpoint command
        return api.runCommand( siCheckpoint );
    }
View Full Code Here

        }

        // 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

        if ( !targetFile.getParentFile().isDirectory() )
        {
            targetFile.getParentFile().mkdirs();
        }
        // Construct the project check-co command
        Command coCMD = new Command( Command.SI, "projectco" );
        coCMD.addOption( new Option( overwriteExisting ) );
        coCMD.addOption( new Option( "nolock" ) );
        coCMD.addOption( new Option( "project", projectConfigPath ) );
        coCMD.addOption( new FileOption( "targetFile", targetFile ) );
        coCMD.addOption( new Option( restoreTimestamp ) );
        coCMD.addOption( new Option( "lineTerminator", lineTerminator ) );
        coCMD.addOption( new Option( "revision", memberRev ) );
        // Add the member selection
        coCMD.addSelection( memberID );

        // Execute the checkout command
        Response res = api.runCommand( coCMD );

        // Return true if we were successful
View Full Code Here

        // Initialize our local APISession
        this.api = api;
        try
        {
            // Get the project information for this project
            Command siProjectInfoCmd = new Command( Command.SI, "projectinfo" );
            siProjectInfoCmd.addOption( new Option( "project", configPath ) );
            api.getLogger().info( "Preparing to execute si projectinfo for " + configPath );
            Response infoRes = api.runCommand( siProjectInfoCmd );
            // Get the only work item from the response
            WorkItem wi = infoRes.getWorkItems().next();
            // Get the metadata information about the project
View Full Code Here

        pjConfigHash.put( projectName, fullConfigSyntax );
        // Compute the project root directory
        String projectRoot = projectName.substring( 0, projectName.lastIndexOf( '/' ) );

        // Now, lets parse this project
        Command siViewProjectCmd = new Command( Command.SI, "viewproject" );
        siViewProjectCmd.addOption( new Option( "recurse" ) );
        siViewProjectCmd.addOption( new Option( "project", fullConfigSyntax ) );
        MultiValue mvFields = new MultiValue( "," );
        mvFields.add( "name" );
        mvFields.add( "context" );
        mvFields.add( "memberrev" );
        mvFields.add( "membertimestamp" );
        mvFields.add( "memberdescription" );
        siViewProjectCmd.addOption( new Option( "fields", mvFields ) );
        api.getLogger().info( "Preparing to execute si viewproject for " + fullConfigSyntax );
        Response viewRes = api.runCommand( siViewProjectCmd );

        // Iterate through the list of members returned by the API
        WorkItemIterator wit = viewRes.getWorkItems();
View Full Code Here

        throws APIException
    {
        // Setup the checkpoint command
        api.getLogger().debug( "Checkpointing project " + fullConfigSyntax + " with label '" + tag + "'" );
        // Construct the checkpoint command
        Command siCheckpoint = new Command( Command.SI, "checkpoint" );
        siCheckpoint.addOption( new Option( "recurse" ) );
        // Set the project name
        siCheckpoint.addOption( new Option( "project", fullConfigSyntax ) );
        // Set the label
        siCheckpoint.addOption( new Option( "label", tag ) );
        // Set the description, if specified
        if ( null != message && message.length() > 0 )
        {
            siCheckpoint.addOption( new Option( "description", message ) );
        }
        // Run the checkpoint command
        return api.runCommand( siCheckpoint );
    }
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.