Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
"CamelInfinispanOldValue": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The old value to use for a replace.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#OLD_VALUE" },
"CamelInfinispanMap": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Map", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A Map to use in case of CamelInfinispanOperationPutAll operation", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAP" },
"CamelInfinispanOperation": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#OPERATION" },
"CamelInfinispanOperationResult": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the header whose value is the result", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT" },
"CamelInfinispanOperationResult": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": true, "deprecationNote": "Never set nor read by the component. Use CamelInfinispanOperationResultHeader to choose the header that carries the result of an operation.", "autowired": false, "secret": false, "description": "The name of the header whose value is the result. Deprecation note: Never set nor read by the component. Use CamelInfinispanOperationResultHeader to choose the header that carries the result of an operation.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT" },
"CamelInfinispanOperationResultHeader": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Store the operation result in a header instead of the message body", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT_HEADER" },
"CamelInfinispanLifespanTime": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#LIFESPAN_TIME" },
"CamelInfinispanTimeUnit": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Time Unit of an entry Lifespan Time.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#LIFESPAN_TIME_UNIT" },
"CamelInfinispanMaxIdleTime": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The maximum amount of time an entry is allowed to be idle for before it is considered as expired.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAX_IDLE_TIME" },
"CamelInfinispanMaxIdleTimeUnit": { "index": 14, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Time Unit of an entry Max Idle Time.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAX_IDLE_TIME_UNIT" },
"CamelInfinispanIgnoreReturnValues": { "index": 15, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Signals that a write operation's return value will be ignored, so reading the existing value from a store or from a remote node is not necessary.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#IGNORE_RETURN_VALUES" },
"CamelInfinispanIgnoreReturnValues": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "false", "description": "Signals that a write operation's return value will be ignored, so reading the existing value from a store or from a remote node is not necessary.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#IGNORE_RETURN_VALUES" },
"CamelInfinispanEventData": { "index": 16, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The event data.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#EVENT_DATA" },
"CamelInfinispanQueryBuilder": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The QueryBuilder to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#QUERY_BUILDER" },
"CamelInfinispanQueryBuilder": { "index": 17, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The QueryBuilder to use for QUERY command, if not present the command defaults to the InfinispanConfiguration one", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#QUERY_BUILDER" },
"CamelInfinispanCommandRetried": { "index": 18, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "This will be true if the write command that caused this had to be retried again due to a topology change.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#COMMAND_RETRIED" },
"CamelInfinispanEntryCreated": { "index": 19, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Indicates whether the cache entry modification event is the result of the cache entry being created.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#ENTRY_CREATED" },
"CamelInfinispanOriginLocal": { "index": 20, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "true if the call originated on the local cache instance; false if originated from a remote one.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#ORIGIN_LOCAL" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
"CamelInfinispanOldValue": { "index": 5, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The old value to use for a replace.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#OLD_VALUE" },
"CamelInfinispanMap": { "index": 6, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "Map", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "A Map to use in case of CamelInfinispanOperationPutAll operation", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAP" },
"CamelInfinispanOperation": { "index": 7, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanOperation", "enum": [ "PUT", "PUTASYNC", "PUTALL", "PUTALLASYNC", "PUTIFABSENT", "PUTIFABSENTASYNC", "GET", "GETORDEFAULT", "CONTAINSKEY", "CONTAINSVALUE", "REMOVE", "REMOVEASYNC", "REPLACE", "REPLACEASYNC", "SIZE", "CLEAR", "CLEARASYNC", "QUERY", "STATS", "COMPUTE", "COMPUTEASYNC" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#OPERATION" },
"CamelInfinispanOperationResult": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the header whose value is the result", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT" },
"CamelInfinispanOperationResult": { "index": 8, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": true, "deprecationNote": "Never set nor read by the component. Use CamelInfinispanOperationResultHeader to choose the header that carries the result of an operation.", "autowired": false, "secret": false, "description": "The name of the header whose value is the result. Deprecation note: Never set nor read by the component. Use CamelInfinispanOperationResultHeader to choose the header that carries the result of an operation.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT" },
"CamelInfinispanOperationResultHeader": { "index": 9, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Store the operation result in a header instead of the message body", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#RESULT_HEADER" },
"CamelInfinispanLifespanTime": { "index": 10, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Lifespan time of a value inside the cache. Negative values are interpreted as infinity.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#LIFESPAN_TIME" },
"CamelInfinispanTimeUnit": { "index": 11, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Time Unit of an entry Lifespan Time.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#LIFESPAN_TIME_UNIT" },
"CamelInfinispanMaxIdleTime": { "index": 12, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The maximum amount of time an entry is allowed to be idle for before it is considered as expired.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAX_IDLE_TIME" },
"CamelInfinispanMaxIdleTimeUnit": { "index": 13, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Time Unit of an entry Max Idle Time.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#MAX_IDLE_TIME_UNIT" },
"CamelInfinispanEventData": { "index": 14, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "Object", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The event data.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#EVENT_DATA" },
"CamelInfinispanQueryBuilder": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The QueryBuilder to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#QUERY_BUILDER" },
"CamelInfinispanQueryBuilder": { "index": 15, "kind": "header", "displayName": "", "group": "producer", "label": "producer", "required": false, "javaType": "org.apache.camel.component.infinispan.InfinispanQueryBuilder", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The QueryBuilder to use for QUERY command, if not present the command defaults to the InfinispanConfiguration one", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#QUERY_BUILDER" },
"CamelInfinispanEntryVersion": { "index": 16, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "long", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Provides access to the version of the created cache entry.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#ENTRY_VERSION" },
"CamelInfinispanCommandRetried": { "index": 17, "kind": "header", "displayName": "", "group": "consumer", "label": "consumer", "required": false, "javaType": "boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "This will be true if the write command that caused this had to be retried again due to a topology change.", "constantName": "org.apache.camel.component.infinispan.InfinispanConstants#COMMAND_RETRIED" }
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ public interface InfinispanConstants {
@Metadata(label = "producer", description = "The operation to perform.",
javaType = "org.apache.camel.component.infinispan.InfinispanOperation")
String OPERATION = "CamelInfinispanOperation";
@Metadata(label = "producer", description = "The name of the header whose value is the result", javaType = "String")
@Metadata(label = "producer", description = "The name of the header whose value is the result", javaType = "String",
deprecationNote = "Never set nor read by the component. Use CamelInfinispanOperationResultHeader to choose"
+ " the header that carries the result of an operation.")
@Deprecated
String RESULT = "CamelInfinispanOperationResult";
@Metadata(label = "producer", description = "Store the operation result in a header instead of the message body",
javaType = "String")
Expand All @@ -66,14 +69,14 @@ public interface InfinispanConstants {
@Metadata(label = "producer", description = "The Time Unit of an entry Max Idle Time.",
javaType = "java.util.concurrent.TimeUnit")
String MAX_IDLE_TIME_UNIT = "CamelInfinispanMaxIdleTimeUnit";
@Metadata(label = "consumer",
@Metadata(label = "producer",
description = "Signals that a write operation's return value will be ignored, so reading the existing value from a store or from a remote node is not necessary.",
javaType = "boolean", defaultValue = "false", applicableFor = SCHEME_EMBEDDED)
String IGNORE_RETURN_VALUES = "CamelInfinispanIgnoreReturnValues";
@Metadata(label = "consumer", description = "The event data.", javaType = "Object")
String EVENT_DATA = "CamelInfinispanEventData";
@Metadata(label = "producer",
description = "The QueryBuilder to use for QUERY command, if not present the command defaults to InifinispanConfiguration's one",
description = "The QueryBuilder to use for QUERY command, if not present the command defaults to the InfinispanConfiguration one",
javaType = "org.apache.camel.component.infinispan.InfinispanQueryBuilder")
String QUERY_BUILDER = "CamelInfinispanQueryBuilder";
@Metadata(label = "consumer", description = "Provides access to the version of the created cache entry.", javaType = "long",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ public void setCamelContext(CamelContext camelContext) {
@Override
@ManagedOperation(description = "Adds the key to the store")
public boolean add(String key) {
// need to check first as put will update the entry lifetime so it can not expire its cache lifespan
if (getCache().containsKey(key)) {
// there is already an entry so return false
return false;
}

Boolean put = getCache().put(key, true);
return put == null;
// putIfAbsent leaves an existing entry untouched, so its lifespan is not extended, and it takes a single
// round trip: the remote repository forces return values, so the previous value is always reported
return getCache().putIfAbsent(key, true) == null;
}

@Override
Expand Down
Loading