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 SummaryFields 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 SummaryAll 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_NAMEprotected static final String KV_NAME - See Also:
- Constant Field Values
 
 - 
STATE_SUFFIXprotected static final String STATE_SUFFIX - See Also:
- Constant Field Values
 
 - 
OFFSET_SUFFIXprotected static final String OFFSET_SUFFIX - See Also:
- Constant Field Values
 
 - 
GROUP_JOIN_COUNT_SUFFIXprotected static final String GROUP_JOIN_COUNT_SUFFIX - See Also:
- Constant Field Values
 
 - 
GROUP_JOIN_COUNT_TTL_SECONDSprotected static final long GROUP_JOIN_COUNT_TTL_SECONDS - See Also:
- Constant Field Values
 
 - 
CANCELEDprotected static final String CANCELED - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getKeyValueStoreprotected static KeyValueStore getKeyValueStore() 
 - 
getLastOffsetprotected 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
 
 - 
getOffsetKeyprotected static String getOffsetKey(String workId) 
 - 
getStateprotected static Work.State getState(String workId) 
 - 
getStateKeyprotected static String getStateKey(String workId) 
 - 
getGroupKeyprotected static String getGroupKey(String group) 
 - 
isCanceledprotected static boolean isCanceled(String workId) 
 - 
setCanceledprotected static void setCanceled(String workId) 
 - 
setLastOffsetprotected static void setLastOffset(String workId, Long offset, long ttl) 
 - 
setStateprotected static void setState(String workId, Work.State state, long ttl) 
 - 
addGroupJoinWorkprotected static void addGroupJoinWork(String group) 
 - 
removeGroupJoinWorkprotected static boolean removeGroupJoinWork(String group) 
 
- 
 
-