Class WebServiceClient.Builder

java.lang.Object
com.maxmind.minfraud.WebServiceClient.Builder
Enclosing class:
WebServiceClient

public static final class WebServiceClient.Builder extends Object

Builder creates instances of WebServiceClient from values set by the methods.

This example shows how to create a WebServiceClient object with the Builder:

WebServiceClient client = new WebServiceClient.Builder(12,"licensekey").host ("geoip.maxmind.com").build();

Only the values set in the Builder constructor are required.

  • Constructor Details

    • Builder

      public Builder(int accountId, String licenseKey)
      Parameters:
      accountId - Your MaxMind account ID.
      licenseKey - Your MaxMind license key.
  • Method Details

    • connectTimeout

      public WebServiceClient.Builder connectTimeout(Duration val)
      Parameters:
      val - Timeout duration to establish a connection to the web service. There is no timeout by default.
      Returns:
      Builder object
    • disableHttps

      public WebServiceClient.Builder disableHttps()
      Disables HTTPS to connect to a test server or proxy. The minFraud ScoreResponse and InsightsResponse web services require HTTPS.
      Returns:
      Builder object
    • host

      public WebServiceClient.Builder host(String val)
      Parameters:
      val - The host to use. By default, the client connects to the production host. However, during testing and development, you can set this option to 'sandbox.maxmind.com' to use the Sandbox environment's host. The sandbox allows you to experiment with the API without affecting your production data.
      Returns:
      Builder object
    • port

      public WebServiceClient.Builder port(int val)
      Parameters:
      val - The port to use.
      Returns:
      Builder object
    • locales

      public WebServiceClient.Builder locales(List<String> val)
      Parameters:
      val - List of locale codes to use in name property from most preferred to least preferred.
      Returns:
      Builder object
    • requestTimeout

      public WebServiceClient.Builder requestTimeout(Duration val)
      Parameters:
      val - Request timeout duration. here is no timeout by default.
      Returns:
      Builder object
    • proxy

      Parameters:
      val - the proxy to use when making this request.
      Returns:
      Builder object
    • build

      public WebServiceClient build()
      Returns:
      an instance of WebServiceClient created from the fields set on this builder.