Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.Schedule


        }

        Map<Integer, Schedule> schedules = new HashMap<Integer, Schedule>();
        for ( Iterator i = database.getSchedules().iterator(); i.hasNext(); )
        {
            Schedule schedule = (Schedule) i.next();
            schedule.setBuildQueues( getBuildQueuesBySchedule( buildQueues, schedule ) );

            schedule = (Schedule) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), schedule );
            schedules.put( Integer.valueOf( schedule.getId() ), schedule );
        }

        Map<Integer, Installation> installations = new HashMap<Integer, Installation>();
        for ( Iterator i = database.getInstallations().iterator(); i.hasNext(); )
        {
View Full Code Here


        Continuum continuum = (Continuum) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.CONTINUUM );

        ContinuumPurgeManager purgeManager = continuum.getPurgeManager();
       
        Schedule schedule = (Schedule) jobDetail.getJobDataMap().get( ContinuumSchedulerConstants.SCHEDULE );

        try
        {
            purgeManager.purge( schedule );
        }
        catch ( ContinuumPurgeManagerException e )
        {
            logger.error( "Error purging for job" + jobName + ".", e );
        }

        try
        {
            if ( schedule.getDelay() > 0 )
            {
                Thread.sleep( schedule.getDelay() * 1000 );
            }
        }
        catch ( InterruptedException e )
        {
        }
View Full Code Here

    public BuildDefinition addBuildDefinitionToProject( int projectId, BuildDefinition buildDefinition )
        throws ContinuumException
    {
        HashMap<String, Object> context = new HashMap<String, Object>();
        Schedule schedule = buildDefinition.getSchedule();

        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
        AbstractContinuumAction.setProjectId( context, projectId );

        executeAction( "add-build-definition-to-project", context );
View Full Code Here

    public BuildDefinition updateBuildDefinitionForProject( int projectId, BuildDefinition buildDefinition )
        throws ContinuumException
    {
        HashMap<String, Object> context = new HashMap<String, Object>();
        Schedule schedule = buildDefinition.getSchedule();

        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
        AbstractContinuumAction.setProjectId( context, projectId );

        executeAction( "update-build-definition-from-project", context );
View Full Code Here

    public BuildDefinition addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
        throws ContinuumException
    {
        HashMap<String, Object> context = new HashMap<String, Object>();
        Schedule schedule = buildDefinition.getSchedule();

        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
        AbstractContinuumAction.setProjectGroupId( context, projectGroupId );

        executeAction( "add-build-definition-to-project-group", context );
View Full Code Here

    public BuildDefinition updateBuildDefinitionForProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
        throws ContinuumException
    {
        HashMap<String, Object> context = new HashMap<String, Object>();
        Schedule schedule = buildDefinition.getSchedule();

        AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
        AbstractContinuumAction.setProjectGroupId( context, projectGroupId );

        executeAction( "update-build-definition-from-project-group", context );
View Full Code Here

    }

    public void addSchedule( Schedule schedule )
        throws ContinuumException
    {
        Schedule s;

        s = getScheduleByName( schedule.getName() );

        if ( s != null )
        {
            throw logAndCreateException( "Can't create schedule. A schedule with the same name already exists.", null );
        }

        s = scheduleDao.addSchedule( schedule );

        try
        {
            schedulesActivator.activateSchedule( s, this );
        }
        catch ( SchedulesActivationException e )
        {
            throw new ContinuumException( "Error activating schedule " + s.getName() + ".", e );
        }
    }
View Full Code Here

    private void updateSchedule( Schedule schedule, boolean updateScheduler )
        throws ContinuumException
    {

        Schedule old = getSchedule( schedule.getId() );

        storeSchedule( schedule );

        if ( updateScheduler )
        {
View Full Code Here

    }

    public void updateSchedule( int scheduleId, Map<String, String> configuration )
        throws ContinuumException
    {
        Schedule schedule = getSchedule( scheduleId );

        schedule.setName( configuration.get( "schedule.name" ) );

        schedule.setDescription( configuration.get( "schedule.description" ) );

        schedule.setCronExpression( configuration.get( "schedule.cronExpression" ) );

        schedule.setDelay( Integer.parseInt( configuration.get( "schedule.delay" ) ) );

        schedule.setActive( Boolean.valueOf( configuration.get( "schedule.active" ) ) );

        updateSchedule( schedule, true );
    }
View Full Code Here

    }

    public void removeSchedule( int scheduleId )
        throws ContinuumException
    {
        Schedule schedule = getSchedule( scheduleId );

        try
        {
            schedulesActivator.unactivateSchedule( schedule, this );
        }
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.Schedule

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.