HttpServer2.Builder (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.http, class: HttpServer2, class: Builder

Package org.apache.hadoop.http

# Class HttpServer2.Builder

java.lang.Object
org.apache.hadoop.http.HttpServer2.Builder

Enclosing class:
  HttpServer2

public static class HttpServer2.Builder extends Object
Class to construct instances of HTTP server with specific options.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `HttpServer2.Builder`
  `addEndpoint(URI endpoint)`
  Add an endpoint that the HTTP server should listen to.
  `HttpServer2`
  `build()`
  `HttpServer2.Builder`
  `configureXFrame(boolean xFrameEnabled)`
  Adds the ability to control X_FRAME_OPTIONS on HttpServer2.
  `HttpServer2.Builder`
  `disallowFallbackToRandomSingerSecretProvider(boolean value)`
  `HttpServer2.Builder`
  `excludeCiphers(String pExcludeCiphers)`
  `HttpServer2.Builder`
  `hostName(String hostName)`
  Set the hostname of the http server.
  `HttpServer2.Builder`
  `includeCiphers(String pIncludeCiphers)`
  `HttpServer2.Builder`
  `keyPassword(String password)`
  `HttpServer2.Builder`
  `keyStore(String location, String password, String type)`
  `HttpServer2.Builder`
  `needsClientAuth(boolean value)`
  Specify whether the server should authorize the client in SSL connections.
  `HttpServer2.Builder`
  `setACL(AccessControlList acl)`
  `HttpServer2.Builder`
  `setAuthFilterConfigurationPrefix(String value)`
  `HttpServer2.Builder`
  `setAuthFilterConfigurationPrefixes(String[] prefixes)`
  `HttpServer2.Builder`
  `setConf(Configuration conf)`
  `HttpServer2.Builder`
  `setFindPort(boolean findPort)`
  `HttpServer2.Builder`
  `setKeytabConfKey(String keytabConfKey)`
  `HttpServer2.Builder`
  `setName(String name)`
  `HttpServer2.Builder`
  `setPathSpec(String[] pathSpec)`
  `HttpServer2.Builder`
  `setPortRanges(Configuration.IntegerRanges ranges)`
  `HttpServer2.Builder`
  `setSecurityEnabled(boolean securityEnabled)`
  `HttpServer2.Builder`
  `setSniHostCheckEnabled(boolean sniHostCheckEnabled)`
  Enable or disable sniHostCheck.
  `HttpServer2.Builder`
  `setSSLConf(Configuration sslCnf)`
  Specify the SSL configuration to load.
  `HttpServer2.Builder`
  `setUsernameConfKey(String usernameConfKey)`
  `HttpServer2.Builder`
  `setXFrameOption(String option)`
  Sets a valid X-Frame-option that can be used by HttpServer2.
  `HttpServer2.Builder`
  `trustStore(String location, String password, String type)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()

- ## Method Details

  - ### setName

    public HttpServer2.Builder setName(String name)

  - ### addEndpoint

    public HttpServer2.Builder addEndpoint(URI endpoint)
    Add an endpoint that the HTTP server should listen to.
    Parameters:
      `endpoint` - the endpoint of that the HTTP server should listen to. The scheme specifies the protocol (i.e. HTTP / HTTPS), the host specifies the binding address, and the port specifies the listening port. Unspecified or zero port means that the server can listen to any port.
    Returns:
      Builder.

  - ### hostName

    public HttpServer2.Builder hostName(String hostName)
    Set the hostname of the http server. The host name is used to resolve the _HOST field in Kerberos principals. The hostname of the first listener will be used if the name is unspecified.
    Parameters:
      `hostName` - hostName.
    Returns:
      Builder.

  - ### trustStore

    public HttpServer2.Builder trustStore(String location, String password, String type)

  - ### keyStore

    public HttpServer2.Builder keyStore(String location, String password, String type)

  - ### keyPassword

    public HttpServer2.Builder keyPassword(String password)

  - ### needsClientAuth

    public HttpServer2.Builder needsClientAuth(boolean value)
    Specify whether the server should authorize the client in SSL connections.
    Parameters:
      `value` - value.
    Returns:
      Builder.

  - ### setFindPort

    public HttpServer2.Builder setFindPort(boolean findPort)

  - ### setPortRanges

    public HttpServer2.Builder setPortRanges(Configuration.IntegerRanges ranges)

  - ### setConf

    public HttpServer2.Builder setConf(Configuration conf)

  - ### setSSLConf

    public HttpServer2.Builder setSSLConf(Configuration sslCnf)
    Specify the SSL configuration to load. This API provides an alternative to keyStore/keyPassword/trustStore.
    Parameters:
      `sslCnf` - sslCnf.
    Returns:
      Builder.

  - ### setPathSpec

    public HttpServer2.Builder setPathSpec(String[] pathSpec)

  - ### setACL

    public HttpServer2.Builder setACL(AccessControlList acl)

  - ### setSecurityEnabled

    public HttpServer2.Builder setSecurityEnabled(boolean securityEnabled)

  - ### setUsernameConfKey

    public HttpServer2.Builder setUsernameConfKey(String usernameConfKey)

  - ### setKeytabConfKey

    public HttpServer2.Builder setKeytabConfKey(String keytabConfKey)

  - ### disallowFallbackToRandomSingerSecretProvider

    public HttpServer2.Builder disallowFallbackToRandomSingerSecretProvider(boolean value)

  - ### setAuthFilterConfigurationPrefix

    public HttpServer2.Builder setAuthFilterConfigurationPrefix(String value)

  - ### setAuthFilterConfigurationPrefixes

    public HttpServer2.Builder setAuthFilterConfigurationPrefixes(String[] prefixes)

  - ### excludeCiphers

    public HttpServer2.Builder excludeCiphers(String pExcludeCiphers)

  - ### includeCiphers

    public HttpServer2.Builder includeCiphers(String pIncludeCiphers)

  - ### configureXFrame

    public HttpServer2.Builder configureXFrame(boolean xFrameEnabled)
    Adds the ability to control X_FRAME_OPTIONS on HttpServer2.
    Parameters:
      `xFrameEnabled` - - True enables X_FRAME_OPTIONS false disables it.
    Returns:
      Builder.

  - ### setXFrameOption

    public HttpServer2.Builder setXFrameOption(String option)
    Sets a valid X-Frame-option that can be used by HttpServer2.
    Parameters:
      `option` - - String DENY, SAMEORIGIN or ALLOW-FROM are the only valid options. Any other value will throw IllegalArgument Exception.
    Returns:
      Builder.

  - ### setSniHostCheckEnabled

    public HttpServer2.Builder setSniHostCheckEnabled(boolean sniHostCheckEnabled)
    Enable or disable sniHostCheck.
    Parameters:
      `sniHostCheckEnabled` - Enable sniHostCheck if true, else disable it.
    Returns:
      Builder.

  - ### build

    public HttpServer2 build() throws IOException
    Throws:
      `IOException`