Class ProviderEnvironment


  • public final class ProviderEnvironment
    extends Object
    Environmental information pertaining to a naming provider.
    Author:
    David M. Lloyd
    • 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 by getBlocklist()
        Gets the blocklist for this provider. The map should generally not be mutated, with updates instead going through 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!
         }
        
         
        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 through 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!
         }
        
         
        Returns:
        a concurrent map representing the blocklist
      • updateBlacklist

        @Deprecated
        public void updateBlacklist​(URI location)
        Deprecated.
        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.
        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)