Package org.apache.maven.scm.provider.jazz.command.consumer

Examples of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer


        {
            getLogger().debug( "Executing status command..." );
        }

        JazzStatusConsumer statusConsumer = new JazzStatusConsumer( repo, getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        JazzScmCommand statusCmd = createStatusCommand( repo, fileSet );
        int status = statusCmd.execute( statusConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new StatusScmResult( statusCmd.getCommandString(),
                                        "Error code for Jazz SCM status command - " + status, errConsumer.getOutput(),
                                        false );
        }

        if ( getLogger().isDebugEnabled() )
        {
View Full Code Here


        {
            getLogger().debug( "Executing update command..." );
        }

        JazzUpdateConsumer updateConsumer = new JazzUpdateConsumer( repo, getLogger() );
        ErrorConsumer err = new ErrorConsumer( getLogger() );

        JazzScmCommand updateCmd = createAcceptCommand( repo, fileSet );
        int status = updateCmd.execute( updateConsumer, err );

        if ( status != 0 || err.hasBeenFed() )
        {
            return new UpdateScmResult( updateCmd.getCommandString(),
                                        "Error code for Jazz SCM update command - " + status, err.getOutput(), false );
        }

        if ( getLogger().isDebugEnabled() )
        {
            if ( !updateConsumer.getUpdatedFiles().isEmpty() )
View Full Code Here

        }

        JazzScmCommand blameCmd = createBlameCommand( repo, fileSet, filename );

        JazzBlameConsumer blameConsumer = new JazzBlameConsumer( repo, getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        int status = blameCmd.execute( blameConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new BlameScmResult( blameCmd.getCommandString(), "Error code for Jazz SCM blame command - " + status,
                                       errConsumer.getOutput(), false );
        }

        return new BlameScmResult( blameCmd.getCommandString(), blameConsumer.getLines() );
    }
View Full Code Here

        {
            getLogger().debug( "Executing edit command..." );
        }

        DebugLoggerConsumer editConsumer = new DebugLoggerConsumer( getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        JazzScmCommand editCmd = createEditCommand( repo, fileSet );
        int status = editCmd.execute( editConsumer, errConsumer );

        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new EditScmResult( editCmd.getCommandString(), "Error code for Jazz SCM edit command - " + status,
                                      errConsumer.getOutput(), false );
        }

        return new EditScmResult( editCmd.getCommandString(), "Successfully Completed.", editConsumer.getOutput(),
                                  true );
    }
View Full Code Here

        {
            getLogger().debug( "Executing unedit command..." );
        }

        DebugLoggerConsumer uneditConsumer = new DebugLoggerConsumer( getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        JazzScmCommand uneditCmd = createUneditCommand( repo, fileSet );
        int status = uneditCmd.execute( uneditConsumer, errConsumer );

        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new UnEditScmResult( uneditCmd.getCommandString(),
                                        "Error code for Jazz SCM unedit command - " + status, errConsumer.getOutput(),
                                        false );
        }

        return new UnEditScmResult( uneditCmd.getCommandString(), "Successfully Completed.", uneditConsumer.getOutput(),
                                    true );
View Full Code Here

        }

        JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;

        JazzListConsumer listConsumer = new JazzListConsumer( repo, getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        JazzScmCommand listCmd = createListCommand( jazzRepo, fileSet, recursive, version );
        int status = listCmd.execute( listConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new ListScmResult( listCmd.getCommandString(), "Error code for Jazz SCM list command - " + status,
                                      errConsumer.getOutput(), false );
        }

        return new ListScmResult( listCmd.getCommandString(), listConsumer.getFiles() );
    }
View Full Code Here

        // of the changeSets from Jazz SCM. It is stored in the revision of the
        // changeSets array.
        List<ChangeSet> changeSets = new ArrayList<ChangeSet>();
        JazzScmCommand historyCommand = createHistoryCommand( repo, fileSet );
        JazzHistoryConsumer changeLogConsumer = new JazzHistoryConsumer( repo, getLogger(), changeSets );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
        int status = historyCommand.execute( changeLogConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new ChangeLogScmResult( historyCommand.getCommandString(),
                                           "Error code for Jazz SCM history command - " + status,
                                           errConsumer.getOutput(), false );
        }

        // Now, call the "scm list changesets" command, passing in the list of changesets from the first pass.
        JazzScmCommand listChangesetsCommand = createListChangesetCommand( repo, fileSet, changeSets );
        JazzListChangesetConsumer listChangesetConsumer =
            new JazzListChangesetConsumer( repo, getLogger(), changeSets, datePattern );
        errConsumer = new ErrorConsumer( getLogger() );
        status = listChangesetsCommand.execute( listChangesetConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new ChangeLogScmResult( listChangesetsCommand.getCommandString(),
                                           "Error code for Jazz SCM list changesets command - " + status,
                                           errConsumer.getOutput(), false );
        }

        // Build the result and return it.
        ChangeLogSet changeLogSet = new ChangeLogSet( changeSets, startDate, endDate );
View Full Code Here

            }
        }

        // Now that we have a list of files to process, we can "add" (scm checkin) them.
        JazzAddConsumer addConsumer = new JazzAddConsumer( repo, getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
        JazzScmCommand command = createAddCommand( repo, fileSet );

        int status = command.execute( addConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new AddScmResult( command.getCommandString(),
                                     "Error code for Jazz SCM add (checkin) command - " + status,
                                     errConsumer.getOutput(), false );
        }

        return new AddScmResult( command.getCommandString(), addConsumer.getFiles() );
    }
View Full Code Here

    {
        JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repository;

        StreamConsumer tckConsumer =
            new DebugLoggerConsumer( getLogger() );      // No need for a dedicated consumer for this
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );
        String nameWorkspace = jazzRepo.getRepositoryWorkspace();
        //String nameSnapshot = "MavenSCMTestSnapshot";
        String nameSnapshot = getSnapshotName();
        JazzScmCommand tckCreateWorkspaceFromSnapshotCmd =
            createCreateWorkspaceFromSnapshotCommand( jazzRepo, fileSet, nameWorkspace, nameSnapshot );
        int status = tckCreateWorkspaceFromSnapshotCmd.execute( tckConsumer, errConsumer );

        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new ScmResult( tckCreateWorkspaceFromSnapshotCmd.getCommandString(),
                                  "Error code for Jazz SCM (create workspace --snapshot) command - " + status,
                                  errConsumer.getOutput(), false );
        }

        return new ScmResult( tckCreateWorkspaceFromSnapshotCmd.getCommandString(), "All ok",
                              ( (DebugLoggerConsumer) tckConsumer ).getOutput(), true );
    }
View Full Code Here

        // Create a changeset. We need to do this, as otherwise the information contained in the message
        // will be lost forever.
        JazzScmCommand createChangesetCmd = createCreateChangesetCommand( repository, fileSet, message );
        DebugLoggerConsumer outputConsumer = new DebugLoggerConsumer( getLogger() );
        ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

        int status = createChangesetCmd.execute( outputConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new CheckInScmResult( createChangesetCmd.getCommandString(),
                                         "Error code for Jazz SCM create changeset command - " + status,
                                         errConsumer.getOutput(), false );
        }

        // Now check in the files themselves.
        return executeCheckInCommand( repository, fileSet, scmVersion );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer

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.