Class DigestEnrollmentStorage

java.lang.Object
io.meeds.commons.digest.service.DigestEnrollmentStorage

@Component public class DigestEnrollmentStorage extends Object
Keeps NTF_DIGEST_USERS, the work list of the digest sender job, in sync with the choices of the users: the row holds only what the job needs to answer "which users are due now?".
  • Constructor Details

    • DigestEnrollmentStorage

      public DigestEnrollmentStorage(DigestUserDAO digestUserDAO)
  • Method Details

    • findEnrolled

      public Set<String> findEnrolled(Collection<String> usernames)
      Answers "which of these users has a digest enabled?" with one indexed read of the work list, so that the caller reads the settings of those users only. A row exists in the work list if and only if a frequency is on.
      Parameters:
      usernames - the users to narrow down
      Returns:
      those of them having a row, in no particular order
    • updateTimeZone

      @Transactional public void updateTimeZone(String username, String timeZone)
      Refreshes the timezone copy of an enrolled user; a user without a row has no digest, nothing to refresh.
    • enroll

      @Transactional public void enroll(String username, io.meeds.commons.digest.model.DigestUserSettings settings, String timeZone)