Class RefreshSpec

java.lang.Object
wt.fc.collections.RefreshSpec
All Implemented Interfaces:
Externalizable, Serializable

public class RefreshSpec extends Object implements Externalizable
Encapsulates the parameters that can be passed to the CollectionsManager refresh APIs.

Supported API: true

Extendable: false
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final RefreshSpec
    A default, unmodfiable, reusable refresh spec.
    static final RefreshSpec
    An unmodifiable, reusable RefreshSpec with the same configuration as the DEFAULT spec, exception that lock is true.
    static final int
    One of the spec's possible linkActions.
    static final int
    One of the spec's possible linkActions.
    static final int
    One of the spec's possible linkActions.
    static final int
    One of the spec's possible linkActions.
    static final int
    One of the spec's possible staleActions.
    static final int
    One of the spec's possible deleteActions.
    static final int
    One of the spec's possible deleteActions.
    static final int
    One of the spec's possible deleteActions.
    static final int
    One of the spec's possible staleActions.
    static final int
    One of the spec's possible staleActions.
  • Constructor Summary

    Constructors
    Constructor
    Description


    Supported API: true
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the value of the attribute: deleteAction; Determines what the refresh will do with objects that are in the collection that have been deleted.
    int
    Gets the value of the attribute: linkAction; Determines how the refresh will handle a Link object's roles.
    int
    Gets the value of the attribute: staleAction; Determines what the refresh will do with objects that are in the collection that are stale.
    boolean
    Gets the value of the attribute: disableAccess; When true, the refresh is performed with access control disabled.
    boolean
    Gets the value of the attribute: forceRefresh; When true, all objects are refreshed from the database regardless of whether or not they are stale.
    boolean
    Gets the value of the attribute: lock; When true, all the objects in the collection (stale or not) are locked for the remainder of the current transaction.
    boolean
    Gets the value of the attribute: useReadOnly; This property allows server-side refreshes to use read-only instances of objects in the object reference cache.
    void
    setDeleteAction(int a_DeleteAction)
    Sets the value of the attribute: deleteAction; Determines what the refresh will do with objects that are in the collection that have been deleted.
    void
    setDisableAccess(boolean a_DisableAccess)
    Sets the value of the attribute: disableAccess; When true, the refresh is performed with access control disabled.
    void
    setForceRefresh(boolean a_ForceRefresh)
    Sets the value of the attribute: forceRefresh; When true, all objects are refreshed from the database regardless of whether or not they are stale.
    void
    setLinkAction(int a_LinkAction)
    Sets the value of the attribute: linkAction; Determines how the refresh will handle a Link object's roles.
    void
    setLock(boolean a_Lock)
    Sets the value of the attribute: lock; When true, all the objects in the collection (stale or not) are locked for the remainder of the current transaction.
    void
    setStaleAction(int a_StaleAction)
    Sets the value of the attribute: staleAction; Determines what the refresh will do with objects that are in the collection that are stale.
    void
    setUseReadOnly(boolean a_UseReadOnly)
    Sets the value of the attribute: useReadOnly; This property allows server-side refreshes to use read-only instances of objects in the object reference cache.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final RefreshSpec DEFAULT
      A default, unmodfiable, reusable refresh spec. The default spec has the following state:
      deleteActionVALIDATE_DELETE
      disableAccessfalse
      lockfalse
      staleActionUPDATE_STALE


      Supported API: true
    • LOCK_AND_REFRESH

      public static final RefreshSpec LOCK_AND_REFRESH
      An unmodifiable, reusable RefreshSpec with the same configuration as the DEFAULT spec, exception that lock is true.

      Supported API: true
    • REMOVE_DELETE

      public static final int REMOVE_DELETE
      One of the spec's possible deleteActions.

      Supported API: true
      See Also:
    • RETAIN_DELETE

      public static final int RETAIN_DELETE
      One of the spec's possible deleteActions.

      Supported API: true
      See Also:
    • VALIDATE_DELETE

      public static final int VALIDATE_DELETE
      One of the spec's possible deleteActions.

      Supported API: true
      See Also:
    • REFRESH_STALE

      public static final int REFRESH_STALE
      One of the spec's possible staleActions.

      Supported API: true
      See Also:
    • VALIDATE_STALE

      public static final int VALIDATE_STALE
      One of the spec's possible staleActions.

      Supported API: true
      See Also:
    • REFRESH_BOTH_ROLES

      public static final int REFRESH_BOTH_ROLES
      One of the spec's possible linkActions.

      Supported API: true
      See Also:
    • REFRESH_ROLEA

      public static final int REFRESH_ROLEA
      One of the spec's possible linkActions.

      Supported API: true
      See Also:
    • REFRESH_ROLEB

      public static final int REFRESH_ROLEB
      One of the spec's possible linkActions.

      Supported API: true
      See Also:
    • VALIDATE_STALE_IMMEDIATELY

      public static final int VALIDATE_STALE_IMMEDIATELY
      One of the spec's possible staleActions.

      Supported API: true
      See Also:
  • Constructor Details

    • RefreshSpec

      public RefreshSpec()


      Supported API: true
  • Method Details

    • getDeleteAction

      public int getDeleteAction()
      Gets the value of the attribute: deleteAction; Determines what the refresh will do with objects that are in the collection that have been deleted. The options are:
      • VALIDATE_DELETE: Throw a CollectionContainsDeleteAction if the collection contains any deleted objects (Default)
      • REMOVE_DELETE: Silently remove deleted objects from the collection.
      • RETAIN_DELETE: Do not remove deleted objects from the collection.


      Supported API: true
      Returns:
      int
    • setDeleteAction

      public void setDeleteAction(int a_DeleteAction) throws WTPropertyVetoException
      Sets the value of the attribute: deleteAction; Determines what the refresh will do with objects that are in the collection that have been deleted. The options are:
      • VALIDATE_DELETE: Throw a CollectionContainsDeleteAction if the collection contains any deleted objects (Default)
      • REMOVE_DELETE: Silently remove deleted objects from the collection.
      • RETAIN_DELETE: Do not remove deleted objects from the collection.


      Supported API: true
      Parameters:
      a_DeleteAction -
      Throws:
      WTPropertyVetoException
    • isDisableAccess

      public boolean isDisableAccess()
      Gets the value of the attribute: disableAccess; When true, the refresh is performed with access control disabled. This is a transient property that defaults to false, so it only has an effect when assigned on the server.

      Supported API: true
      Returns:
      boolean
    • setDisableAccess

      public void setDisableAccess(boolean a_DisableAccess) throws WTPropertyVetoException
      Sets the value of the attribute: disableAccess; When true, the refresh is performed with access control disabled. This is a transient property that defaults to false, so it only has an effect when assigned on the server.

      Supported API: true
      Parameters:
      a_DisableAccess -
      Throws:
      WTPropertyVetoException
    • isForceRefresh

      public boolean isForceRefresh()
      Gets the value of the attribute: forceRefresh; When true, all objects are refreshed from the database regardless of whether or not they are stale. When false, only stale objects are refreshed, and non-stale objects are left untouched.

      Default: true

      Supported API: true

      Returns:
      boolean
    • setForceRefresh

      public void setForceRefresh(boolean a_ForceRefresh) throws WTPropertyVetoException
      Sets the value of the attribute: forceRefresh; When true, all objects are refreshed from the database regardless of whether or not they are stale. When false, only stale objects are refreshed, and non-stale objects are left untouched.

      Default: true

      Supported API: true

      Parameters:
      a_ForceRefresh -
      Throws:
      WTPropertyVetoException
    • getLinkAction

      public int getLinkAction()
      Gets the value of the attribute: linkAction; Determines how the refresh will handle a Link object's roles. The options are:
      • REFRESH_BOTH_ROLES: Refresh the link and both role objects (Default)
      • REFRESH_ROLEA: Refresh the link and the role a object.
      • REFRESH_ROLEB: Refresh the link and the role b object
      • REFRESH_LINK_ONLY: Do not refresh either role; only the link object itself


      Supported API: true
      Returns:
      int
      See Also:
    • setLinkAction

      public void setLinkAction(int a_LinkAction) throws WTPropertyVetoException
      Sets the value of the attribute: linkAction; Determines how the refresh will handle a Link object's roles. The options are:
      • REFRESH_BOTH_ROLES: Refresh the link and both role objects (Default)
      • REFRESH_ROLEA: Refresh the link and the role a object.
      • REFRESH_ROLEB: Refresh the link and the role b object
      • REFRESH_LINK_ONLY: Do not refresh either role; only the link object itself


      Supported API: true
      Parameters:
      a_LinkAction -
      Throws:
      WTPropertyVetoException
      See Also:
    • isLock

      public boolean isLock()
      Gets the value of the attribute: lock; When true, all the objects in the collection (stale or not) are locked for the remainder of the current transaction.

      Supported API: true
      Returns:
      boolean
    • setLock

      public void setLock(boolean a_Lock) throws WTPropertyVetoException
      Sets the value of the attribute: lock; When true, all the objects in the collection (stale or not) are locked for the remainder of the current transaction.

      Supported API: true
      Parameters:
      a_Lock -
      Throws:
      WTPropertyVetoException
    • getStaleAction

      public int getStaleAction()
      Gets the value of the attribute: staleAction; Determines what the refresh will do with objects that are in the collection that are stale. The options are:
      • REFRESH_STALE: Gets the latest version of the stale object. (Default)
      • VALIDATE_STALE: Throw a CollectionContainsStaleException with the identities of all stale objects in the collection
      • VALIDATE_STALE_IMMEDIATELY: Throw a CollectionContainsStaleException with the identity of the first stale object encountered by the refresh. This may save some processing time if the caller does not have a need to display the stale objects to a client or log file.


      Supported API: true
      Returns:
      int
    • setStaleAction

      public void setStaleAction(int a_StaleAction) throws WTPropertyVetoException
      Sets the value of the attribute: staleAction; Determines what the refresh will do with objects that are in the collection that are stale. The options are:
      • REFRESH_STALE: Gets the latest version of the stale object. (Default)
      • VALIDATE_STALE: Throw a CollectionContainsStaleException with the identities of all stale objects in the collection
      • VALIDATE_STALE_IMMEDIATELY: Throw a CollectionContainsStaleException with the identity of the first stale object encountered by the refresh. This may save some processing time if the caller does not have a need to display the stale objects to a client or log file.


      Supported API: true
      Parameters:
      a_StaleAction -
      Throws:
      WTPropertyVetoException
    • isUseReadOnly

      public boolean isUseReadOnly()
      Gets the value of the attribute: useReadOnly; This property allows server-side refreshes to use read-only instances of objects in the object reference cache. By default, the refresh will clone these objects to avoid corrupting the cache. The objects stored by the reference cache are those that have reference types that descend from CachedObjectReference

      Supported API: true
      Returns:
      boolean
      See Also:
      • ReferenceCache
    • setUseReadOnly

      public void setUseReadOnly(boolean a_UseReadOnly) throws WTPropertyVetoException
      Sets the value of the attribute: useReadOnly; This property allows server-side refreshes to use read-only instances of objects in the object reference cache. By default, the refresh will clone these objects to avoid corrupting the cache. The objects stored by the reference cache are those that have reference types that descend from CachedObjectReference

      Supported API: true
      Parameters:
      a_UseReadOnly -
      Throws:
      WTPropertyVetoException
      See Also:
      • ReferenceCache