public interface ShiftService<S extends Shift<T>,V,P,T extends Token<T>> extends TokenContainerService<T,S>
Shifts| Modifier and Type | Method and Description |
|---|---|
S |
create(V venue,
P place,
Date startDateTime,
User shiftOwner,
String shiftDisplayName,
ShiftStatus overrideDefaultStatus)
Create a shift/scheduled but dont start it
|
S |
determineRoute(T token)
|
void |
end(S shift) |
List<S> |
findInActiveShifts(Object o,
Predicate<S> filter,
boolean activeTokensOnly)
For an object like user/consumer find the shifts they are in, across all Shifts of type
<S> |
List<T> |
findTokensInActiveShifts(Object o,
Predicate<S> filter,
boolean activeTokensOnly)
For an object like user/consumer find the tokens across all Shifts of type
<S> |
S |
getActiveShift(String name)
Get an Active
Shift by its name |
S |
getActiveShift(V venue,
P place,
String shiftDisplayName)
Get current/
ShiftStatus.ACTIVE Shifts for the Venue and PlaceRefThis method may throw an exception (impl dependent), if the system maintains more than one active Shift for any location. |
List<S> |
getActiveShifts()
Get all current
ShiftStatus.ACTIVE Shifts in System |
List<S> |
getActiveShifts(V venue)
Get all current
ShiftStatus.ACTIVE Shifts for the Venue |
List<S> |
getActiveShifts(V venue,
P place)
|
default S |
getAssignedContainer(T token)
For a
Token get the container |
S |
getAssignedShift(T token)
|
<DAO> DAO |
getDao()
Get any DAO backing this service
|
T |
getFirstToken(S shift,
Collection states)
Get the first token for a group of status
|
List<T> |
getInProcess(S tokenContainer)
Tokens that out of the Q but being processed
|
T |
getLastToken(S shift,
Collection states)
In Some situations a token may need to be put end of Q in a particular State(s).
|
List<T> |
getNextReadyToProcessTokens(T token,
int n)
Get the next N tokens for tokens in the Same Shift that are Ready to be processed.
|
List<T> |
getPreProcess(S tokenContainer)
Tokens that are not yet eligible to be in Q but are being considered.
|
List<T> |
getProcessed(S tokenContainer)
Tokens that out of the Q and processed
|
List<T> |
getReadyToBeProcessed(S tokenContainer,
T lastToken)
Get tokens ready to be processed; from lastToken (excluding it)
|
S |
getScheduledShift(V venue,
P place,
String shiftDisplayName)
Get next scheduled
Shift |
List<S> |
getScheduledShifts(V venue,
P place)
|
S |
getShift(Object id)
Get
Shift from Id. |
List<T> |
getTokens(S shift)
Get all
Token |
List<T> |
getTokens(S shift,
T afterToken,
Collection states)
Get all tokens since a last token (including it)
|
List<T> |
getTokens(S shift,
T afterToken,
Collection states,
PageInfo pageInfo)
Get all tokens since a last token (including it)
|
List<T> |
getTokens(S shift,
T afterToken,
T beforeToken,
Collection states,
PageInfo pageInfo)
Get all tokens since a last token (including it)
|
List<T> |
getTokensFrom(S shift,
T token,
Collection states)
Get all
Tokenss in sequence till (excluding) the token |
List<T> |
getTokensTill(S shift,
T token,
Collection states)
Get all
Tokenss in sequence till (excluding) the token |
boolean |
isActive(S shift)
Check if a
Shift is active or not |
S |
rename(S shift,
String newDisplayName)
Rename as Shift
|
S |
reset(S shift)
Reset/ReStart a new Shift based on data from an existing one.
|
S |
start(S shift,
String metaJSON)
Start a created shift @ a Venue NOW.
|
default S |
start(V venue,
P place,
AuthenticationToken authToken,
String shiftDisplayName) |
S |
start(V venue,
P place,
AuthenticationToken authToken,
String shiftDisplayName,
String metaJSON)
Start a Shift @ a Venue NOW
|
add, getMaxResultSize, getPositions, getQStatesStrategy, getSequence, getType, hasNext, init, linkTokens, lookup, lookupById, lookupBySequence, lookupBySequence, move, poll, poll, poll, poll, remove, save, size, update, updateStatus, updateStatusS start(V venue, P place, AuthenticationToken authToken, String shiftDisplayName, String metaJSON) throws Exception
venue - as Venueplace - as PlaceRef within VenueauthToken - as AuthenticationTokenshiftDisplayName - as String (optional)metaJSON - as String as JSON for optional Shift meta data. Like Client Clock Date/Time etc.Exception - if Shift could not be created or starteddefault S start(V venue, P place, AuthenticationToken authToken, String shiftDisplayName) throws Exception
ExceptionS start(S shift, String metaJSON) throws Exception
metaJSON - as String as JSON for optional Shift meta data. Like Client Clock Date/Time etc.shift - Exception - if Shift was not created earlier or could not be startedS create(V venue, P place, Date startDateTime, User shiftOwner, String shiftDisplayName, ShiftStatus overrideDefaultStatus) throws Exception
venue - as Venueplace - as PlaceRef within VenuestartDateTime - as Date as when the shift will startshiftOwner - a User who owns/manages the shift (optional)shiftDisplayName - as String (optional)overrideDefaultStatus - as ShiftStatus. By default its ShiftStatus.SCHEDULED however on creation itself
if we wish to override this; then explicitly pass the status or use start(Shift, String)Exception - if the Shift could not be createdvoid end(S shift)
shift - Exception - if shift already ended or was never started even (optional)S getShift(Object id)
Shift from Id.
One can use name or some other unique identifier also, however by default Id (Long) is the only one.id - as LongS getActiveShift(String name)
Shift by its namename - as StringShift type <S>boolean isActive(S shift)
Shift is active or notshift - as ShiftList<S> getActiveShifts()
ShiftStatus.ACTIVE Shifts in SystemList<S> getActiveShifts(V venue)
ShiftStatus.ACTIVE Shifts for the VenueS getActiveShift(V venue, P place, String shiftDisplayName)
ShiftStatus.ACTIVE Shifts for the Venue and PlaceRefShift for any location.venue - place - shiftDisplayName - as String (nullable)<S>List<S> getScheduledShifts(V venue, P place)
venue - as Venueplace - as PlaceRefS getScheduledShift(V venue, P place, String shiftDisplayName)
Shiftvenue - place - shiftDisplayName - as String (nullable)<S>S determineRoute(T token) throws TokenProcessingException
token - TokenProcessingExceptionList<T> getTokens(S shift, T afterToken, T beforeToken, Collection states, PageInfo pageInfo)
List<T> getTokens(S shift, T afterToken, Collection states, PageInfo pageInfo)
shift - as ShiftafterToken - as Token type states - as Collection of status type objects (Optional. If not specified will search across all Status)pageInfo - as PageInfo. nullable true.List of TokensList<T> getTokens(S shift, T afterToken, Collection states)
shift - as ShiftafterToken - as Token type states - as Collection of status type objects (Optional. If not specified will search across all Status)List of TokensT getLastToken(S shift, Collection states)
shift - as Shiftstates - as Collection of status type objects (Optional. If not specified will search across all Status)TokenT getFirstToken(S shift, Collection states)
shift - as Shiftstates - as Collection of status type objects (Optional. If not specified will search across all Status)TokenList<T> getNextReadyToProcessTokens(T token, int n)
List<T> getTokensTill(S shift, T token, Collection states)
Tokenss in sequence till (excluding) the tokenshift - as Shifttoken - as Token tillstates - as Collection of status type objects (Optional. If not specified will search across all Status)List of TokensList<T> getTokensFrom(S shift, T token, Collection states)
Tokenss in sequence till (excluding) the tokenshift - as Shifttoken - as Token from (excluding)states - as Collection of status type objects (Optional. If not specified will search across all Status)List of TokensList<T> getReadyToBeProcessed(S tokenContainer, T lastToken)
tokenContainer - as container type lastToken - as Token type List of TokensQStatesStrategyList<T> getPreProcess(S tokenContainer)
tokenContainer - as container type List of TokensQStatesStrategyList<T> getInProcess(S tokenContainer)
tokenContainer - as container type List of TokensQStatesStrategy,
#getProcessed(TokenContainer)List<T> getProcessed(S tokenContainer)
tokenContainer - as container type List of TokensQStatesStrategy,
#getInProcess(TokenContainer)S reset(S shift)
shift - as Shift type <S>S getAssignedShift(T token)
Token determine its assigned Shift.
tokens - default S getAssignedContainer(T token)
TokenContainerServiceToken get the containergetAssignedContainer in interface TokenContainerService<T extends Token<T>,S extends Shift<T>>token - as TokenList<S> findInActiveShifts(Object o, Predicate<S> filter, boolean activeTokensOnly)
<S>object - as object we re findingfilter - as Predicate. If Predicate#test(Shift) is true then only will it include the shift for its search. @nullable trueactiveTokensOnly - as boolean. If true will scan only active tokens or else will scan all tokens in the history.<S>. null if not in any Active ShiftList<T> findTokensInActiveShifts(Object o, Predicate<S> filter, boolean activeTokensOnly)
<S>object - as object we re findingfilter - as Predicate. If Predicate#test(Shift) is true then only will it include the shift for its search. @nullable trueactiveTokensOnly - as boolean. If true will scan only active tokens or else will scan all tokens in the history.<S>. null if not in any Active Shift<DAO> DAO getDao()
Copyright © 2018. All rights reserved.