Interface IncrementalWorklistUpdate
- All Superinterfaces:
AutoCloseable,Closeable,Serializable,de.aristaflow.adept2.model.communication.ServerSideProxy,UserAttributeContainer,WorklistUpdate
- All Known Implementing Classes:
CachingIncWorklistUpdate
close this worklist update after use to
release the resources. Note that the iteration can only take place in forward direction and no item updates can be skipped.
After an incremental worklist update has been closed, all data retrieving
methods including the one from the super-interface will throw an
IllegalArgumentException on server side and a all methods will throw a
ServiceConnectionException on client side.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.aristaflow.adept2.model.communication.ServerSideProxy
de.aristaflow.adept2.model.communication.ServerSideProxy.LegacySspCloser, de.aristaflow.adept2.model.communication.ServerSideProxy.ServerSideProxyRemover -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longGenerated ID for serialisation.Fields inherited from interface de.aristaflow.adept2.model.communication.ServerSideProxy
DEFAULT_ALIVE_TIME -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Explicitly closes this worklist update which allows to release occupied memory and resources.default voiddrop()Deprecated, for removal: This API element is subject to removal in a future version.getAll()Returns all updates, i.e.intReturns the highest priority of this update, that is the highest priority of all items of this update.getNext(int count) Gets the next specified amount of worklist item updates of this incremental worklist update.Gets the source revision, i.e.longReturns the target revision, i.e.The ID of the worklist for which this update is intended.Methods inherited from interface de.aristaflow.adept2.model.communication.ServerSideProxy
getRemainingAliveTime, keepAliveMethods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
Field Details
-
serialVersionUID
static final long serialVersionUIDGenerated ID for serialisation.- See Also:
-
-
Method Details
-
getWorklistID
UUID getWorklistID()The ID of the worklist for which this update is intended. Additionally marked asImmutable.- Specified by:
getWorklistIDin interfaceWorklistUpdate- 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 revisionup to (and including) thetarget revision (update count). Additionally marked asImmutable.- Specified by:
getSourceRevisionin interfaceWorklistUpdate- 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. Additionally marked as
Immutable.- Specified by:
getTargetRevisionin interfaceWorklistUpdate- 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. Additionally marked asImmutable.- Specified by:
getMaxPriorityin interfaceWorklistUpdate- 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.
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. After calling this method once, this incremental worklist update will beHow 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 closed. You will not be able to use it again, that is, every method will throw anIllegalStateException.- Specified by:
getAllin interfaceWorklistUpdate- Returns:
- The updates / differences between source and target revision.
- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If this incremental worklist update has beenclosed(explicitly or implicitly), aServiceConnectionExceptionwill be thrown on client side.
-
getNext
Gets the next specified amount of worklist item updates of this incremental worklist update.
Be sure to call this method afterwards to release occupied memory and resources.- Parameters:
count- The amount of worklist item updates to retrieve. This has to be > 0.- Returns:
- The next n worklist item updates of this incremental worklist update, where n is the
specified count. In case of an insufficient amount of next elements remaining only the
available elements will be returned. If there are no more next elements,
nullwill be returned. - Throws:
IllegalArgumentException- If count is non-positive (<= 0), anIllegalArgumentExceptionwill be thrown.IllegalStateException- If this worklist update has beenclosed(explicitly or implicitly), anIllegalStateExceptionwill be thrown.de.aristaflow.adept2.model.communication.ServiceConnectionException- If this incremental worklist update has beenclosed(explicitly or implicitly), aServiceConnectionExceptionwill be thrown on client side.
-
close
void close()Explicitly closes this worklist update which allows to release occupied memory and resources. Closing will be done implicitly after the worklist update has been retrieved completely by callinggetAll()once. When retrieving incrementally, be sure to call this method afterwards to release occupied memory and resources.
This method may be called several times. Implementors have to take care of this.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacede.aristaflow.adept2.model.communication.ServerSideProxy- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If this incremental worklist update has beenclosed(explicitly or implicitly), aServiceConnectionExceptionwill be thrown on client side.
-
drop
Deprecated, for removal: This API element is subject to removal in a future version.Use and implementclose()instead.
-
close()instead.