Package org.apache.camel.resume.cache
Interface ResumeCache<K>
- Type Parameters:
K- the type of the key
public interface ResumeCache<K>
This cache stored the resumed data from a
ResumeStrategy.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a value to the cachelongcapacity()Gets the cache pool sizecomputeIfAbsent(K key, Function<? super K, ? super Object> mapping) If the specified key is not present, compute its value from the mapping function (like Java's standard Map one)computeIfPresent(K key, BiFunction<? super K, ? super Object, ? super Object> remapping) If the specified key is present, compute a new value from the mapping function (like Java's standard Map one)booleanWhether the cache contains the key with the given entry valuevoidforEach(BiFunction<? super K, ? super Object, Boolean> action) Performs the given action for each member of the cacheGets the offset entry for the key<T> TGets the offset entry for the keybooleanisFull()Checks whether the cache is full
-
Method Details
-
computeIfAbsent
If the specified key is not present, compute its value from the mapping function (like Java's standard Map one)- Parameters:
key- the key to get or associate with the valuemapping- the mapping function used to compute the value- Returns:
- the value associated with the key (either the present or the one computed from the mapping function)
-
computeIfPresent
If the specified key is present, compute a new value from the mapping function (like Java's standard Map one)- Parameters:
key- the key to get or associate with the valueremapping- the remapping function used to compute the new value- Returns:
- the value associated with the key (either the present or the one computed from the mapping function)
-
contains
Whether the cache contains the key with the given entry value- Parameters:
key- the keyentry- the entry- Returns:
- true if the key/entry pair is stored in the cache
-
add
Adds a value to the cache- Parameters:
key- the key to addoffsetValue- the offset value
-
isFull
boolean isFull()Checks whether the cache is full- Returns:
- true if full, or false otherwise
-
capacity
long capacity()Gets the cache pool size -
get
Gets the offset entry for the key- Parameters:
key- the keyclazz- the class object representing the value to be obtained- Returns:
- the offset value wrapped in an optional
-
get
Gets the offset entry for the key- Parameters:
key- the key- Returns:
- the offset value
-
forEach
Performs the given action for each member of the cache- Parameters:
action- the action to execute
-