Class PriorityQueueManager

java.lang.Object
it.ozimov.springboot.mail.service.defaultimpl.PriorityQueueManager
All Implemented Interfaces:
Closeable, AutoCloseable

public class PriorityQueueManager extends Object implements Closeable
  • Method Details

    • numberOfLevels

      public int numberOfLevels()
    • hasElements

      public boolean hasElements()
    • currentlyInQueue

      public int currentlyInQueue()
    • millisToNextEmail

      public long millisToNextEmail()
    • enqueue

      public boolean enqueue(EmailSchedulingData emailSchedulingData, boolean isFromPersistenceLayer)
    • completeEnqueue

      public void completeEnqueue()
    • dequeueNext

      public Optional<EmailSchedulingData> dequeueNext(Duration consumerCycle)
    • completeDequeue

      public void completeDequeue()
    • isCurrentOperationNone

      protected boolean isCurrentOperationNone()
    • isCurrentOperationClosing

      protected boolean isCurrentOperationClosing()
    • isCurrentOperationDequeuing

      protected boolean isCurrentOperationDequeuing()
    • isCurrentOperationEnqueuing

      protected boolean isCurrentOperationEnqueuing()
    • setCurrentOperationToEnqueuing

      protected void setCurrentOperationToEnqueuing() throws InterruptedException
      Throws:
      InterruptedException
    • setCurrentOperationToDequeuing

      protected void setCurrentOperationToDequeuing() throws InterruptedException
      Throws:
      InterruptedException
    • setCurrentOperationToNone

      protected void setCurrentOperationToNone()
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException