public final class ProviderEnvironment extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ProviderEnvironment.Builder
The builder for
ProviderEnvironment instances. |
Modifier and Type | Field and Description |
---|---|
static long |
TIME_MASK |
Modifier and Type | Method and Description |
---|---|
void |
dropFromBlacklist(URI location)
Deprecated.
replaced by
dropFromBlocklist(URI) |
void |
dropFromBlocklist(URI location)
Removes the specified location from the blocklist, allowing it to be
used again.
|
Supplier<AuthenticationContext> |
getAuthenticationContextSupplier()
Get the authentication context supplier to use.
|
ConcurrentMap<URI,Long> |
getBlackList()
Deprecated.
replaced by
getBlocklist() |
ConcurrentMap<URI,Long> |
getBlocklist()
Gets the blocklist for this provider.
|
List<URI> |
getProviderUris()
Get the list of provider URLs.
|
void |
updateBlacklist(URI location)
Deprecated.
replaced by
updateBlocklist(URI) |
void |
updateBlocklist(URI location)
Adds location to blocklist, or extends it's back-off value if already
present in the blocklist.
|
public static final long TIME_MASK
public List<URI> getProviderUris()
null
)@Deprecated public ConcurrentMap<URI,Long> getBlackList()
getBlocklist()
updateBlocklist(URI)
and dropFromBlocklist(URI)
.
The map is keyed by destination URI, as specified by
PROVIDER_URL
. The value is a long that loosely corresponds
to an expiration timestamp. More specifically the time portion is the
first 49 bits, retrievable using a bitwise AND on TIME_MASK
. The
remaining bits are used to store the current back-off multiplier. These
are typically not of interest to a user or provider implementor, as
updateBlocklist(URI)
will update them accordingly.
A simple provider implementation would perform the falling pseudo-code when selecting a destination:
URI location = ...
Long timeout = env.getBlackList().get(location);
if (timeout == null || time >= (timeout & TIME_MASK)) {
// blocklist entry expired!!
} else {
// Ignoring, still blocklisted!
}
public ConcurrentMap<URI,Long> getBlocklist()
updateBlocklist(URI)
and dropFromBlocklist(URI)
.
The map is keyed by destination URI, as specified by
PROVIDER_URL
. The value is a long that loosely corresponds
to an expiration timestamp. More specifically the time portion is the
first 49 bits, retrievable using a bitwise AND on TIME_MASK
. The
remaining bits are used to store the current back-off multiplier. These
are typically not of interest to a user or provider implementor, as
updateBlocklist(URI)
will update them accordingly.
A simple provider implementation would perform the falling pseudo-code when selecting a destination:
URI location = ...
Long timeout = env.getBlocklist().get(location);
if (timeout == null || time >= (timeout & TIME_MASK)) {
// blocklist entry expired!!
} else {
// Ignoring, still blocklisted!
}
@Deprecated public void updateBlacklist(URI location)
updateBlocklist(URI)
location
- the URI to blocklist.public void updateBlocklist(URI location)
location
- the URI to blocklist.@Deprecated public void dropFromBlacklist(URI location)
dropFromBlocklist(URI)
location
- the location to removepublic void dropFromBlocklist(URI location)
location
- the location to removepublic Supplier<AuthenticationContext> getAuthenticationContextSupplier()
null
)Copyright © 2021 JBoss by Red Hat. All rights reserved.