Class RepositoryDeletionRequestedEvent

All Implemented Interfaces:
CancelableEvent, CancelState, Serializable

public class RepositoryDeletionRequestedEvent extends RepositoryEvent implements CancelableEvent
Raised just before a repository is deleted. This event is synchronous, allowing listeners to perform clean up in the same database transaction where the repository will be deleted.

This event is cancelable. A listener may prevent the repository from being deleted by canceling this event. Throwing an exception will not prevent the repository from being deleted; the exception will be logged and ignored.

See Also:
  • Constructor Details

    • RepositoryDeletionRequestedEvent

      public RepositoryDeletionRequestedEvent(@Nonnull Object source, @Nonnull Repository repository, @Nonnull CancelState cancelState, @Nonnull Iterable<Integer> forkIds)
      Parameters:
      source - the object on which the event initially occurred
      repository - repository that was deleted
      cancelState - the cancel state
      forkIds - IDs of forks
      Since:
      5.6
  • Method Details

    • cancel

      public void cancel(@Nonnull KeyedMessage message)
      Cancels repository deletion, providing a message explaining why.
      Specified by:
      cancel in interface CancelState
      Parameters:
      message - a descriptive message explaining why the operation has been canceled
    • isCanceled

      public boolean isCanceled()
      Retrieves a flag indicating whether repository deletion has already been canceled by another listener.
      Specified by:
      isCanceled in interface CancelState
      Returns:
      true if another listener has already canceled repository deletion; otherwise, false
    • getForkIds

      @Nonnull public Set<Integer> getForkIds()
      Returns:
      the IDs of all repositories that are forks of the repository being deleted
      Since:
      8.0