Repository: camel
Updated Branches:
  refs/heads/master c4338c650 -> 51fca498b


CAMEL-8478: IdempotentRepository - Add clear operation, align 
RedisIdempotentRepository


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/51fca498
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/51fca498
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/51fca498

Branch: refs/heads/master
Commit: 51fca498be8dbb7b3bf4a9d60dbbc3a042054d93
Parents: c4338c6
Author: Andrea Cosentino <anco...@gmail.com>
Authored: Fri Jul 3 23:59:23 2015 +0200
Committer: Andrea Cosentino <anco...@gmail.com>
Committed: Fri Jul 3 23:59:23 2015 +0200

----------------------------------------------------------------------
 .../redis/processor/idempotent/RedisIdempotentRepository.java  | 5 +++++
 .../processor/idempotent/RedisIdempotentRepositoryTest.java    | 6 ++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/51fca498/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
 
b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
index afe30c7..a1ef7ed 100755
--- 
a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
+++ 
b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepository.java
@@ -70,6 +70,11 @@ public class RedisIdempotentRepository extends 
ServiceSupport implements Idempot
     public boolean remove(String key) {
         return setOperations.remove(processorName, key) != null;
     }
+    
+    @ManagedOperation(description = "Clear the store")
+    public void clear() {
+        setOperations.remove(processorName);
+    }
 
     @ManagedAttribute(description = "The processor name")
     public String getProcessorName() {

http://git-wip-us.apache.org/repos/asf/camel/blob/51fca498/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepositoryTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepositoryTest.java
 
b/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepositoryTest.java
index 5fdc1a2..fd977ac 100755
--- 
a/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepositoryTest.java
+++ 
b/components/camel-spring-redis/src/test/java/org/apache/camel/component/redis/processor/idempotent/RedisIdempotentRepositoryTest.java
@@ -58,6 +58,12 @@ public class RedisIdempotentRepositoryTest {
         idempotentRepository.remove(KEY);
         verify(setOperations).remove(REPOSITORY, KEY);
     }
+    
+    @Test
+    public void shouldClearRepository() {
+        idempotentRepository.clear();
+        verify(setOperations).remove(REPOSITORY);
+    }
 
     @Test
     public void shouldReturnProcessorName() {

Reply via email to