Interface ClientWorklist
-
- All Superinterfaces:
Serializable
,UserAttributeContainer
,Worklist<ClientWorklistItem>
- All Known Implementing Classes:
ClientWorklistWrapper
,UnregisterClientWorklist
public interface ClientWorklist extends Worklist<ClientWorklistItem>, Serializable
A worklist used at the client-side and therefore supportingClientWorklistItem
s.Additionally to the methods inherited from
Worklist
this interface provides a method for updating the worklist based on aWorklistUpdate
and a method to retrieve its configuration.The client worklist also offers a client-side listener mechanism to get notified when the client worklist gets updated, for both pushed and pulled updates. This is useful e.g. to trigger a GUI refresh.
The
configuration
is specified when requesting the list. To change the configuration it's usually necessary to re-request theClientWorklist
. SeeWorklistUpdateManager.createClientWorklist(de.aristaflow.adept2.base.sessionmanagement.SessionToken, UUID, WorklistUpdateConfiguration, boolean)
for information on what has to be considered when doing this.See
Worklist
for more information about the relationship betweenInternalWorklist
andClientWorklist
.
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
ID for serialisation.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addWorklistListener(ClientWorklistListener listener)
Registers the given listener to be notified about updates to the contents of this client worklist object.static boolean
equals(ClientWorklist me, Object obj)
Implements equality onClientWorklist
s.QualifiedAgent
getAgent()
The agent this worklist belongs to.long
getClientWorklistId()
Gets the ID of this client worklist.UUID
getID()
The system-wide unique ID of this worklist.ClientWorklistListener[]
getWorklistListeners()
Returns the list of registered listeners that are notified about updates to the contents of this client worklist.WorklistUpdateConfiguration
getWorklistUpdateConfiguration()
Get the configuration of the worklist (e. g. the update mode).int
hashCode()
When overridingObject.equals(Object)
one also needs to overrideObject.hashCode()
.void
removeWorklistListener(ClientWorklistListener listener)
Deregisters the given listener from being notified about updates to the contents of this client worklist.void
updateWorklist(WorklistUpdate update)
Updates the worklist with the designated update-instance.void
updateWorklistIncrementally(UUID worklistId, WorklistRevision srcRevision, long trgtRevision, int maxPriority, IncrementalWorklistUpdate update)
Updates the worklist with the designated incremental worklist update.-
Methods inherited from interface de.aristaflow.adept2.model.common.UserAttributeContainer
getUserAttributes, getUserAttributeValue, removeUserAttributeValue, setUserAttributeValue
-
Methods inherited from interface de.aristaflow.adept2.model.worklistmodel.Worklist
equals, getAggregateGroups, getGroupingWorklistItem, getRevision, getWorklistItem, getWorklistItemGroup, getWorklistItems, getWorklistItemsFlat, setAggregateGroups
-
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
ID for serialisation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getID
UUID getID()
The system-wide unique ID of this worklist. This ID is not necessarily persistent and may change between logons. Additionally marked asImmutable
.- Specified by:
getID
in interfaceWorklist<ClientWorklistItem>
- Returns:
- The ID of the worklist.
-
getClientWorklistId
long getClientWorklistId()
Gets the ID of this client worklist. This differs from the worklist ID in that a worklist ID refers to one worklist within the server which can have several client worklists distributed among different clients.- Returns:
- The ID of this client worklist.
-
getAgent
QualifiedAgent getAgent()
The agent this worklist belongs to. Additionally marked asImmutable
.- Specified by:
getAgent
in interfaceWorklist<ClientWorklistItem>
- Returns:
- The agent this worklist belongs to.
-
getWorklistUpdateConfiguration
WorklistUpdateConfiguration getWorklistUpdateConfiguration()
Get the configuration of the worklist (e. g. the update mode). This must not be null!- Returns:
- The configuration of the worklist (never null).
-
updateWorklist
void updateWorklist(WorklistUpdate update)
Updates the worklist with the designated update-instance. It contains all changes made since the last update was sent. Therefore the update may include changes that should not be pushed via an update due to a lower priority. This is necessary to achieve consistent revisions (containing all former changes until the revision) of the client and the server worklist.An update with
source revision update count
0
indicates that the client worklist should discard all items since the update contains the whole worklist.This method is either called by the server (PUSH) or manually by the client (PULL).
This method also supports incremental worklist updates. Implementors have to ensured that the incremental worklist update is dropped after use.
null
as update indicates that this client worklist has been deregistered and does not receive updates any more.- Parameters:
update
- An update-instance containing all changes of the worklist since the last revision was sent. This will benull
to indicate that this client worklist has been deregistered and does not receive updates any more.- Throws:
IllegalArgumentException
- if the worklist ID in the update doesn't match this worklist's IDIllegalStateException
- if the old revision in the update doesn't match this worklist's current revision- See Also:
WorklistUpdateConfiguration
,IncrementalWorklist
-
updateWorklistIncrementally
void updateWorklistIncrementally(UUID worklistId, WorklistRevision srcRevision, long trgtRevision, int maxPriority, IncrementalWorklistUpdate update)
Updates the worklist with the designated incremental worklist update. This is similar toupdateWorklist(WorklistUpdate)
except that the updates are not transfered completely but transferred as requested. The additional parameters are redundant to the attributes of the incremental worklist update. This avoids communication by not needing to retrieve the values from the (remote) incremental worklist update.For push updates this method may be called instead of
updateWorklist(WorklistUpdate)
. So implementors must not rely onupdateWorklist(WorklistUpdate)
being called for push updates. Do not forget to drop the incremental worklist update in implementations.- Parameters:
worklistId
- The ID of the worklist for which this update is intended.srcRevision
- The source revision, i.e. the initialisation date of the worklist to which this update can be applied as well as the update count.trgtRevision
- The target revision, i.e. the new revision the client worklist will have after applying this update.maxPriority
- The highest priority of all items of this update.update
- An update-instance containing all changes of the worklist since the last revision was sent. This will never benull
. If the update should benull
,updateWorklist(WorklistUpdate)
will be used.
Since an incremental update is for slow handling of big data, the callee may take its time and is therefore responsible for closing.- Throws:
IllegalArgumentException
- If the worklist ID in the update does not match this worklist's ID, anIllegalArgumentException
will be thrown.IllegalStateException
- If the old revision in the update does not match this worklist's current revision, anIllegalStateException
will be thrown.- See Also:
updateWorklist(WorklistUpdate)
-
addWorklistListener
void addWorklistListener(ClientWorklistListener listener)
Registers the given listener to be notified about updates to the contents of this client worklist object. Please note that this is a purely client-side mechanism, i.e. listeners will not be directly notified about any server-side changes. They will only be notified about changes to this local worklist client object, triggered by calls toupdateWorklist(WorklistUpdate)
(invoked either during a manual update or by the server via remote communication). The listener mechanism is useful e.g. to trigger a GUI refresh.If the listener is already registered, this method does nothing.
- Parameters:
listener
- The listener to be notified about updates to the contents of this client worklist.
-
removeWorklistListener
void removeWorklistListener(ClientWorklistListener listener)
Deregisters the given listener from being notified about updates to the contents of this client worklist. If the listener is not registered, this method does nothing.- Parameters:
listener
- The listener to be deregistered from being notified about updates to the contents of this client worklist.
-
getWorklistListeners
ClientWorklistListener[] getWorklistListeners()
Returns the list of registered listeners that are notified about updates to the contents of this client worklist.- Returns:
- The list of registered listeners that are notified about updates to the contents of this client worklist.
-
hashCode
int hashCode()
When overridingObject.equals(Object)
one also needs to overrideObject.hashCode()
. Additionally marked asImmutable
and as replacement forObject.hashCode()
.
The explicit replacement is required since the proxy will callObject.hashCode()
instead of this method even if the proxy is defined onClientWorklist
.- Specified by:
hashCode
in interfaceWorklist<ClientWorklistItem>
- Overrides:
hashCode
in classObject
- Returns:
- A hash code value for this object.
-
equals
static boolean equals(ClientWorklist me, Object obj)
Implements equality onClientWorklist
s. This is both objects implementClientWorklist
s, having the same ID as well as the same client worklist ID.This method replaces
Object.equals(Object)
in a remote method call locally. Thus equality will be evaluated by the local proxy object using only properties which are immutable. So if the cached immutable values are present locally (in most cases), the equality will be evaluated without a remote call.- Parameters:
me
- The object on which to callWorklist.equals(Object)
. In case of a remote invocation, this will be the proxy object.obj
- The object with which to compare the current/other object.- Returns:
- Whether the designated objects are equal, that is, both implement
ClientWorklist
have the same ID and the same client worklist ID.
-
-