Package io.streamthoughts.azkarra.http
Class ServerConfigBuilder
- java.lang.Object
-
- io.streamthoughts.azkarra.http.ServerConfigBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static String
HTTP_ENABLE_UI
static String
HTTP_LISTENER_LISTER_CONFIG
static String
HTTP_PORT_CONFIG
static String
HTTP_REST_EXTENSIONS_ENABLE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerConfig
build()
ServerConfigBuilder
disableHeadlessMode()
Disables the headless mode.ServerConfigBuilder
disableRestExtensions()
Disables support for rest extensions.ServerConfigBuilder
disableSsl()
Disables SSL.ServerConfigBuilder
enableHeadlessMode()
Enables the headless mode.ServerConfigBuilder
enableRestExtensions()
Enables support for rest extensions.ServerConfigBuilder
enableSsl()
Enables the SSL.ServerConfigBuilder
enableUI(boolean enable)
Sets if the Web UI must be enable.ServerConfigBuilder
setAuthenticationMethod(String method)
Sets the authentication mode.ServerConfigBuilder
setAuthenticationRealm(String realm)
Sets the authentication realm.ServerConfigBuilder
setAuthenticationRestricted(String roles)
Sets the authentication roles.ServerConfigBuilder
setAuthenticationRoles(String roles)
Sets the authentication roles.ServerConfigBuilder
setAuthenticationUsers(String users)
Sets the authentication users.ServerConfigBuilder
setBasicSilentAuthentication(boolean silent)
Sets if the basic authentication must be silent.ServerConfigBuilder
setIgnoreSslHostnameVerification(boolean ignore)
Enables the SSL.ServerConfigBuilder
setKeyPassword(String keyPassword)
Sets the password of the private key in the key store file.ServerConfigBuilder
setKeyStoreLocation(String keyStoreLocation)
Sets the location of the key store file.ServerConfigBuilder
setKeyStorePassword(String keyStorePassword)
Sets the store password for the key store file.ServerConfigBuilder
setKeyStoreType(String keyStoreType)
Sets the file format of the key store file.ServerConfigBuilder
setListener(String listener)
Sets the http server listener.ServerConfigBuilder
setPort(int port)
Sets the http server port.ServerConfigBuilder
setPrincipalBuilder(Class<? extends AzkarraPrincipalBuilder> cls)
Sets theAzkarraPrincipalBuilder
used to build the principal for an authenticated user.ServerConfigBuilder
setTrustStoreLocation(String trustStoreLocation)
Sets the location of the trust store file.ServerConfigBuilder
setTrustStorePassword(String trustStorePassword)
Sets the store password for the trust store file.ServerConfigBuilder
setTrustStoreType(String trustStoreType)
Sets the file format of the key trust file.ServerConfigBuilder
setUserIdentityManager(Class<? extends UsersIdentityManager> cls)
Sets theUsersIdentityManager
used to get information about user to authenticate.
-
-
-
Field Detail
-
HTTP_PORT_CONFIG
public static final String HTTP_PORT_CONFIG
- See Also:
- Constant Field Values
-
HTTP_LISTENER_LISTER_CONFIG
public static final String HTTP_LISTENER_LISTER_CONFIG
- See Also:
- Constant Field Values
-
HTTP_ENABLE_UI
public static final String HTTP_ENABLE_UI
- See Also:
- Constant Field Values
-
HTTP_REST_EXTENSIONS_ENABLE
public static final String HTTP_REST_EXTENSIONS_ENABLE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPort
public ServerConfigBuilder setPort(int port)
Sets the http server port.- Parameters:
port
- the http port.- Returns:
this
.
-
setListener
public ServerConfigBuilder setListener(String listener)
Sets the http server listener.- Parameters:
listener
- the http listener.- Returns:
this
.
-
enableUI
public ServerConfigBuilder enableUI(boolean enable)
Sets if the Web UI must be enable.- Parameters:
enable
-true
to enable the Web UI,false
otherwise.- Returns:
this
.
-
setAuthenticationMethod
public ServerConfigBuilder setAuthenticationMethod(String method)
Sets the authentication mode.- Parameters:
method
- the authentication method.- Returns:
this
.
-
setAuthenticationRealm
public ServerConfigBuilder setAuthenticationRealm(String realm)
Sets the authentication realm.- Parameters:
realm
- the authentication realM- Returns:
this
.
-
setAuthenticationRoles
public ServerConfigBuilder setAuthenticationRoles(String roles)
Sets the authentication roles.- Parameters:
roles
- the authentication roles.- Returns:
this
.
-
setBasicSilentAuthentication
public ServerConfigBuilder setBasicSilentAuthentication(boolean silent)
Sets if the basic authentication must be silent. The server will respond with a 403 Forbidden HTTP response status code instead of a 401 Unauthorized (default isfalse
).- Parameters:
silent
- is basic authentication must be silent.- Returns:
this
.
-
setAuthenticationRestricted
public ServerConfigBuilder setAuthenticationRestricted(String roles)
Sets the authentication roles.- Parameters:
roles
- the authentication roles.- Returns:
this
.
-
setUserIdentityManager
public ServerConfigBuilder setUserIdentityManager(Class<? extends UsersIdentityManager> cls)
Sets theUsersIdentityManager
used to get information about user to authenticate.- Parameters:
cls
- theUsersIdentityManager
class.- Returns:
this
.
-
setPrincipalBuilder
public ServerConfigBuilder setPrincipalBuilder(Class<? extends AzkarraPrincipalBuilder> cls)
Sets theAzkarraPrincipalBuilder
used to build the principal for an authenticated user.- Parameters:
cls
- theAzkarraPrincipalBuilder
class.- Returns:
this
.
-
setAuthenticationUsers
public ServerConfigBuilder setAuthenticationUsers(String users)
Sets the authentication users.- Parameters:
users
- the list users to authenticate separated by comma.- Returns:
this
.
-
setIgnoreSslHostnameVerification
public ServerConfigBuilder setIgnoreSslHostnameVerification(boolean ignore)
Enables the SSL.- Returns:
this
.
-
enableSsl
public ServerConfigBuilder enableSsl()
Enables the SSL.- Returns:
this
.
-
disableSsl
public ServerConfigBuilder disableSsl()
Disables SSL.- Returns:
this
.
-
setKeyStoreLocation
public ServerConfigBuilder setKeyStoreLocation(String keyStoreLocation)
Sets the location of the key store file.- Parameters:
keyStoreLocation
- the location of the key store file.- Returns:
this
.
-
setKeyStorePassword
public ServerConfigBuilder setKeyStorePassword(String keyStorePassword)
Sets the store password for the key store file.- Parameters:
keyStorePassword
- the store password for the key store file.- Returns:
this
.
-
setKeyStoreType
public ServerConfigBuilder setKeyStoreType(String keyStoreType)
Sets the file format of the key store file.- Parameters:
keyStoreType
- the file format of the key store file.- Returns:
this
.
-
setKeyPassword
public ServerConfigBuilder setKeyPassword(String keyPassword)
Sets the password of the private key in the key store file.- Parameters:
keyPassword
- the password of the private key in the key store file.- Returns:
this
.
-
setTrustStoreLocation
public ServerConfigBuilder setTrustStoreLocation(String trustStoreLocation)
Sets the location of the trust store file.- Parameters:
trustStoreLocation
- the location of the trust store file.- Returns:
this
.
-
setTrustStorePassword
public ServerConfigBuilder setTrustStorePassword(String trustStorePassword)
Sets the store password for the trust store file.- Parameters:
trustStorePassword
- the store password for the trust store file.- Returns:
this
.
-
setTrustStoreType
public ServerConfigBuilder setTrustStoreType(String trustStoreType)
Sets the file format of the key trust file.- Parameters:
trustStoreType
- the file format of the key trust file.- Returns:
this
.
-
enableHeadlessMode
public ServerConfigBuilder enableHeadlessMode()
Enables the headless mode.- Returns:
this
-
disableHeadlessMode
public ServerConfigBuilder disableHeadlessMode()
Disables the headless mode.- Returns:
this
-
enableRestExtensions
public ServerConfigBuilder enableRestExtensions()
Enables support for rest extensions.- Returns:
this
- See Also:
AzkarraRestExtension
-
disableRestExtensions
public ServerConfigBuilder disableRestExtensions()
Disables support for rest extensions.- Returns:
this
- See Also:
AzkarraRestExtension
-
build
public ServerConfig build()
-
-