Class ExternalTenantUrlResolver
- java.lang.Object
-
- com.broadleafcommerce.auth.tenant.service.ExternalTenantUrlResolver
-
- All Implemented Interfaces:
TenantUrlResolver
public class ExternalTenantUrlResolver extends Object implements TenantUrlResolver
The default implementation ofTenantUrlResolver, which makes external calls to the tenant service for URL resolution of applications and tenant admins.
-
-
Field Summary
-
Fields inherited from interface com.broadleafcommerce.auth.tenant.service.TenantUrlResolver
CACHE_ADMIN_URL_BY_TENANT_ID, CACHE_APPLICATION_URL_BY_APPLICATION_ID
-
-
Constructor Summary
Constructors Constructor Description ExternalTenantUrlResolver(org.springframework.web.reactive.function.client.WebClient webClient, ExternalTenantUrlResolverProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>getAdminUrl(String tenantId)Resolves the full url of the admin for the provided tenant.protected StringgetAdminUrlResolverUrl(@NonNull String tenantId)Optional<String>getApplicationUrl(String applicationId)Resolves the full url for the provided application.protected StringgetApplicationUrlResolverUrl(@NonNull String applicationId)protected ExternalTenantUrlResolverPropertiesgetProperties()protected org.springframework.web.reactive.function.client.WebClientgetWebClient()protected Optional<String>performUrlResolutionRequest(@NonNull String urlResolutionUrl, Supplier<String> errorLogMessage)
-
-
-
Constructor Detail
-
ExternalTenantUrlResolver
public ExternalTenantUrlResolver(org.springframework.web.reactive.function.client.WebClient webClient, ExternalTenantUrlResolverProperties properties)
-
-
Method Detail
-
getApplicationUrl
@Cacheable(cacheNames="authCacheApplicationUrlByApplicationId") public Optional<String> getApplicationUrl(String applicationId)
Description copied from interface:TenantUrlResolverResolves the full url for the provided application. This is used for discovery of the location where an application is served.- Specified by:
getApplicationUrlin interfaceTenantUrlResolver- Parameters:
applicationId- the application ID for which to fetch the full url string- Returns:
- the full url string for the application
-
performUrlResolutionRequest
protected Optional<String> performUrlResolutionRequest(@NonNull @NonNull String urlResolutionUrl, Supplier<String> errorLogMessage)
-
getApplicationUrlResolverUrl
protected String getApplicationUrlResolverUrl(@NonNull @NonNull String applicationId)
-
getAdminUrl
@Cacheable(cacheNames="authCacheAdminUrlByTenantId") public Optional<String> getAdminUrl(String tenantId)
Description copied from interface:TenantUrlResolverResolves the full url of the admin for the provided tenant. This is used for discovery of the location where the admin is served.- Specified by:
getAdminUrlin interfaceTenantUrlResolver- Parameters:
tenantId- the tenant ID for which to fetch the full url string- Returns:
- the full url string for the tenant
-
getWebClient
protected org.springframework.web.reactive.function.client.WebClient getWebClient()
-
getProperties
protected ExternalTenantUrlResolverProperties getProperties()
-
-