Class PollFlowUtils


  • public final class PollFlowUtils
    extends java.lang.Object
    Static utility functions for poll flows.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean ackPollMessage​(PollMessage pollMessage)
      Acknowledges the given PollMessage and returns whether we should include the current acked message in the updated message count that's returned to the user.
      static QueryComposer<PollMessage> createPollMessageQuery​(java.lang.String registrarId, org.joda.time.DateTime now)
      Returns the QueryComposer for poll messages from the given registrar that are not in the future.
      static java.util.Optional<PollMessage> getFirstPollMessage​(java.lang.String registrarId, org.joda.time.DateTime now)
      Returns the first (by event time) poll message not in the future for this registrar.
      static int getPollMessageCount​(java.lang.String registrarId, org.joda.time.DateTime now)
      Returns the number of poll messages for the given registrar that are not in the future.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPollMessageCount

        public static int getPollMessageCount​(java.lang.String registrarId,
                                              org.joda.time.DateTime now)
        Returns the number of poll messages for the given registrar that are not in the future.
      • getFirstPollMessage

        public static java.util.Optional<PollMessage> getFirstPollMessage​(java.lang.String registrarId,
                                                                          org.joda.time.DateTime now)
        Returns the first (by event time) poll message not in the future for this registrar.
      • ackPollMessage

        public static boolean ackPollMessage​(PollMessage pollMessage)
        Acknowledges the given PollMessage and returns whether we should include the current acked message in the updated message count that's returned to the user.

        The only case where we do so is if an autorenew poll message is acked, but its next event is already ready to be delivered.

      • createPollMessageQuery

        public static QueryComposer<PollMessage> createPollMessageQuery​(java.lang.String registrarId,
                                                                        org.joda.time.DateTime now)
        Returns the QueryComposer for poll messages from the given registrar that are not in the future.