public class RepositoryDeletionRequestedEvent extends RepositoryEvent implements CancelableEvent
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.
source
Constructor and Description |
---|
RepositoryDeletionRequestedEvent(Object source,
Repository repository,
CancelState cancelState,
Iterable<Integer> forkIds) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(KeyedMessage message)
Cancels repository deletion, providing a message explaining why.
|
Iterable<Integer> |
getForkIds() |
boolean |
isCanceled()
Retrieves a flag indicating whether repository deletion has already been canceled by another listener.
|
getRepository
getDate, getUser
getSource, toString
public RepositoryDeletionRequestedEvent(@Nonnull Object source, @Nonnull Repository repository, @Nonnull CancelState cancelState, @Nonnull Iterable<Integer> forkIds)
source
- the object on which the event initially occurredrepository
- repository that was deletedcancelState
- the cancel stateforkIds
- IDs of forkspublic void cancel(@Nonnull KeyedMessage message)
cancel
in interface CancelState
message
- a descriptive message explaining why the operation has been canceledpublic boolean isCanceled()
isCanceled
in interface CancelState
true
if another listener has already canceled repository deletion; otherwise, false
Copyright © 2019 Atlassian. All rights reserved.