package com.atlassian.bitbucket.event.tag;

import com.atlassian.bitbucket.event.CancelableEvent;
import com.atlassian.bitbucket.i18n.KeyedMessage;
import com.atlassian.bitbucket.repository.Repository;
import com.atlassian.bitbucket.repository.Tag;
import com.atlassian.bitbucket.util.CancelState;

import javax.annotation.Nonnull;

/**
 * An event that is raised just before a tag is created using the UI or REST.
 * Tags created by pushing will not trigger this event.
 * <p>
 * This event is {@link CancelableEvent cancelable}. A listener may prevent the tag
 * from being created by {@link #cancel(KeyedMessage) canceling} this event. Throwing an
 * exception <i>will not</i> prevent the tag from being created; the exception will be logged and ignored.
 */
public class TagCreationRequestedEvent extends TagChangeRequestedEvent {

    public TagCreationRequestedEvent(@Nonnull Object source, @Nonnull Repository repository,
                                     @Nonnull Tag tag, @Nonnull CancelState cancelState) {
        super(source, repository, cancelState, tag);
    }
}
