|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.processor.idempotent.MemoryIdempotentRepository
public class MemoryIdempotentRepository
A memory based implementation of IdempotentRepository
.
Map
to avoid this class being a
memory leak.
Constructor Summary | |
---|---|
MemoryIdempotentRepository()
|
|
MemoryIdempotentRepository(Map<String,Object> set)
|
Method Summary | |
---|---|
boolean |
add(String messageId)
Adds the key to the repository. |
boolean |
confirm(String key)
Confirms the key, after the exchange has been processed sucesfully. |
boolean |
contains(String key)
Returns true if this repository contains the specified element. |
Map<String,Object> |
getCache()
|
static IdempotentRepository<String> |
memoryIdempotentRepository()
Creates a new memory based repository using a LRUCache
with a default of 1000 entries in the cache. |
static IdempotentRepository<String> |
memoryIdempotentRepository(int cacheSize)
Creates a new memory based repository using a LRUCache . |
static IdempotentRepository<String> |
memoryIdempotentRepository(Map<String,Object> cache)
Creates a new memory based repository using the given Map to
use to store the processed message ids. |
boolean |
remove(String key)
Removes the key from the repository. |
void |
setCache(Map<String,Object> cache)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemoryIdempotentRepository()
public MemoryIdempotentRepository(Map<String,Object> set)
Method Detail |
---|
public static IdempotentRepository<String> memoryIdempotentRepository()
LRUCache
with a default of 1000 entries in the cache.
public static IdempotentRepository<String> memoryIdempotentRepository(int cacheSize)
LRUCache
.
cacheSize
- the cache sizepublic static IdempotentRepository<String> memoryIdempotentRepository(Map<String,Object> cache)
Map
to
use to store the processed message ids.
Care should be taken to use a suitable underlying Map
to avoid this class being a
memory leak.
cache
- the cachepublic boolean add(String messageId)
IdempotentRepository
add
in interface IdempotentRepository<String>
messageId
- the key of the message for duplicate test
public boolean contains(String key)
IdempotentRepository
contains
in interface IdempotentRepository<String>
key
- the key of the message
public boolean remove(String key)
IdempotentRepository
remove
in interface IdempotentRepository<String>
key
- the key of the message for duplicate test
public boolean confirm(String key)
IdempotentRepository
confirm
in interface IdempotentRepository<String>
key
- the key of the message for duplicate test
public Map<String,Object> getCache()
public void setCache(Map<String,Object> cache)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |