Class RepositoryDeletionRequestedEvent
java.lang.Object
java.util.EventObject
com.atlassian.bitbucket.event.ApplicationEvent
com.atlassian.bitbucket.event.repository.RepositoryEvent
com.atlassian.bitbucket.event.repository.RepositoryDeletionRequestedEvent
- All Implemented Interfaces:
CancelableEvent,CancelState,Serializable
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.
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryDeletionRequestedEvent(Object source, Repository repository, CancelState cancelState, Iterable<Integer> forkIds) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(KeyedMessage message) Cancels repository deletion, providing a message explaining why.booleanRetrieves a flag indicating whether repository deletion has already been canceled by another listener.Methods inherited from class com.atlassian.bitbucket.event.repository.RepositoryEvent
getRepositoryMethods inherited from class com.atlassian.bitbucket.event.ApplicationEvent
getDate, getUserMethods inherited from class java.util.EventObject
getSource, toString
-
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 occurredrepository- repository that was deletedcancelState- the cancel stateforkIds- IDs of forks- Since:
- 5.6
-
-
Method Details
-
cancel
Cancels repository deletion, providing a message explaining why.- Specified by:
cancelin interfaceCancelState- 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:
isCanceledin interfaceCancelState- Returns:
trueif another listener has already canceled repository deletion; otherwise,false
-
getForkIds
- Returns:
- the IDs of all repositories that are forks of the repository being deleted
- Since:
- 8.0
-