Interface CollectionRefreshQueueDelegate


public interface CollectionRefreshQueueDelegate
Delegate for managing background refreshes of supported PersistedCollectionHolder types (currently only package types). For supported persisted collection holder types, the out-of-the-box clients will call one of the isEnabledForBackgroundRefresh methods to determine if holders of that type should be refreshed in the background or foreground. A site may define their own implementation of these methods for selective backgrounding of collection holders based on type or specifically for the instance.

On startup, method createQueues will be called to create the processing queues to be utilized for processing background refresh tasks for persisted collection holders. A site may define their own implementation of this method for more sophisticated queue handling.

When a refresh is requested to be done in the background (whether by a user or programmatically by calling a background-specific refresh method), method getQueueName will be called to request the preferred queue to place the refresh task on for the collection holder instance. A site may define their own implementation of this method for more sophisticated queue handling.

Method isExecutingOnQueue will called to determine if a persisted collection holder already has a pending refresh on one of the refresh queues.

Supported API: true Extendable: false

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates the queues which will process background refreshes.
    getQueueName(ObjectReference refPersistedCollectionHolder)
    For the passed in reference to a PersistedCollectionHolder instance, this method returns the name of the preferred queue to assign the refresh task to.
    boolean
    For the passed in type identifier and organization container, this method returns whether the refresh should be done in the background via a queue or in the foreground.
    boolean
    isEnabledForBackgroundRefresh(ObjectReference refPersistedCollectionHolder)
    For the passed in reference to a PersistedCollectionHolder, this method returns whether a refresh for it should be performed in the background via a queue or in the foreground.
    boolean
    isExecutingOnQueue(ObjectReference refPersistedCollectionHolder)
    For the passed in reference to a PersistedCollectionHolder instance, this method returns whether that holder instance is already queued up for a pending refresh in background.
  • Method Details

    • createQueues

      void createQueues() throws WTException
      Creates the queues which will process background refreshes. This will be called on system startup when the system is configured to support background refreshes of persisted collections.

      Supported API: true

      Throws:
      WTException
    • isEnabledForBackgroundRefresh

      boolean isEnabledForBackgroundRefresh(TypeIdentifier typeIdentifier, OrgContainer orgContainer)
      For the passed in type identifier and organization container, this method returns whether the refresh should be done in the background via a queue or in the foreground. The out-of-the-box implementation will return true for all non-replication package types when the system is configured for background refresh. Managed collections will return false, meaning refreshes will continue to be performed in foreground.

      Supported API: true

      Parameters:
      typeIdentifier - type identifier of PersistedCollectionHolder to inspect for background configuration
      orgContainer - organization container context
      Returns:
      true if refresh should be performed in background; false if it should be performed in foreground
      See Also:
    • isEnabledForBackgroundRefresh

      boolean isEnabledForBackgroundRefresh(ObjectReference refPersistedCollectionHolder)
      For the passed in reference to a PersistedCollectionHolder, this method returns whether a refresh for it should be performed in the background via a queue or in the foreground. The out-of-the-box implementation will return true for all non-replication package types when the system is configured for background refresh. Managed collections will return false, meaning refreshes will continue to be performed in the foreground.

      Supported API: true

      Parameters:
      refPersistedCollectionHolder - reference to a PersistedCollectionHolder instance
      Returns:
      true if refresh should be performed in background; false if it should be performed in foreground
      See Also:
    • getQueueName

      String getQueueName(ObjectReference refPersistedCollectionHolder) throws WTException
      For the passed in reference to a PersistedCollectionHolder instance, this method returns the name of the preferred queue to assign the refresh task to. The out-of-the-box implementation will apply a simple algorithm for determining which queue should be used. Roughly, the algorithm will choose a queue in the following manner:

      1. If the holder is already on a queue, it will be placed on that same queue
      2. If the holder is not already on a queue, it will be placed on the queue with the fewest entries

      Supported API: true

      Parameters:
      refPersistedCollectionHolder - reference to PersistedCollectionHolder
      Returns:
      name of queue which would be preferred for assigning background task to
      Throws:
      WTException
    • isExecutingOnQueue

      boolean isExecutingOnQueue(ObjectReference refPersistedCollectionHolder) throws WTException
      For the passed in reference to a PersistedCollectionHolder instance, this method returns whether that holder instance is already queued up for a pending refresh in background. This method will return true if the a background refresh task exists and the associated queue entry is at a status of READY, SUSPENDED, or EXECUTING.

      Supported API: true

      Parameters:
      refPersistedCollectionHolder - reference to a PersistedCollectionHolder instance to determine if already refreshing in background
      Returns:
      true if collection holder has a pending refresh already in queue
      Throws:
      WTException