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 theMap
contract, and the push and pop methods is operating according to theStack
contract. 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 boolean
add(String key, Exchange exchange)
Adds the exchange to the repository.void
clear()
Clear the repository.boolean
contains(String key)
Returns true if this repository contains the specified key.Exchange
get(String key)
Gets the exchange from the repository.Exchange
getAndRemove(String key)
Gets and removes the exchange from the repository.Exchange
pop()
Pops the repository and returns the latest.void
push(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.
-
-