Class ProviderEnvironment
- java.lang.Object
-
- org.wildfly.naming.client.ProviderEnvironment
-
public final class ProviderEnvironment extends Object
Environmental information pertaining to a naming provider.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProviderEnvironment.BuilderThe builder forProviderEnvironmentinstances.
-
Field Summary
Fields Modifier and Type Field Description static longTIME_MASK
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddropFromBlacklist(URI location)Deprecated.replaced bydropFromBlocklist(URI)voiddropFromBlocklist(URI location)Removes the specified location from the blocklist, allowing it to be used again.Supplier<org.wildfly.security.auth.client.AuthenticationContext>getAuthenticationContextSupplier()Get the authentication context supplier to use.ConcurrentMap<URI,Long>getBlackList()Deprecated.replaced bygetBlocklist()ConcurrentMap<URI,Long>getBlocklist()Gets the blocklist for this provider.List<URI>getProviderUris()Get the list of provider URLs.voidupdateBlacklist(URI location)Deprecated.replaced byupdateBlocklist(URI)voidupdateBlocklist(URI location)Adds location to blocklist, or extends it's back-off value if already present in the blocklist.
-
-
-
Field Detail
-
TIME_MASK
public static final long TIME_MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProviderUris
public List<URI> getProviderUris()
Get the list of provider URLs.- Returns:
- the list of provider URLs (not
null)
-
getBlackList
@Deprecated public ConcurrentMap<URI,Long> getBlackList()
Deprecated.replaced bygetBlocklist()Gets the blocklist for this provider. The map should generally not be mutated, with updates instead going throughupdateBlocklist(URI)anddropFromBlocklist(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 onTIME_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, asupdateBlocklist(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! }- Returns:
- a concurrent map representing the blocklist
-
getBlocklist
public ConcurrentMap<URI,Long> getBlocklist()
Gets the blocklist for this provider. The map should generally not be mutated, with updates instead going throughupdateBlocklist(URI)anddropFromBlocklist(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 onTIME_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, asupdateBlocklist(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! }- Returns:
- a concurrent map representing the blocklist
-
updateBlacklist
@Deprecated public void updateBlacklist(URI location)
Deprecated.replaced byupdateBlocklist(URI)Adds location to blocklist, or extends it's back-off value if already present in the blocklist. Each call doubles the back-off time, as well as resets the starting time. Providers should call this method anytime a location is non-responsive.- Parameters:
location- the URI to blocklist.
-
updateBlocklist
public void updateBlocklist(URI location)
Adds location to blocklist, or extends it's back-off value if already present in the blocklist. Each call doubles the back-off time, as well as resets the starting time. Providers should call this method anytime a location is non-responsive.- Parameters:
location- the URI to blocklist.
-
dropFromBlacklist
@Deprecated public void dropFromBlacklist(URI location)
Deprecated.replaced bydropFromBlocklist(URI)Removes the specified location from the blocklist, allowing it to be used again.- Parameters:
location- the location to remove
-
dropFromBlocklist
public void dropFromBlocklist(URI location)
Removes the specified location from the blocklist, allowing it to be used again.- Parameters:
location- the location to remove
-
getAuthenticationContextSupplier
public Supplier<org.wildfly.security.auth.client.AuthenticationContext> getAuthenticationContextSupplier()
Get the authentication context supplier to use. The default supplier simply captures the current context from the calling thread, but this behavior can be modified by establishing authentication information on the environment of the initial context or by individual naming providers.- Returns:
- the authentication context supplier to use (must not be
null)
-
-