Class DefaultTemporaryWebAttachmentsMonitor
java.lang.Object
com.atlassian.jira.web.action.issue.DefaultTemporaryWebAttachmentsMonitor
- All Implemented Interfaces:
Startable
,TemporaryWebAttachmentsMonitor
@ParametersAreNonnullByDefault
public class DefaultTemporaryWebAttachmentsMonitor
extends Object
implements TemporaryWebAttachmentsMonitor, Startable
This class maintains a list of temporary attachments uploaded by a user.
It is responsible of deleting any temporary files that were not converted to proper attachments
from the database.
- Since:
- 6.4
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTemporaryWebAttachmentsMonitor
(StreamAttachmentStore attachmentStore, TemporaryAttachmentMonitorStore temporaryAttachmentMonitorStore, com.atlassian.scheduler.SchedulerService schedulerService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(TemporaryWebAttachment temporaryAttachment) Adds new temporary attachment.void
cleanByFormToken
(String formToken) Removes all attachments from monitor and from attachment store, matched by form token.getByFormToken
(String formToken) Gets all temporary attachments with given from token.io.atlassian.fugue.Option<TemporaryWebAttachment>
Retrieves temporary attachment by id.io.atlassian.fugue.Option<TemporaryWebAttachment>
removeById
(String temporaryAttachmentId) Removes temporary attachment with given id from monitor.void
start()
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework.
-
Constructor Details
-
DefaultTemporaryWebAttachmentsMonitor
public DefaultTemporaryWebAttachmentsMonitor(StreamAttachmentStore attachmentStore, TemporaryAttachmentMonitorStore temporaryAttachmentMonitorStore, com.atlassian.scheduler.SchedulerService schedulerService)
-
-
Method Details
-
start
Description copied from interface:Startable
This method will be called after the plugin system is fully initialised and all components added to the dependency injection framework. -
getById
Description copied from interface:TemporaryWebAttachmentsMonitor
Retrieves temporary attachment by id.- Specified by:
getById
in interfaceTemporaryWebAttachmentsMonitor
- Parameters:
temporaryAttachmentId
- temporary attachment id.- Returns:
- selected temporary attachment if exists
-
removeById
Description copied from interface:TemporaryWebAttachmentsMonitor
Removes temporary attachment with given id from monitor. Does not remove it from attachment store.- Specified by:
removeById
in interfaceTemporaryWebAttachmentsMonitor
- Parameters:
temporaryAttachmentId
- Temporary Attachment Id which will be removed.- Returns:
- Removed temporary attachment if exists
-
add
Description copied from interface:TemporaryWebAttachmentsMonitor
Adds new temporary attachment.- Specified by:
add
in interfaceTemporaryWebAttachmentsMonitor
- Parameters:
temporaryAttachment
- temporary attachment.
-
getByFormToken
Description copied from interface:TemporaryWebAttachmentsMonitor
Gets all temporary attachments with given from token.- Specified by:
getByFormToken
in interfaceTemporaryWebAttachmentsMonitor
- Parameters:
formToken
- form token- Returns:
- Collection of matched temporary attachments
-
cleanByFormToken
Description copied from interface:TemporaryWebAttachmentsMonitor
Removes all attachments from monitor and from attachment store, matched by form token.- Specified by:
cleanByFormToken
in interfaceTemporaryWebAttachmentsMonitor
-