Class AssuringWorklistUpdate

    • Field Detail

      • worklistID

        protected final UUID worklistID
        The worklist ID.
      • sourceRevision

        protected final long sourceRevision
        The source revision of the update.
      • targetRevision

        protected final long targetRevision
        The target revision of the update.
      • initialisationDate

        protected final long initialisationDate
        The date of the last initialisation of the worklist.
      • maxPriority

        protected final int maxPriority
        The highest priority of all items of this update.
    • Constructor Detail

      • AssuringWorklistUpdate

        public AssuringWorklistUpdate​(UUID worklistID,
                                      long initialisationDate,
                                      int maxPriority,
                                      long sourceRevision,
                                      long targetRevision,
                                      Collection<WorklistItemUpdate<ClientWorklistItem>> updates,
                                      Map<String,​String> userAttributes)
        Creates a new wrapper for the designated worklist update allowing to override and assure the update type of specific worklist items.
        Parameters:
        worklistID -
        initialisationDate -
        maxPriority -
        sourceRevision -
        targetRevision -
        updates - The worklist item which to be wrapped and of which to override and assure update types of specific worklist items.
        userAttributes -
    • Method Detail

      • getWorklistID

        public UUID getWorklistID()
        Description copied from interface: WorklistUpdate
        The ID of the worklist for which this update is intended.
        Specified by:
        getWorklistID in interface WorklistUpdate
        Returns:
        The ID of the worklist for which this update is intended.
      • getSourceRevision

        public WorklistRevision getSourceRevision()
        Description copied from interface: WorklistUpdate
        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 the source revision up to (and including) the target revision (update count).
        Specified by:
        getSourceRevision in interface WorklistUpdate
        Returns:
        The source revision, i.e. the revision of the worklist (initialisation date and update count) to which this update can be applied.
      • getTargetRevision

        public long getTargetRevision()
        Description copied from interface: WorklistUpdate
        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) the target revision.

        Like the source revision the target revision refers to the initialisation date of the worklist.

        Specified by:
        getTargetRevision in interface WorklistUpdate
        Returns:
        The target revision, i.e. the new revision the client worklist will have after applying this update.
      • getMaxPriority

        public int getMaxPriority()
        Description copied from interface: WorklistUpdate
        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 be WorklistConstants.Priority.NORMAL.
        Specified by:
        getMaxPriority in interface WorklistUpdate
        Returns:
        The highest priority of all items of this update.
      • getAll

        public Collection<WorklistItemUpdate<ClientWorklistItem>> getAll()
        Description copied from interface: WorklistUpdate
        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.
        The WorklistConstants.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
        ADDEDCHANGEDADDED
        ADDEDREMOVEDomit (NOTHING)
        ADDEDADDED_OR_CHANGEDADDED
        ADDEDREMOVED_OR_NOTHINGomit (NOTHING)
        CHANGEDCHANGEDCHANGED
        CHANGEDREMOVEDREMOVED
        CHANGEDADDED_OR_CHANGEDCHANGED
        CHANGEDREMOVED_OR_NOTHINGREMOVED
        REMOVEDADDEDCHANGED
        REMOVEDADDED_OR_CHANGEDCHANGED
        REMOVEDREMOVED_OR_NOTHINGREMOVED
        ADDED_OR_CHANGEDCHANGEDADDED_OR_CHANGED
        ADDED_OR_CHANGEDREMOVEDREMOVED_OR_NOTHING
        ADDED_OR_CHANGEDADDED_OR_CHANGEDADDED_OR_CHANGED
        ADDED_OR_CHANGEDREMOVED_OR_NOTHINGREMOVED_OR_NOTHING
        REMOVED_OR_NOTHINGADDEDADDED_OR_CHANGED
        REMOVED_OR_NOTHINGADDED_OR_CHANGEDADDED_OR_CHANGED
        REMOVED_OR_NOTHINGREMOVED_OR_NOTHINGREMOVED_OR_NOTHING
        Other combinations don't make any sense and therefore shouldn't occur. If there's only one recorded update for an item use that update's type.
        Specified by:
        getAll in interface WorklistUpdate
        Returns:
        The updates / differences between source and target revision.