Package com.mks.api.response

Examples of com.mks.api.response.Response


  public ExceptionHandler(APIException ex)
  {
   
    // API Exceptions can be nested.  Hence we will need to recurse the
    // exception hierarchy to dig for a conclusive message
        Response response = ex.getResponse();

        // Print the stack trace to standard out for debugging purposes
        ex.printStackTrace();
       
    // The API failed to execute the command (i.e. a real API error)
    if( null == response)
    {     
      message = ex.getMessage();
      command = new java.lang.String();
      //exitCode = Integer.parseInt(ex.getExceptionId());
      exitCode = -1;
    }
    else
    {
      command = response.getCommandString();
      try
      {
        exitCode = response.getExitCode();
      }
      catch(InterruptedException ie)
      {
        // Just print out the stack trace
        ie.printStackTrace();
        exitCode = -1;
      }
      WorkItemIterator wit = response.getWorkItems();
      // In the event there is a problem with one of the command's elements
      // we have to dig deeper into the exception...
      try
      {
        while(wit.hasNext()){ wit.next(); }
View Full Code Here


        {
            // 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
            Field pjNameFld = wi.getField( "projectName" );
            Field pjTypeFld = wi.getField( "projectType" );
            Field pjCfgPathFld = wi.getField( "fullConfigSyntax" );
            Field pjChkptFld = wi.getField( "lastCheckpoint" );
View Full Code Here

        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();
        while ( wit.hasNext() )
        {
            WorkItem wi = wit.next();
            if ( wi.getModelType().equals( SIModelTypeName.SI_SUBPROJECT ) )
            {
View Full Code Here

    {
        // First we need to obtain a checkpoint from the current configuration (normal or variant)
        String chkpt = projectRevision;
        if ( !isBuild() )
        {
            Response chkptRes = checkpoint( "Pre-checkpoint for development path " + devPath, devPath + " Baseline" );
            WorkItem wi = chkptRes.getWorkItem( fullConfigSyntax );
            chkpt = wi.getResult().getField( "resultant" ).getItem().getId();
        }

        // Now lets setup the create development path command
        api.getLogger().debug(
View Full Code Here

        {
            // 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
            Field pjNameFld = wi.getField( "projectName" );
            Field pjTypeFld = wi.getField( "projectType" );
            Field pjCfgPathFld = wi.getField( "fullConfigSyntax" );
            Field pjChkptFld = wi.getField( "lastCheckpoint" );
View Full Code Here

        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();
        while ( wit.hasNext() )
        {
            WorkItem wi = wit.next();
            if ( wi.getModelType().equals( SIModelTypeName.SI_SUBPROJECT ) )
            {
View Full Code Here

    {
        // First we need to obtain a checkpoint from the current configuration (normal or variant)
        String chkpt = projectRevision;
        if ( !isBuild() )
        {
            Response chkptRes = checkpoint( "Pre-checkpoint for development path " + devPath, devPath + " Baseline" );
            WorkItem wi = chkptRes.getWorkItem( fullConfigSyntax );
            chkpt = wi.getResult().getField( "resultant" ).getItem().getId();
        }

        // Now lets setup the create development path command
        api.getLogger().debug(
View Full Code Here

        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        UnEditScmResult result;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.revertMembers();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new UnEditScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
View Full Code Here

        RemoveScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        try
        {
            Sandbox siSandbox = iRepo.getSandbox();
            Response res = siSandbox.drop();
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new RemoveScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
View Full Code Here

        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        APISession api = iRepo.getAPISession();
        try
        {
            // First we will establish a connection to the MKS Integrity Server
            Response res = api.connect( iRepo.getHost(), iRepo.getPort(), iRepo.getUser(), iRepo.getPassword() );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            result = new LoginScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );

            // Next we will prepare the Project and Sandbox for the other commands
            Project siProject = new Project( api, iRepo.getConfigruationPath() );
            Sandbox siSandbox = new Sandbox( api, siProject, fileSet.getBasedir().getAbsolutePath() );
            iRepo.setProject( siProject );
View Full Code Here

TOP

Related Classes of com.mks.api.response.Response

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.