@TransactionAware(value=IMMEDIATE) public class AttachmentDeletionRequestedEvent extends AttachmentEvent implements CancelableEvent
attachment is deleted. This event is
synchronous, allowing listeners to perform operations in the same database transaction where the attachment will be
deleted.
This event is cancelable. A listener may prevent the attachment from being deleted by
canceling this event. Throwing an exception will not prevent the attachment
from being deleted; the exception will be logged and ignored.
AttachmentService.delete(Repository, long),
Serialized Formsource| Constructor and Description |
|---|
AttachmentDeletionRequestedEvent(Object source,
Repository repository,
Attachment attachment,
CancelState cancelState) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel(KeyedMessage message)
Cancels attachment deletion, providing a message explaining why.
|
boolean |
isCanceled()
Retrieves a flag indicating whether attachment deletion has already been canceled by another listener.
|
getAttachment, getRepositorygetDate, getUsergetSource, toStringpublic AttachmentDeletionRequestedEvent(@Nonnull Object source, @Nonnull Repository repository, @Nonnull Attachment attachment, @Nonnull CancelState cancelState)
public void cancel(@Nonnull KeyedMessage message)
cancel in interface CancelStatemessage - a descriptive message explaining why the operation has been canceledpublic boolean isCanceled()
isCanceled in interface CancelStatetrue if another listener has already canceled attachment deletion; otherwise falseCopyright © 2023 Atlassian. All rights reserved.