Class ConfigurableSessionBlacklist

  • All Implemented Interfaces:
    Blacklist<Session>

    public class ConfigurableSessionBlacklist
    extends Object
    implements Blacklist<Session>
    Blacklist which determines the appropriate strategy to use for blacklisting based on current configuration. Strategies may include caching types, or disabling blacklisting entirely. Will be updated automatically when the session service configuration changes.
    • Method Detail

      • createConfigurableSessionBlacklist

        public static ConfigurableSessionBlacklist createConfigurableSessionBlacklist​(CTSBlacklist<Session> ctsBlacklist,
                                                                                      SessionServiceConfig sessionServiceConfig)
        Create a configurable session blacklist based on the session service config.
        Parameters:
        ctsBlacklist - The underlying CTS blacklist.
        sessionServiceConfig - The configuration of the session service.
        Returns:
        The created ConfigurableSessionBlacklist.
      • isBlacklisted

        public boolean isBlacklisted​(Session entry)
                              throws BlacklistException
        Description copied from interface: Blacklist
        Determines whether the entry has previously been blacklisted. Note: entries are only blacklisted until they expire, so a false result does not mean the entry is valid. Further checks should be made to establish entry validity.
        Specified by:
        isBlacklisted in interface Blacklist<Session>
        Parameters:
        entry - The entry to check for blacklisting.
        Returns:
        true if the entry is currently blacklisted, or false if the entry is not blacklisted or has expired (and therefore been removed from the blacklist).
        Throws:
        BlacklistException - if an error occurs when checking the blacklist.
      • subscribe

        public void subscribe​(Blacklist.Listener listener)
        Description copied from interface: Blacklist
        Subscribe for notifications when entries are blacklisted. Depending on the implementation, this may include only entries blacklisted in the local machine, or also notifications for entries blacklisted on other nodes in the cluster.
        Specified by:
        subscribe in interface Blacklist<Session>
        Parameters:
        listener - the event listener to call when entries are blacklisted.