NotificationEventBlockingQueue.java

  1. package gov.usgs.earthquake.util;

  2. import gov.usgs.earthquake.distribution.NotificationEvent;
  3. import gov.usgs.earthquake.product.ProductId;

  4. /**
  5.  * Preliminary implementation for priority queuing products.
  6.  */
  7. public class NotificationEventBlockingQueue extends
  8.         RoundRobinBlockingQueue<NotificationEvent> {

  9.     /**
  10.      * Round robin per source + type.
  11.      */
  12.     @Override
  13.     protected String getQueueId(final NotificationEvent event) {
  14.         ProductId id = event.getNotification().getProductId();
  15.         return (id.getSource() + "_" + id.getType()).toLowerCase();
  16.     }

  17. }