Package org.apache.camel.spi
Interface ClaimCheckRepository
-
- All Superinterfaces:
AutoCloseable,Service
public interface ClaimCheckRepository extends Service
Access to a repository of keys to implement the Claim Check pattern. The add and contains methods is operating according to theMapcontract, and the push and pop methods is operating according to theStackcontract. See important details about the Claim Check EIP implementation in Apache Camel atorg.apache.camel.processor.ClaimCheckProcessor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(String key, Exchange exchange)Adds the exchange to the repository.voidclear()Clear the repository.booleancontains(String key)Returns true if this repository contains the specified key.Exchangeget(String key)Gets the exchange from the repository.ExchangegetAndRemove(String key)Gets and removes the exchange from the repository.Exchangepop()Pops the repository and returns the latest.voidpush(Exchange exchange)Pushes the exchange on top of the repository.
-
-
-
Method Detail
-
add
boolean add(String key, Exchange exchange)
Adds the exchange to the repository.- Parameters:
key- the claim check key- Returns:
- true if this repository did not already contain the specified key
-
contains
boolean contains(String key)
Returns true if this repository contains the specified key.- Parameters:
key- the claim check key- Returns:
- true if this repository contains the specified key
-
get
Exchange get(String key)
Gets the exchange from the repository.- Parameters:
key- the claim check key
-
getAndRemove
Exchange getAndRemove(String key)
Gets and removes the exchange from the repository.- Parameters:
key- the claim check key- Returns:
- the removed exchange, or null if the key did not exists.
-
push
void push(Exchange exchange)
Pushes the exchange on top of the repository.
-
pop
Exchange pop()
Pops the repository and returns the latest. Or returns null if the stack is empty.
-
clear
void clear()
Clear the repository.
-
-