Interface ChangeDraftUpdate

All Known Implementing Classes:
ChangeDraftNotesUpdate

public interface ChangeDraftUpdate
An interface for updating draft comments.
  • Method Details

    • putDraftComment

      void putDraftComment(HumanComment c)
      Creates a draft comment.
    • markDraftCommentAsPublished

      void markDraftCommentAsPublished(HumanComment c)
      Marks a comment for deletion. Called when the comment is deleted because the user published it.

      NOTE for implementers: The actual deletion of a published draft should only happen after the published comment is successfully updated. Please use ChangeDraftUpdateExecutor.

    • addDraftCommentForDeletion

      void addDraftCommentForDeletion(HumanComment c)
      Marks a comment for deletion. Called when the comment is deleted because the user removed it.
    • addAllDraftCommentsForDeletion

      void addAllDraftCommentsForDeletion(List<Comment> comments)
      Marks all comments for deletion. Called when there are inconsistencies between the published comments storage and the drafts one.
    • canRunAsync

      boolean canRunAsync()
      Whether all updates in this updater can run asynchronously.
    • getStorageKey

      String getStorageKey()
      A unique identifier for the draft, used by the storage system. For example, NoteDB's ref name.
    • toOptionalChangeDraftUpdateSubtype

      default <UpdateT extends ChangeDraftUpdate> Optional<UpdateT> toOptionalChangeDraftUpdateSubtype(Class<UpdateT> subtype)
      Converts this update to the given subtype if possible. Returns Optional.empty() otherwise.