Package org.nuxeo.ecm.core.work
Class WorkStateHelper
java.lang.Object
org.nuxeo.ecm.core.work.WorkStateHelper
Work state helper to handle, out-of-API, distributed, work states.
- Since:
- 10.2
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
addGroupJoinWork
(String group) protected static String
getGroupKey
(String group) protected static KeyValueStore
protected static long
getLastOffset
(String workId) Returns the last offset created for a given work id.protected static String
getOffsetKey
(String workId) protected static Work.State
protected static String
getStateKey
(String workId) protected static boolean
isCanceled
(String workId) protected static boolean
removeGroupJoinWork
(String group) protected static void
setCanceled
(String workId) protected static void
setLastOffset
(String workId, Long offset, long ttl) protected static void
setState
(String workId, Work.State state, long ttl)
-
Field Details
-
KV_NAME
- See Also:
-
STATE_SUFFIX
- See Also:
-
OFFSET_SUFFIX
- See Also:
-
GROUP_JOIN_COUNT_SUFFIX
- See Also:
-
GROUP_JOIN_COUNT_TTL_SECONDS
protected static final long GROUP_JOIN_COUNT_TTL_SECONDS- See Also:
-
CANCELED
- See Also:
-
-
Method Details
-
getKeyValueStore
-
getLastOffset
Returns the last offset created for a given work id.- Parameters:
workId
- id of the work whose we want the last offset- Returns:
- the last offset or -1 for convenience
- Since:
- 10.3
-
getOffsetKey
-
getState
-
getStateKey
-
getGroupKey
-
isCanceled
-
setCanceled
-
setLastOffset
-
setState
-
addGroupJoinWork
-
removeGroupJoinWork
-