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 StringCANCELEDprotected static StringGROUP_JOIN_COUNT_SUFFIXprotected static longGROUP_JOIN_COUNT_TTL_SECONDSprotected static StringKV_NAMEprotected static StringOFFSET_SUFFIXprotected static StringSTATE_SUFFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddGroupJoinWork(String group)protected static StringgetGroupKey(String group)protected static KeyValueStoregetKeyValueStore()protected static longgetLastOffset(String workId)Returns the last offset created for a given work id.protected static StringgetOffsetKey(String workId)protected static Work.StategetState(String workId)protected static StringgetStateKey(String workId)protected static booleanisCanceled(String workId)protected static booleanremoveGroupJoinWork(String group)protected static voidsetCanceled(String workId)protected static voidsetLastOffset(String workId, Long offset, long ttl)protected static voidsetState(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)
-
-