@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, getRepository
getDate, getUser
getSource, toString
public AttachmentDeletionRequestedEvent(@Nonnull Object source, @Nonnull Repository repository, @Nonnull Attachment attachment, @Nonnull CancelState cancelState)
public 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 attachment deletion; otherwise false
Copyright © 2021 Atlassian. All rights reserved.