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 TypeMethodDescriptionvoidadd(TemporaryWebAttachment temporaryAttachment) Adds new temporary attachment.voidcleanByFormToken(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.voidstart()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:StartableThis 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:TemporaryWebAttachmentsMonitorRetrieves temporary attachment by id.- Specified by:
getByIdin interfaceTemporaryWebAttachmentsMonitor- Parameters:
temporaryAttachmentId- temporary attachment id.- Returns:
- selected temporary attachment if exists
-
removeById
Description copied from interface:TemporaryWebAttachmentsMonitorRemoves temporary attachment with given id from monitor. Does not remove it from attachment store.- Specified by:
removeByIdin interfaceTemporaryWebAttachmentsMonitor- Parameters:
temporaryAttachmentId- Temporary Attachment Id which will be removed.- Returns:
- Removed temporary attachment if exists
-
add
Description copied from interface:TemporaryWebAttachmentsMonitorAdds new temporary attachment.- Specified by:
addin interfaceTemporaryWebAttachmentsMonitor- Parameters:
temporaryAttachment- temporary attachment.
-
getByFormToken
Description copied from interface:TemporaryWebAttachmentsMonitorGets all temporary attachments with given from token.- Specified by:
getByFormTokenin interfaceTemporaryWebAttachmentsMonitor- Parameters:
formToken- form token- Returns:
- Collection of matched temporary attachments
-
cleanByFormToken
Description copied from interface:TemporaryWebAttachmentsMonitorRemoves all attachments from monitor and from attachment store, matched by form token.- Specified by:
cleanByFormTokenin interfaceTemporaryWebAttachmentsMonitor
-