Package org.apache.continuum.taskqueue

Examples of org.apache.continuum.taskqueue.CheckOutTask


    public void executeTask( Task t )
        throws TaskExecutionException
    {
        log.info( "Checkout task executor.." );

        CheckOutTask task = (CheckOutTask) t;

        int projectId = task.getProjectId();

        Project project;

        try
        {
            project = projectDao.getProjectWithBuildDetails( projectId );
        }
        catch ( ContinuumStoreException ex )
        {
            log.error( "Internal error while getting the project.", ex );

            return;
        }

        String workingDirectory = task.getWorkingDirectory().getAbsolutePath();

        Map<String, Object> context = new HashMap<String, Object>();

        AbstractContinuumAction.setProjectId( context, projectId );

        AbstractContinuumAction.setProject( context, project );

        AbstractContinuumAction.setWorkingDirectory( context, workingDirectory );

        CheckoutProjectContinuumAction.setScmUsername( context, task.getScmUserName() );

        CheckoutProjectContinuumAction.setScmPassword( context, task.getScmPassword() );

        AbstractContinuumAction.setProjectScmRootUrl( context, task.getScmRootUrl() );

        AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( context,
                                                                           task.getProjectsWithCommonScmRoot() );

        try
        {
            actionManager.lookup( "checkout-project" ).execute( context );
View Full Code Here


                // current checkouts
                Map<String, CheckOutTask> currentCheckouts = getContinuum().getBuildsManager().getCurrentCheckouts();
                Set<String> keySet = currentCheckouts.keySet();
                for ( String key : keySet )
                {
                    CheckOutTask checkoutTask = currentCheckouts.get( key );
                    CheckoutQueue queue = new CheckoutQueue();
                    queue.setName( key );
                    queue.setTask( checkoutTask );
                    currentCheckoutTasks.add( queue );
                }
View Full Code Here

        if ( tasks != null )
        {
            Set<String> keySet = tasks.keySet();
            for ( String key : keySet )
            {
                CheckOutTask task = tasks.get( key );
                if ( task != null )
                {
                    if ( task.getProjectId() == projectId )
                    {
                        logger.info( "Cancelling checkout for project " + projectId );
                        return getContinuum().getBuildsManager().cancelCheckout( projectId );
                    }
                    else
                    {
                        logger.warn(
                            "Current task is not for the given projectId (" + projectId + "): " + task.getProjectId() +
                                "; not cancelling checkout" );
                    }
                }
            }
        }
View Full Code Here

                // current checkouts
                Map<String, CheckOutTask> currentCheckouts = getContinuum().getBuildsManager().getCurrentCheckouts();
                Set<String> keySet = currentCheckouts.keySet();
                for ( String key : keySet )
                {
                    CheckOutTask checkoutTask = currentCheckouts.get( key );
                    CheckoutQueue queue = new CheckoutQueue();
                    queue.setName( key );
                    queue.setTask( checkoutTask );
                    currentCheckoutTasks.add( queue );
                }
View Full Code Here

        if ( tasks != null )
        {
            Set<String> keySet = tasks.keySet();
            for ( String key : keySet )
            {
                CheckOutTask task = tasks.get( key );
                if ( task != null )
                {
                    if ( task.getProjectId() == projectId )
                    {
                        logger.info( "Cancelling checkout for project " + projectId );
                        return getContinuum().getBuildsManager().cancelCheckout( projectId );
                    }
                    else
                    {
                        logger.warn(
                            "Current task is not for the given projectId (" + projectId + "): " + task.getProjectId() +
                                "; not cancelling checkout" );
                    }
                }
            }
        }
View Full Code Here

                {
                    Set<Integer> keySet = overallBuildQueues.keySet();
                    for ( Integer key : keySet )
                    {
                        overallBuildQueue = overallBuildQueues.get( key );
                        CheckOutTask checkoutTask =
                            (CheckOutTask) overallBuildQueue.getCheckoutTaskQueueExecutor().getCurrentTask();
                        if ( checkoutTask != null && checkoutTask.getProjectId() == projectId )
                        {
                            overallBuildQueue.cancelCheckoutTask( projectId );
                            return true;
                        }
                    }
View Full Code Here

                "Error occurred while checking if the project is already in queue: " + e.getMessage() );
        }

        OverallBuildQueue overallBuildQueue =
            getOverallBuildQueue( CHECKOUT_QUEUE, defaultBuildDefinition.getSchedule().getBuildQueues() );
        CheckOutTask checkoutTask =
            new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword );
        try
        {
            if ( overallBuildQueue != null )
            {
                log.info( "Project '" + projectName + "' added to overall build queue '" + overallBuildQueue.getName() +
View Full Code Here

        {
            Map<String, CheckOutTask> checkouts = getCurrentCheckouts();
            Set<String> keySet = checkouts.keySet();
            for ( String key : keySet )
            {
                CheckOutTask task = checkouts.get( key );
                if ( task.getProjectId() == projectId )
                {
                    return true;
                }
            }
        }
View Full Code Here

            Map<String, CheckOutTask> currentCheckouts = new HashMap<String, CheckOutTask>();
            Set<Integer> keys = overallBuildQueues.keySet();
            for ( Integer key : keys )
            {
                OverallBuildQueue overallBuildQueue = overallBuildQueues.get( key );
                CheckOutTask task = (CheckOutTask) overallBuildQueue.getCheckoutTaskQueueExecutor().getCurrentTask();
                if ( task != null )
                {
                    currentCheckouts.put( overallBuildQueue.getName(), task );
                }
            }
View Full Code Here

        throws BuildManagerException
    {
        Map<String, CheckOutTask> checkouts = getCurrentCheckouts();
        for( String key : checkouts.keySet() )
        {
            CheckOutTask task = checkouts.get( key );
            if( task.getProjectId() == projectId )
            {
                return true;
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.continuum.taskqueue.CheckOutTask

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.