public class ExternalTenantUrlResolver extends Object implements TenantUrlResolver
TenantUrlResolver
, which makes external calls to the tenant
service for URL resolution of applications and tenant admins.CACHE_ADMIN_URL_BY_TENANT_ID, CACHE_APPLICATION_URL_BY_APPLICATION_ID
Constructor and Description |
---|
ExternalTenantUrlResolver(org.springframework.web.reactive.function.client.WebClient webClient,
ExternalTenantUrlResolverProperties properties) |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getAdminUrl(String tenantId)
Resolves the full url of the admin for the provided tenant.
|
protected String |
getAdminUrlResolverUrl(@NonNull String tenantId) |
Optional<String> |
getApplicationUrl(String applicationId)
Resolves the full url for the provided application.
|
protected String |
getApplicationUrlResolverUrl(@NonNull String applicationId) |
protected ExternalTenantUrlResolverProperties |
getProperties() |
protected org.springframework.web.reactive.function.client.WebClient |
getWebClient() |
protected Optional<String> |
performUrlResolutionRequest(@NonNull String urlResolutionUrl,
Supplier<String> errorLogMessage) |
public ExternalTenantUrlResolver(org.springframework.web.reactive.function.client.WebClient webClient, ExternalTenantUrlResolverProperties properties)
@Cacheable(cacheNames="authCacheApplicationUrlByApplicationId") public Optional<String> getApplicationUrl(String applicationId)
TenantUrlResolver
getApplicationUrl
in interface TenantUrlResolver
applicationId
- the application ID for which to fetch the full url stringprotected Optional<String> performUrlResolutionRequest(@NonNull @NonNull String urlResolutionUrl, Supplier<String> errorLogMessage)
protected String getApplicationUrlResolverUrl(@NonNull @NonNull String applicationId)
@Cacheable(cacheNames="authCacheAdminUrlByTenantId") public Optional<String> getAdminUrl(String tenantId)
TenantUrlResolver
getAdminUrl
in interface TenantUrlResolver
tenantId
- the tenant ID for which to fetch the full url stringprotected org.springframework.web.reactive.function.client.WebClient getWebClient()
protected ExternalTenantUrlResolverProperties getProperties()
Copyright © 2021. All rights reserved.