Class ServerSetBlacklistManager


  • @Mutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class ServerSetBlacklistManager
    extends java.lang.Object
    This class provides a mechanism for maintaining a blacklist of servers that have recently been found to be unacceptable for use by a server set. Server sets that use this class can temporarily avoid trying to access servers that may be experiencing problems.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<ObjectPair<java.lang.String,​java.lang.Integer>> getBlacklistedServers()
      Retrieves a list of the servers currently on the blacklist.
      boolean isBlacklisted​(ObjectPair<java.lang.String,​java.lang.Integer> hostPort)
      Indicates whether the specified server is currently on the blacklist.
      boolean isBlacklisted​(java.lang.String host, int port)
      Indicates whether the specified server is currently on the blacklist.
      boolean isEmpty()
      Indicates whether the blacklist is currently empty.
      void shutDown()
      Shuts down the blacklist manager.
      int size()
      Retrieves the number of servers currently on the blacklist.
      java.lang.String toString()
      Retrieves a string representation of this server set blacklist manager.
      void toString​(java.lang.StringBuilder buffer)
      Appends a string representation of this server set blacklist manager to the provided buffer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Indicates whether the blacklist is currently empty.
        Returns:
        true if the blacklist is currently empty, or false if it contains at least one server.
      • size

        public int size()
        Retrieves the number of servers currently on the blacklist.
        Returns:
        The number of servers currently on the blacklist.
      • getBlacklistedServers

        @NotNull
        public java.util.Set<ObjectPair<java.lang.String,​java.lang.Integer>> getBlacklistedServers()
        Retrieves a list of the servers currently on the blacklist.
        Returns:
        A list of the servers currently on the blacklist.
      • isBlacklisted

        public boolean isBlacklisted​(@NotNull
                                     java.lang.String host,
                                     int port)
        Indicates whether the specified server is currently on the blacklist.
        Parameters:
        host - The address of the server for which to make the determination. It must not be null.
        port - The port of the server for which to make the determination. It must be between 1 and 65535, inclusive.
        Returns:
        true if the server is on the blacklist, or false if not.
      • isBlacklisted

        public boolean isBlacklisted​(@NotNull
                                     ObjectPair<java.lang.String,​java.lang.Integer> hostPort)
        Indicates whether the specified server is currently on the blacklist.
        Parameters:
        hostPort - An ObjectPair containing the address and port of the server for which to make the determination. It must not be null.
        Returns:
        true if the server is on the blacklist, or false if not.
      • shutDown

        public void shutDown()
        Shuts down the blacklist manager.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this server set blacklist manager.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this server set blacklist manager.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of this server set blacklist manager to the provided buffer.
        Parameters:
        buffer - The buffer to which the information should be appended.