Class UnsettledMap<Delivery>
java.lang.Object
org.apache.qpid.protonj2.engine.util.UnsettledMap<Delivery>
- Type Parameters:
Delivery- The delivery type being tracker (incoming or outgoing)
- All Implemented Interfaces:
Map<UnsignedInteger,Delivery>
A specialized collection like entity that is used to keep track of unsettled
incoming and outgoing deliveries for AMQP links and the sessions that manage
those links.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<Map.Entry<UnsignedInteger,Delivery>> protected Set<UnsignedInteger>protected Collection<Delivery> -
Constructor Summary
ConstructorsConstructorDescriptionUnsettledMap(UnsettledMap.UnsettledGetDeliveryId<Delivery> idSupplier) UnsettledMap(UnsettledMap.UnsettledGetDeliveryId<Delivery> idSupplier, int initialBuckets) UnsettledMap(UnsettledMap.UnsettledGetDeliveryId<Delivery> idSupplier, int initialBuckets, int bucketSize) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(int key) booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanvoidVisits each entry within the given range and invokes the provided action on each delivery in the tracker.voidforEach(BiConsumer<? super UnsignedInteger, ? super Delivery> action) voidget(int deliveryId) booleanisEmpty()keySet()Adds the given key and value pair in this tracking structure at the end of the current series.put(UnsignedInteger key, Delivery value) voidputAll(Map<? extends UnsignedInteger, ? extends Delivery> source) remove(int deliveryId) voidremoveEach(int first, int last, Consumer<Delivery> action) Remove each entry within the given range of delivery IDs.intsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
keySet
-
values
-
entrySet
-
-
Constructor Details
-
UnsettledMap
-
UnsettledMap
-
UnsettledMap
public UnsettledMap(UnsettledMap.UnsettledGetDeliveryId<Delivery> idSupplier, int initialBuckets, int bucketSize)
-
-
Method Details
-
putAll
- Specified by:
putAllin interfaceMap<UnsignedInteger,Delivery>
-
clear
public void clear()- Specified by:
clearin interfaceMap<UnsignedInteger,Delivery>
-
put
- Specified by:
putin interfaceMap<UnsignedInteger,Delivery>
-
put
Adds the given key and value pair in this tracking structure at the end of the current series.If the map previously contained a mapping for the key, the old value is not replaced by the specified value unlike a traditional map as this structure is tracking the running series of values. This would imply that duplicates can exist in the tracker, however given the likelihood of this occurring in the normal flow of deliveries should be considered extremely low.
- Parameters:
deliveryId- The delivery ID of the delivery being added to this tracker.delivery- The delivery that is being added to the tracker- Returns:
- null in all cases as this tracker does not check for duplicates.
-
size
public int size()- Specified by:
sizein interfaceMap<UnsignedInteger,Delivery>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<UnsignedInteger,Delivery>
-
get
- Specified by:
getin interfaceMap<UnsignedInteger,Delivery>
-
get
-
remove
- Specified by:
removein interfaceMap<UnsignedInteger,Delivery>
-
remove
-
containsKey
- Specified by:
containsKeyin interfaceMap<UnsignedInteger,Delivery>
-
containsKey
public boolean containsKey(int key) -
containsValue
- Specified by:
containsValuein interfaceMap<UnsignedInteger,Delivery>
-
forEach
-
forEach
Visits each entry within the given range and invokes the provided action on each delivery in the tracker.- Parameters:
first- The first entry to visit.last- The last entry to visit.action- The action to invoke on each visited entry.
-
removeEach
Remove each entry within the given range of delivery IDs. For each entry removed the provided action is triggered allowing the caller to be notified of each removal.- Parameters:
first- The first entry to removelast- The last entry to removeaction- The action to invoke on each remove.
-
forEach
- Specified by:
forEachin interfaceMap<UnsignedInteger,Delivery>
-
values
- Specified by:
valuesin interfaceMap<UnsignedInteger,Delivery>
-
keySet
- Specified by:
keySetin interfaceMap<UnsignedInteger,Delivery>
-
entrySet
- Specified by:
entrySetin interfaceMap<UnsignedInteger,Delivery>
-
equals
-
toString
-