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 supporting ClientWorklistItems.

Additionally to the methods inherited from Worklist this interface provides a method for updating the worklist based on a WorklistUpdate 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 the ClientWorklist. See WorklistUpdateManager.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 between InternalWorklist and ClientWorklist.

  • Field Details

    • serialVersionUID

      static final long serialVersionUID
      ID for serialisation.
      See Also:
  • Method Details

    • getID

      UUID getID()
      The system-wide unique ID of this worklist. This ID is not necessarily persistent and may change between logons. Additionally marked as Immutable.
      Specified by:
      getID in interface Worklist<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 as Immutable.
      Specified by:
      getAgent in interface Worklist<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 be null 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 ID
      IllegalStateException - if the old revision in the update doesn't match this worklist's current revision
      See Also:
    • 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 to updateWorklist(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 on updateWorklist(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 be null. If the update should be null, 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, an IllegalArgumentException will be thrown.
      IllegalStateException - If the old revision in the update does not match this worklist's current revision, an IllegalStateException will be thrown.
      See Also:
    • 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 to updateWorklist(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 overriding Object.equals(Object) one also needs to override Object.hashCode(). Additionally marked as Immutable and as replacement for Object.hashCode().
      The explicit replacement is required since the proxy will call Object.hashCode() instead of this method even if the proxy is defined on ClientWorklist.
      Specified by:
      hashCode in interface Worklist<ClientWorklistItem>
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this object.
    • equals

      static boolean equals(ClientWorklist me, Object obj)
      Implements equality on ClientWorklists. This is both objects implement ClientWorklists, 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 call Worklist.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.