Interface WorklistUpdate
-
- All Superinterfaces:
Serializable
,UserAttributeContainer
- All Known Subinterfaces:
IncrementalWorklistUpdate
- All Known Implementing Classes:
AssuringWorklistUpdate
,CachingIncWorklistUpdate
public interface WorklistUpdate extends UserAttributeContainer, Serializable
A container to communicate updates in a worklist (i.e. added, removed and changed worklist items) from the server (InternalWorklist
) to the client (ClientWorklist
). It contains the difference between two revisions - source and target revision - and can only be applied to a client worklist whoserevision
equals this update'ssource revision
.
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
Generated ID for serialisation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<WorklistItemUpdate<ClientWorklistItem>>
getAll()
Returns all updates, i.e. the differences from the source revision up to (and including) the target revision.int
getMaxPriority()
Returns the highest priority of this update, that is the highest priority of all items of this update.WorklistRevision
getSourceRevision()
Gets the source revision, i.e. the worklist revision (initialisation date and update count) to which this update can be applied.long
getTargetRevision()
Returns the target revision, i.e. the new revision (update count) the client worklist will have after applying this update.UUID
getWorklistID()
The ID of the worklist for which this update is intended.-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
Generated ID for serialisation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getWorklistID
UUID getWorklistID()
The ID of the worklist for which this update is intended.- Returns:
- The ID of the worklist for which this update is intended.
-
getSourceRevision
WorklistRevision getSourceRevision()
Gets the source revision, i.e. the worklist revision (initialisation date and update count) to which this update can be applied. An exception is the initial revision can always be applied (by clearing the list before applying the update). The update contains all changes that have been made to the worklist since the update count of thesource revision
up to (and including) thetarget revision (update count)
.- Returns:
- The source revision, i.e. the revision of the worklist (initialisation date and update count) to which this update can be applied.
-
getTargetRevision
long getTargetRevision()
Returns the target revision, i.e. the new revision (update count) the client worklist will have after applying this update.The update contains all changes that have been made to the worklist since the
source revision (update count)
up to (and including) thetarget revision
.Like the source revision the target revision refers to the initialisation date of the worklist.
- Returns:
- The target revision, i.e. the new revision the client worklist will have after applying this update.
-
getMaxPriority
int getMaxPriority()
Returns the highest priority of this update, that is the highest priority of all items of this update. This also includes removed items! In case of an empty complete update (source revision 0), the priority will beWorklistConstants.Priority.NORMAL
.- Returns:
- The highest priority of all items of this update.
-
getAll
Collection<WorklistItemUpdate<ClientWorklistItem>> getAll()
Returns all updates, i.e. the differences from the source revision up to (and including) the target revision. The map contains all worklist items including the ones which are deleted since the source revision.The returned collection is unmodifiable.
When compiling the individual recorded updates into a worklist update, the case when there are multiple recorded updates for the same worklist item (i.e. same ID, not necessarily same state) needs special attention. In this case the recorded updates need to be compressed, since a worklist update may only contain one update per worklist item. It is assumed, that every revision only contains one added, removed or changed worklist item. To compress these individual updates, only the first (since the source revision) and the last recorded update of a certain worklist item need to be considered: The state of the client worklist item (which is the key of the map), is the state at the time of its last update.
TheWorklistConstants.WorklistItemUpdateType
(which is the value in the map) is determined by looking at the type of the first and the last recorded update for that item. The following shows the relevant combinations and their results.How different worklist item update types aggregate. type of first recorded update type of last recorded update resulting update type ADDED CHANGED ADDED ADDED REMOVED omit (NOTHING) ADDED ADDED_OR_CHANGED ADDED ADDED REMOVED_OR_NOTHING omit (NOTHING) CHANGED CHANGED CHANGED CHANGED REMOVED REMOVED CHANGED ADDED_OR_CHANGED CHANGED CHANGED REMOVED_OR_NOTHING REMOVED REMOVED ADDED CHANGED REMOVED ADDED_OR_CHANGED CHANGED REMOVED REMOVED_OR_NOTHING REMOVED ADDED_OR_CHANGED CHANGED ADDED_OR_CHANGED ADDED_OR_CHANGED REMOVED REMOVED_OR_NOTHING ADDED_OR_CHANGED ADDED_OR_CHANGED ADDED_OR_CHANGED ADDED_OR_CHANGED REMOVED_OR_NOTHING REMOVED_OR_NOTHING REMOVED_OR_NOTHING ADDED ADDED_OR_CHANGED REMOVED_OR_NOTHING ADDED_OR_CHANGED ADDED_OR_CHANGED REMOVED_OR_NOTHING REMOVED_OR_NOTHING REMOVED_OR_NOTHING - Returns:
- The updates / differences between source and target revision.
-
-