Class ThreadLocalTenantGate

java.lang.Object
com.atlassian.confluence.impl.tenant.ThreadLocalTenantGate

@Deprecated(forRemoval=true) public abstract class ThreadLocalTenantGate extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
since 8.6
A wrapper around a thread-local flag which indicates if the current thread has a permit to access tenanted resources regardless of the state of the TenantRegistry.
Since:
7.5
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static <T> Callable<T>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Close all gates for the given closure on the current thread.
    static <T> Callable<T>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Open all gates for the given closure on the current thread.
    static <T> Callable<T>
    wrap(boolean permitted, Callable<T> callback)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ThreadLocalTenantGate

      public ThreadLocalTenantGate()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • hasTenantPermit

      public static boolean hasTenantPermit()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • wrap

      public static <T> Callable<T> wrap(boolean permitted, Callable<T> callback)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • withTenantPermit

      public static <T> Callable<T> withTenantPermit(Callable<T> callback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Open all gates for the given closure on the current thread.

      This only makes sense in a pre-tenanted state, e.g. during setup allow code to prepare the database before it's made available to a broader audience.

      Parameters:
      callback - the function allowed to pass through the gate
      Returns:
      the permitted function
    • withoutTenantPermit

      public static <T> Callable<T> withoutTenantPermit(Callable<T> callback)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Close all gates for the given closure on the current thread.

      This only makes sense in a pre-tenanted state, if you want to ensure that the given code can not access tenanted resources even though an outer closure might have granted that access, e.g. loading DefaultPluginManager.earlyStartup() plugins which should not be able to eagerly access tenanted resources.

      Parameters:
      callback - the function allowed to pass through the gate
      Returns:
      the permitted function