Package org.apache.continuum.web.util

Examples of org.apache.continuum.web.util.AuditLog


        else
        {
            getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId );
        }

        AuditLog event = new AuditLog( "Project Group id=" + projectGroupId, AuditLogConstants.FORCE_BUILD );
        event.setCategory( AuditLogConstants.PROJECT );
        event.setCurrentUser( getPrincipal() );
        event.log();

        if ( this.isFromSummaryPage() )
        {
            return "to_summary_page";
        }
View Full Code Here


    {
        List<BuildDefinition> selectedBuildDefinitions = getBuildDefinitionsFromSelectedBuildDefinitions();
       
        BuildDefinitionTemplate result;
       
        AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.ADD_TEMPLATE );
        event.setCategory( AuditLogConstants.TEMPLATE );
        event.setCurrentUser( getPrincipal() );

        if ( this.buildDefinitionTemplate.getId() > 0 )
        {
            buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
            result = this.getContinuum().getBuildDefinitionService().updateBuildDefinitionTemplate( buildDefinitionTemplate );
            event.setAction( AuditLogConstants.MODIFY_TEMPLATE );
        }
        else
        {
            buildDefinitionTemplate.setBuildDefinitions( selectedBuildDefinitions );
            this.buildDefinitionTemplate =
                this.getContinuum().getBuildDefinitionService().addBuildDefinitionTemplate( buildDefinitionTemplate );
            result = this.buildDefinitionTemplate;
        }
       
        if ( result == null )
        {
            addActionError( getText( "buildDefintionTemplate.name.exists" ) );
            return INPUT;
        }
        else
        {
            event.log();
        }

        return SUCCESS;
    }
View Full Code Here

        if ( confirmed )
        {
            buildDefinitionTemplate = getContinuum().getBuildDefinitionService().getBuildDefinitionTemplate(
                this.buildDefinitionTemplate.getId() );

            AuditLog event = new AuditLog( buildDefinitionTemplate.getName(), AuditLogConstants.REMOVE_TEMPLATE );
            event.setCategory( AuditLogConstants.TEMPLATE );
            event.setCurrentUser( getPrincipal() );
            event.log();

            this.getContinuum().getBuildDefinitionService().removeBuildDefinitionTemplate( buildDefinitionTemplate );
        }
        else
        {
View Full Code Here

        if ( purgeConfigId > 0 )
        {
            purgeConfig = purgeConfigService.getPurgeConfiguration( purgeConfigId );

            AuditLog event;

            if ( purgeConfig instanceof RepositoryPurgeConfiguration )
            {
                RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;

                // check if repository is in use
                if ( taskQueueManager.isRepositoryInUse( repoPurge.getRepository().getId() ) )
                {
                    message = "repository.error.purge.in.use";
                    return ERROR;
                }

                purgeManager.purgeRepository( repoPurge );

                event = new AuditLog( repoPurge.getRepository().getName(), AuditLogConstants.PURGE_LOCAL_REPOSITORY );
                event.setCategory( AuditLogConstants.LOCAL_REPOSITORY );
            }
            else
            {
                DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
                purgeManager.purgeDirectory( dirPurge );

                if ( dirPurge.getDirectoryType().equals( PURGE_DIRECTORY_RELEASES ) )
                {
                    event = new AuditLog( dirPurge.getLocation(), AuditLogConstants.PURGE_DIRECTORY_RELEASES );
                }
                else
                {
                    event = new AuditLog( dirPurge.getLocation(), AuditLogConstants.PURGE_DIRECTORY_BUILDOUTPUT );
                }

                event.setCategory( AuditLogConstants.DIRECTORY );
            }

            event.setCurrentUser( getPrincipal() );
            event.log();
        }

        return SUCCESS;
    }
