package com.atlassian.bitbucket.mirroring.upstream;

import com.atlassian.bitbucket.audit.Priority;
import com.atlassian.bitbucket.event.ApplicationEvent;
import com.atlassian.bitbucket.event.annotation.Audited;
import com.atlassian.bitbucket.event.annotation.TransactionAware;
import com.atlassian.bitbucket.internal.mirroring.upstream.MirrorLifecycleEventConverter;

import javax.annotation.Nonnull;

/**
 * @since 4.3
 */
@TransactionAware
@Audited(converter = MirrorLifecycleEventConverter.class, priority = Priority.HIGH)
public abstract class MirrorLifecycleEvent extends ApplicationEvent {
    private final MirrorServer mirror;

    protected MirrorLifecycleEvent(@Nonnull Object source, @Nonnull MirrorServer mirror) {
        super(source);
        this.mirror = mirror;
    }

    @Nonnull
    public MirrorServer getMirror() {
        return mirror;
    }
}