Interface MailArchiveAttachmentService

All Known Implementing Classes:
MailArchiveAttachmentServiceImpl

public interface MailArchiveAttachmentService
  • Method Details

    • getOrCreateAttachment

      MailArchiveAttachment getOrCreateAttachment(@Nullable @Nullable UUID taskUuid, Attachment attachment) throws InterruptedException
      Returns existing Email_attachment entity for given task UUID and attachment or creates a new one. Email_attachment entities are shared among Email_archive entries which are created by a certain task. For instance, if three mails are sent with the same attachment, there will be three Email_archive entries and they will all be linked to the same Email_attachment entity. This threadsafe method makes sure that there really will be created only one Email_attachment entity for the same attachment (thread safety is required, as each Email_archive entry gets created in its own thread).
      Returns:
      the existing or newly created attachment. The Nice URL is only set if the attachment didn't already exist.
      Throws:
      InterruptedException
    • getAttachment

      Optional<MailArchiveAttachment> getAttachment(UUID taskUuid, String id)
      Returns existing Email_attachment entity for given task UUID and attachment.
      Returns:
      the existing attachment