Package org.nuxeo.ecm.core.work
Class WorkStateHelper
- java.lang.Object
-
- org.nuxeo.ecm.core.work.WorkStateHelper
-
public class WorkStateHelper extends Object
Work state helper to handle, out-of-API, distributed, work states.- Since:
- 10.2
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
CANCELED
protected static String
GROUP_JOIN_COUNT_SUFFIX
protected static long
GROUP_JOIN_COUNT_TTL_SECONDS
protected static String
KV_NAME
protected static String
OFFSET_SUFFIX
protected static String
STATE_SUFFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
addGroupJoinWork(String group)
protected static String
getGroupKey(String group)
protected static KeyValueStore
getKeyValueStore()
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
getState(String workId)
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 Detail
-
KV_NAME
protected static final String KV_NAME
- See Also:
- Constant Field Values
-
STATE_SUFFIX
protected static final String STATE_SUFFIX
- See Also:
- Constant Field Values
-
OFFSET_SUFFIX
protected static final String OFFSET_SUFFIX
- See Also:
- Constant Field Values
-
GROUP_JOIN_COUNT_SUFFIX
protected static final String GROUP_JOIN_COUNT_SUFFIX
- See Also:
- Constant Field Values
-
GROUP_JOIN_COUNT_TTL_SECONDS
protected static final long GROUP_JOIN_COUNT_TTL_SECONDS
- See Also:
- Constant Field Values
-
CANCELED
protected static final String CANCELED
- See Also:
- Constant Field Values
-
-
Method Detail
-
getKeyValueStore
protected static KeyValueStore getKeyValueStore()
-
getLastOffset
protected static long getLastOffset(String workId)
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
-
getState
protected static Work.State getState(String workId)
-
isCanceled
protected static boolean isCanceled(String workId)
-
setCanceled
protected static void setCanceled(String workId)
-
setState
protected static void setState(String workId, Work.State state, long ttl)
-
addGroupJoinWork
protected static void addGroupJoinWork(String group)
-
removeGroupJoinWork
protected static boolean removeGroupJoinWork(String group)
-
-