Class ClusterAwareInetAddressCache

java.lang.Object
com.atlassian.crowd.util.ClusterAwareInetAddressCache

public class ClusterAwareInetAddressCache extends Object
Utility class to store in a cache whether the InetAddress is permitted or forbidden to make a request to the Crowd server.
  • Field Details

  • Constructor Details

  • Method Details

    • registerClusterListener

      @PostConstruct public void registerClusterListener()
    • unregisterClusterListener

      @PreDestroy public void unregisterClusterListener()
    • setPermitted

      public void setPermitted(Application application, InetAddress address, boolean permitted)
      Sets in the cache that address is permitted/forbidden from making a request to the Crowd server.
      Parameters:
      application - application that is requesting the connection.
      address - InetAddress to set
      permitted - whether address is permitted or forbidden to make a request.
    • getPermitted

      @Nullable public Boolean getPermitted(Application application, InetAddress address)
      Gets from cache whether the application with address is permitted to make a request to the Crowd server.
      Parameters:
      application - Application making the request.
      address - address of the client making the request.
      Returns:
      an indication of whether the application with address is permitted to make a request, or null if unknown
    • clear

      public void clear()
      Clears the entire cache storing the address permissions.