Class RegionUtils
java.lang.Object
software.amazon.msk.auth.iam.internals.utils.RegionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic software.amazon.awssdk.regions.RegionextractRegionFromHost(String host) Try to extract the region from the host.static software.amazon.awssdk.regions.RegionextractRegionFromHost(String host, ConfigurableRegionProvider regionProvider) Try to extract the region from the host.
-
Constructor Details
-
RegionUtils
public RegionUtils()
-
-
Method Details
-
extractRegionFromHost
Try to extract the region from the host. If the region is not found, return the default region from the DefaultAwsRegionProviderChain.- Parameters:
host- The host to extract the region from.- Returns:
- The region extracted from the host.
-
extractRegionFromHost
public static software.amazon.awssdk.regions.Region extractRegionFromHost(String host, ConfigurableRegionProvider regionProvider) Try to extract the region from the host. If the region is not found, use the provided custom region provider. If no custom provider is given, fall back to the DefaultAwsRegionProviderChain. If the custom provider fails or returns null, a warning is logged and the DefaultAwsRegionProviderChain is used as fallback.- Parameters:
host- The host to extract the region from.regionProvider- An optional custom region provider to use as fallback. May be null.- Returns:
- The region extracted from the host or resolved by the provider.
-