View Full Code Here

        {
            this.setProjectGroupId( this.getSelectedProjectGroup() );
            return "projectGroupSummary";
        }

        AuditLog event = new AuditLog( "Project id=" + project.getId(), AuditLogConstants.ADD_PROJECT );
        event.setCategory( AuditLogConstants.PROJECT );
        event.setCurrentUser( getPrincipal() );
        event.log();

        return SUCCESS;
    }
View Full Code Here

        project.setScmTag( scmTag );

        getContinuum().updateProject( project );

        AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.MODIFY_PROJECT );
        event.setCategory( AuditLogConstants.PROJECT );
        event.setCurrentUser( getPrincipal() );
        event.log();

        return SUCCESS;
    }
View Full Code Here

    public String saveToProject()
        throws ContinuumException, ProfileException
    {

        AuditLog event = null;
        String resource = "Project id=" + projectId + ":" + goals + " " + arguments;

        try
        {
            if ( buildDefinitionId == 0 )
            {
                checkAddProjectBuildDefinitionAuthorization( getProjectGroupName() );

                getContinuum().addBuildDefinitionToProject( projectId, getBuildDefinitionFromInput() );

                event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
            }
            else
            {
                checkModifyProjectBuildDefinitionAuthorization( getProjectGroupName() );

                getContinuum().updateBuildDefinitionForProject( projectId, getBuildDefinitionFromInput() );

                event = new AuditLog( resource, AuditLogConstants.MODIFY_GOAL );
            }
        }
        catch ( ContinuumActionException cae )
        {
            addActionError( cae.getMessage() );
            return INPUT;
        }
        catch ( AuthorizationRequiredException authzE )
        {
            addActionError( authzE.getMessage() );
            return REQUIRES_AUTHORIZATION;
        }

        event.setCategory( AuditLogConstants.BUILD_DEFINITION );
        event.setCurrentUser( getPrincipal() );
        event.log();

        if ( groupBuildView )
        {
            return "success_group";
        }
View Full Code Here

        }

        if ( projectId != 0 )
        {
            String resource = "Project id=" + projectId + ":" + goals + " " + arguments;
            AuditLog event = null;
            if ( buildDefinitionId == 0 )
            {
                event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
            }
            else
            {
                event = new AuditLog( resource, AuditLogConstants.MODIFY_GOAL );
            }
            event.setCategory( AuditLogConstants.BUILD_DEFINITION );
            event.setCurrentUser( getPrincipal() );
            event.log();
            return SUCCESS;
        }
        else
        {
            String resource = "Project Group id=" + projectGroupId + ":" + goals + " " + arguments;
            AuditLog event = null;
            if ( buildDefinitionId == 0 )
            {
                event = new AuditLog( resource, AuditLogConstants.ADD_GOAL );
            }
            else
            {
                event = new AuditLog( resource, AuditLogConstants.MODIFY_GOAL );
            }
            event.setCategory( AuditLogConstants.BUILD_DEFINITION );
            event.setCurrentUser( getPrincipal() );
            event.log();
            return "success_group";
        }
    }
View Full Code Here

            {
                int projectId = Integer.parseInt( selectedProject );

                try
                {
                    AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.REMOVE_PROJECT );
                    event.setCategory( AuditLogConstants.PROJECT );
                    event.setCurrentUser( getPrincipal() );
                    event.log();

                    getContinuum().removeProject( projectId );
                }
                catch ( ContinuumException e )
                {
View Full Code Here

            {
                int projectId = Integer.parseInt( pId );
                Project p = getContinuum().getProjectWithAllDetails( projectId );
                projectsList.add( p );

                AuditLog event = new AuditLog( "Project id=" + projectId, AuditLogConstants.FORCE_BUILD );
                event.setCategory( AuditLogConstants.PROJECT );
                event.setCurrentUser( getPrincipal() );
                event.log();
            }

            List<Project> sortedProjects = getContinuum().getProjectsInBuildOrder( projectsList );

            try
View Full Code Here

TOP

Related Classes of org.apache.continuum.web.util.AuditLog

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.