BaseUrlExclusionList
@UnstableApi
class BaseUrlExclusionList
Holds the state of excluded base URLs to be used to select a base URL based on these exclusions.
Summary
Public constructors |
|---|
|
Creates an instance. |
Public functions |
|
|---|---|
Unit |
Excludes the given base URL. |
java-static Int |
getPriorityCount(baseUrls: (Mutable)List<BaseUrl!>!)Returns the number of priority levels of the given list of base URLs. |
Int |
getPriorityCountAfterExclusion(baseUrls: (Mutable)List<BaseUrl!>!)Returns the number of priority levels for the given list of base URLs after exclusion. |
Unit |
reset()Resets the state. |
BaseUrl? |
selectBaseUrl(baseUrls: (Mutable)List<BaseUrl!>!)Selects the base URL to use from the given list. |
Public constructors
Public functions
exclude
fun exclude(baseUrlToExclude: BaseUrl!, exclusionDurationMs: Long): Unit
Excludes the given base URL.
getPriorityCount
java-static fun getPriorityCount(baseUrls: (Mutable)List<BaseUrl!>!): Int
Returns the number of priority levels of the given list of base URLs.
| Returns | |
|---|---|
Int |
The number of priority levels before exclusion. |
getPriorityCountAfterExclusion
fun getPriorityCountAfterExclusion(baseUrls: (Mutable)List<BaseUrl!>!): Int
Returns the number of priority levels for the given list of base URLs after exclusion.
| Returns | |
|---|---|
Int |
The number of priority levels after exclusion. |
selectBaseUrl
fun selectBaseUrl(baseUrls: (Mutable)List<BaseUrl!>!): BaseUrl?
Selects the base URL to use from the given list.
The list is reduced by service location and priority of base URLs that have been passed to exclude. The base URL to use is then selected from the remaining base URLs by priority and weight.
| Returns | |
|---|---|
BaseUrl? |
The selected base URL after exclusion or null if all elements have been excluded. |