Class AbstractUpdateQueue<T>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.TreeMap<Long,T>
de.hybris.platform.ycommercewebservices.queues.impl.AbstractUpdateQueue<T>
All Implemented Interfaces:
UpdateQueue<T>, Serializable, Cloneable, Map<Long,T>, NavigableMap<Long,T>, SortedMap<Long,T>
Direct Known Subclasses:
OrderStatusUpdateQueue, ProductExpressUpdateQueue

public abstract class AbstractUpdateQueue<T> extends TreeMap<Long,T> implements UpdateQueue<T>
Abstract implementation of UpdateQueue using TreeMap for storing elements WARNING: this queue has limited capacity due to its in-memory nature
See Also:
  • Field Details

  • Constructor Details

    • AbstractUpdateQueue

      public AbstractUpdateQueue()
  • Method Details

    • getItems

      public List<T> getItems()
      Description copied from interface: UpdateQueue
      Returns all elements in the queue.
      Specified by:
      getItems in interface UpdateQueue<T>
      Returns:
      list of stored elements
    • getItems

      public List<T> getItems(Date newerThan)
      Description copied from interface: UpdateQueue
      Returns all elements in the queue newer than a specific day
      Specified by:
      getItems in interface UpdateQueue<T>
      Parameters:
      newerThan - threshold date
      Returns:
      list of stored elements
    • addItem

      public void addItem(T item)
      Description copied from interface: UpdateQueue
      Adds item to the queue
      Specified by:
      addItem in interface UpdateQueue<T>
      Parameters:
      item - elements to be stored
    • addItems

      public void addItems(List<T> items)
      Description copied from interface: UpdateQueue
      Adds all elements from the list to the queue
      Specified by:
      addItems in interface UpdateQueue<T>
      Parameters:
      items - elements to be stored
    • removeItems

      public void removeItems(Date olderThan)
      Description copied from interface: UpdateQueue
      Removes all elements from the queue older than a specific date
      Specified by:
      removeItems in interface UpdateQueue<T>
      Parameters:
      olderThan - threshold date
    • removeItems

      public void removeItems()
      Description copied from interface: UpdateQueue
      Removes all elements from the queue
      Specified by:
      removeItems in interface UpdateQueue<T>
    • removeItems

      public void removeItems(com.google.common.base.Predicate<T> predicate)
      Description copied from interface: UpdateQueue
      Removes all matched elements
      Specified by:
      removeItems in interface UpdateQueue<T>
    • getLastItem

      public T getLastItem()
      Description copied from interface: UpdateQueue
      Returns last item from the queue
      Specified by:
      getLastItem in interface UpdateQueue<T>
      Returns:
      last element
    • getMaxCapacity

      public int getMaxCapacity()
    • setMaxCapacity

      public void setMaxCapacity(int maxCapacity)
    • getTimeKey

      protected Long getTimeKey(T item)