Class IpListClient

java.lang.Object
de.gustavblass.nginx.ipguard4j.IpListClient
All Implemented Interfaces:
IpListFetcher

public class IpListClient extends Object implements IpListFetcher
Downloads lists of IP addresses from given URIs.
See Also:
  • Field Details

    • LOG

      @NonNull private static final @NonNull org.apache.logging.log4j.Logger LOG
    • USER_AGENT

      @Nullable private static @Nullable String USER_AGENT

      The user agent string that the application will send with each HTTP request.

      Access only through getUserAgent()!

    • USER_AGENT_LOCK

      @NonNull private static final @NonNull ReentrantReadWriteLock USER_AGENT_LOCK
      Ensures mutual exclusion when accessing the USER_AGENT.
    • httpClient

      @NonNull private final @NonNull okhttp3.OkHttpClient httpClient
      The HTTP client that will be used to make the actual requests to the given URIs.
  • Constructor Details

    • IpListClient

      public IpListClient()
      Creates a new IpListClient with a default OkHttpClient.
    • IpListClient

      public IpListClient(@NonNull @NonNull okhttp3.OkHttpClient httpClient)
      Creates a new IpListClient with the given OkHttpClient.
      Parameters:
      httpClient - The httpClient.
  • Method Details