All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codeheadsystems.queue.Queue Maven / Gradle / Ivy

The newest version!
package com.codeheadsystems.queue;

import java.util.Map;
import java.util.Optional;

/**
 * The interface Queue.
 */
public interface Queue {

  /**
   * Enqueue message.
   *
   * @param messageType the message type
   * @param payload     the payload
   * @return the message if it could be enqueued.
   */
  Optional enqueue(final String messageType,
                            final String payload);

  /**
   * Gets state.
   *
   * @param message the message
   * @return the state if it is found.
   */
  Optional getState(final Message message);

  /**
   * Provides the list of messages enqueued within the system for each state.
   *
   * @return map list.
   */
  Map getMessageStateCounts();

  /**
   * Clear all.
   */
  void clearAll();

  /**
   * Clear.
   *
   * @param message the message
   */
  void clear(final Message message);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy