Search in sources :

Example 1 with BucketUpdatedEvent

use of org.sonatype.nexus.repository.storage.internal.BucketUpdatedEvent in project nexus-public by sonatype.

the class BucketEntityAdapter method newEvent.

@Nullable
@Override
public EntityEvent newEvent(final ODocument document, final EventKind eventKind) {
    final EntityMetadata metadata = new AttachedEntityMetadata(this, document);
    final String repositoryName = document.field(P_REPOSITORY_NAME);
    log.debug("newEvent: eventKind: {}, repositoryName: {}, metadata: {}", eventKind, repositoryName, metadata);
    switch(eventKind) {
        case CREATE:
            return new BucketCreatedEvent(metadata, repositoryName);
        case UPDATE:
            return new BucketUpdatedEvent(metadata, repositoryName);
        case DELETE:
            return new BucketDeletedEvent(metadata, repositoryName);
        default:
            return null;
    }
}
Also used : BucketCreatedEvent(org.sonatype.nexus.repository.storage.internal.BucketCreatedEvent) BucketUpdatedEvent(org.sonatype.nexus.repository.storage.internal.BucketUpdatedEvent) BucketDeletedEvent(org.sonatype.nexus.repository.storage.internal.BucketDeletedEvent) EntityMetadata(org.sonatype.nexus.common.entity.EntityMetadata) AttachedEntityMetadata(org.sonatype.nexus.orient.entity.AttachedEntityMetadata) AttachedEntityMetadata(org.sonatype.nexus.orient.entity.AttachedEntityMetadata) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 EntityMetadata (org.sonatype.nexus.common.entity.EntityMetadata)1 AttachedEntityMetadata (org.sonatype.nexus.orient.entity.AttachedEntityMetadata)1 BucketCreatedEvent (org.sonatype.nexus.repository.storage.internal.BucketCreatedEvent)1 BucketDeletedEvent (org.sonatype.nexus.repository.storage.internal.BucketDeletedEvent)1 BucketUpdatedEvent (org.sonatype.nexus.repository.storage.internal.BucketUpdatedEvent)1