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
Abstract implementation of
UpdateQueue using TreeMap
for storing elements WARNING: this queue has limited capacity due to its in-memory nature- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds item to the queuevoidAdds all elements from the list to the queuegetItems()Returns all elements in the queue.Returns all elements in the queue newer than a specific dayReturns last item from the queueintprotected LonggetTimeKey(T item) voidRemoves all elements from the queuevoidremoveItems(com.google.common.base.Predicate<T> predicate) Removes all matched elementsvoidremoveItems(Date olderThan) Removes all elements from the queue older than a specific datevoidsetMaxCapacity(int maxCapacity) Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, merge, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
-
Field Details
-
DEFAULT_MAX_CAPACITY
protected static final int DEFAULT_MAX_CAPACITY- See Also:
-
-
Constructor Details
-
AbstractUpdateQueue
public AbstractUpdateQueue()
-
-
Method Details
-
getItems
Description copied from interface:UpdateQueueReturns all elements in the queue.- Specified by:
getItemsin interfaceUpdateQueue<T>- Returns:
- list of stored elements
-
getItems
Description copied from interface:UpdateQueueReturns all elements in the queue newer than a specific day- Specified by:
getItemsin interfaceUpdateQueue<T>- Parameters:
newerThan- threshold date- Returns:
- list of stored elements
-
addItem
Description copied from interface:UpdateQueueAdds item to the queue- Specified by:
addItemin interfaceUpdateQueue<T>- Parameters:
item- elements to be stored
-
addItems
Description copied from interface:UpdateQueueAdds all elements from the list to the queue- Specified by:
addItemsin interfaceUpdateQueue<T>- Parameters:
items- elements to be stored
-
removeItems
Description copied from interface:UpdateQueueRemoves all elements from the queue older than a specific date- Specified by:
removeItemsin interfaceUpdateQueue<T>- Parameters:
olderThan- threshold date
-
removeItems
public void removeItems()Description copied from interface:UpdateQueueRemoves all elements from the queue- Specified by:
removeItemsin interfaceUpdateQueue<T>
-
removeItems
Description copied from interface:UpdateQueueRemoves all matched elements- Specified by:
removeItemsin interfaceUpdateQueue<T>
-
getLastItem
Description copied from interface:UpdateQueueReturns last item from the queue- Specified by:
getLastItemin interfaceUpdateQueue<T>- Returns:
- last element
-
getMaxCapacity
public int getMaxCapacity() -
setMaxCapacity
public void setMaxCapacity(int maxCapacity) -
getTimeKey
-