Package org.apache.hadoop.http
Class HttpServer2.Builder
java.lang.Object
org.apache.hadoop.http.HttpServer2.Builder
- Enclosing class:
- HttpServer2
Class to construct instances of HTTP server with specific options.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEndpoint(URI endpoint) Add an endpoint that the HTTP server should listen to.build()configureXFrame(boolean xFrameEnabled) Adds the ability to control X_FRAME_OPTIONS on HttpServer2.disallowFallbackToRandomSingerSecretProvider(boolean value) excludeCiphers(String pExcludeCiphers) Set the hostname of the http server.includeCiphers(String pIncludeCiphers) keyPassword(String password) needsClientAuth(boolean value) Specify whether the server should authorize the client in SSL connections.setACL(AccessControlList acl) setAuthFilterConfigurationPrefixes(String[] prefixes) setConf(Configuration conf) setFindPort(boolean findPort) setKeytabConfKey(String keytabConfKey) setPathSpec(String[] pathSpec) setSecurityEnabled(boolean securityEnabled) setSniHostCheckEnabled(boolean sniHostCheckEnabled) Enable or disable sniHostCheck.setSSLConf(Configuration sslCnf) Specify the SSL configuration to load.setUsernameConfKey(String usernameConfKey) setXFrameOption(String option) Sets a valid X-Frame-option that can be used by HttpServer2.trustStore(String location, String password, String type)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setName
-
addEndpoint
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
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
-
keyStore
-
keyPassword
-
needsClientAuth
Specify whether the server should authorize the client in SSL connections.- Parameters:
value- value.- Returns:
- Builder.
-
setFindPort
-
setPortRanges
-
setConf
-
setSSLConf
Specify the SSL configuration to load. This API provides an alternative to keyStore/keyPassword/trustStore.- Parameters:
sslCnf- sslCnf.- Returns:
- Builder.
-
setPathSpec
-
setACL
-
setSecurityEnabled
-
setUsernameConfKey
-
setKeytabConfKey
-
disallowFallbackToRandomSingerSecretProvider
-
setAuthFilterConfigurationPrefix
-
setAuthFilterConfigurationPrefixes
-
excludeCiphers
-
includeCiphers
-
configureXFrame
Adds the ability to control X_FRAME_OPTIONS on HttpServer2.- Parameters:
xFrameEnabled- - True enables X_FRAME_OPTIONS false disables it.- Returns:
- Builder.
-
setXFrameOption
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
Enable or disable sniHostCheck.- Parameters:
sniHostCheckEnabled- Enable sniHostCheck if true, else disable it.- Returns:
- Builder.
-
build
- Throws:
IOException
-