Examples of AuditEvent


Examples of org.apache.archiva.audit.AuditEvent

    private MockControl mockAuditListeners()
    {
        MockControl control = MockControl.createControl( AuditListener.class );
        AuditListener listener = (AuditListener) control.getMock();
        listener.auditEvent( new AuditEvent( REPO_ID, "guest", null, AuditEvent.DELETE_MANAGED_REPO ) );
        control.setMatcher( new AuditEventArgumentsMatcher() );
        control.replay();
        action.setAuditListeners( Arrays.asList( listener ) );

        ( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setAuditListeners( Arrays.asList( listener ) );
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

        MockControl control = MockControl.createControl( AuditListener.class );
        AuditListener listener = (AuditListener) control.getMock();
        boolean matcherSet = false;
        for ( String resource : resources )
        {
            listener.auditEvent( new AuditEvent( REPOSITORY_ID, "guest", resource, action ) );
            if ( !matcherSet )
            {
                control.setMatcher( new AuditEventArgumentsMatcher() );
                matcherSet = true;
            }
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

                task.setRepositoryId( repoId );

                repositoryTaskScheduler.queueTask( task );
            }

            AuditEvent event = createAuditEvent( repoConfig );

            // add event for audit log reports
            metadataRepository.addMetadataFacet( event.getRepositoryId(), event );

            // log event in archiva audit log
            auditListener.auditEvent( createAuditEvent( repoConfig ) );
            repositorySession.save();
        }
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

    // todo: setting userid of audit event
    private AuditEvent createAuditEvent( org.apache.archiva.admin.model.beans.ManagedRepository repoConfig )
    {

        AuditEvent event = new AuditEvent();
        event.setAction( AuditEvent.MERGE_REPO_REMOTE );
        event.setRepositoryId( repoConfig.getId() );
        event.setResource( repoConfig.getLocation() );
        event.setTimestamp( new Date() );

        return event;
    }
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

    protected void triggerAuditEvent( String repositoryId, String resource, String action,
                                      AuditInformation auditInformation )
    {
        User user = auditInformation == null ? null : auditInformation.getUser();
        AuditEvent event =
            new AuditEvent( repositoryId, user == null ? "null" : (String) user.getPrincipal(), resource, action );
        event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );

        for ( AuditListener listener : getAuditListeners() )
        {
            listener.auditEvent( event );
        }
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

        {
            return false;
        }
        else
        {
            AuditEvent o1 = (AuditEvent) objects[0];
            AuditEvent o2 = (AuditEvent) objects1[0];
            o2.setTimestamp( o1.getTimestamp() ); // effectively ignore the timestamp
            return o1.equals( o2 );
        }
    }
View Full Code Here

Examples of org.apache.archiva.audit.AuditEvent

        return stagingRepo;
    }

    private AuditEvent createAuditEvent( ManagedRepositoryConfiguration repoConfig )
    {
        AuditEvent auditEvent = new AuditEvent();

        auditEvent.setAction( AuditEvent.MERGE_REPO_REMOTE );
        auditEvent.setRepositoryId( repoConfig.getId() );
        auditEvent.setResource( repoConfig.getLocation() );
        auditEvent.setTimestamp( new Date() );

        return auditEvent;
    }
View Full Code Here

Examples of org.apache.archiva.metadata.model.facets.AuditEvent

        return beans;
    }

    protected void triggerAuditEvent( String repositoryId, String filePath, String action )
    {
        AuditEvent auditEvent = new AuditEvent( repositoryId, getPrincipal(), filePath, action );
        AuditInformation auditInformation = getAuditInformation();
        auditEvent.setUserId( auditInformation.getUser() == null ? "" : auditInformation.getUser().getUsername() );
        auditEvent.setRemoteIP( auditInformation.getRemoteAddr() );
        for ( AuditListener auditListener : getAuditListeners() )
        {
            auditListener.auditEvent( auditEvent );
        }
    }
View Full Code Here

Examples of org.apache.archiva.metadata.model.facets.AuditEvent

        records = records.subList( 0, records.size() < NUM_RECENT_EVENTS ? records.size() : NUM_RECENT_EVENTS );

        List<AuditEvent> events = new ArrayList<>( records.size() );
        for ( AuditRecord record : records )
        {
            AuditEvent auditEvent = (AuditEvent) metadataRepository.getMetadataFacet( record.repositoryId,
                                                                                      AuditEvent.FACET_ID,
                                                                                      record.name );
            events.add( auditEvent );
        }
        return events;
View Full Code Here

Examples of org.apache.archiva.metadata.model.facets.AuditEvent

                {
                    Date date = createNameFormat().parse( name );
                    if ( ( startTime == null || !date.before( startTime ) ) && ( endTime == null || !date.after(
                        endTime ) ) )
                    {
                        AuditEvent event = (AuditEvent) metadataRepository.getMetadataFacet( repositoryId,
                                                                                             AuditEvent.FACET_ID,
                                                                                             name );

                        if ( resource == null || event.getResource().startsWith( resource ) )
                        {
                            results.add( event );
                        }
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.