Interface TenantFacade

All Known Implementing Classes:
DefaultTenantFacade
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TenantFacade
Facade for accessing the current Tenant.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.vavr.control.Try<Tenant>
    Returns a Try of the current Tenant.
  • Method Details

    • tryGetCurrentTenant

      @Nonnull io.vavr.control.Try<Tenant> tryGetCurrentTenant()
      Returns a Try of the current Tenant.

      On SAP Business Technology Platform, the availability of a tenant is defined as follows:

      Tenant available Tenant not available
      SAP Business Technology Platform Cloud Foundry A request is present with an "Authorization" header that contains a valid JWT bearer with field "zid", "app_tid", or "zone_uuid".
      As a fallback a JWT will be retrieved from a bound XSUAA instance.
      A request is not available, no "Authorization" header is present in the current request, the JWT bearer does not hold a field "zid", "app_tid", or "zone_uuid", or there is no XSUAA service bound to this application.
      SAP Business Technology Platform Neo Successful JNDI lookup of TenantContext (part of Neo SDK, com.sap.cloud.account.TenantContext). Never. If correctly configured, a TenantContext is always available. If not, a TenantAccessException is thrown.
      Returns:
      A Try of the current Tenant.