Package io.streamthoughts.azkarra.http
Class ServerConfBuilder
- java.lang.Object
-
- io.streamthoughts.azkarra.http.ServerConfBuilder
-
-
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 Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Conf
build()
ServerConfBuilder
disableHeadlessMode()
Disables the headless mode.ServerConfBuilder
disableRestExtensions()
Disables support for rest extensions.ServerConfBuilder
disableSsl()
Disables SSL.ServerConfBuilder
enableHeadlessMode()
Enables the headless mode.ServerConfBuilder
enableRestExtensions()
Enables support for rest extensions.ServerConfBuilder
enableSsl()
Enables the SSL.ServerConfBuilder
enableUI(boolean enable)
Sets if the Web UI must be enable.static ServerConfBuilder
newBuilder()
ServerConfBuilder
setAuthenticationMethod(String method)
Sets the authentication mode.ServerConfBuilder
setAuthenticationRealm(String realm)
Sets the authentication realm.ServerConfBuilder
setAuthenticationRestricted(String roles)
Sets the authentication roles.ServerConfBuilder
setAuthenticationRoles(String roles)
Sets the authentication roles.ServerConfBuilder
setAuthenticationUsers(String users)
Sets the authentication users.ServerConfBuilder
setBasicSilentAuthentication(boolean silent)
Sets if the basic authentication must be silent.ServerConfBuilder
setIgnoreSslHostnameVerification(boolean ignore)
Enables the SSL.ServerConfBuilder
setKeyPassword(String keyPassword)
Sets the password of the private key in the key store file.ServerConfBuilder
setKeyStoreLocation(String keyStoreLocation)
Sets the location of the key store file.ServerConfBuilder
setKeyStorePassword(String keyStorePassword)
Sets the store password for the key store file.ServerConfBuilder
setKeyStoreType(String keyStoreType)
Sets the file format of the key store file.ServerConfBuilder
setListener(String listener)
Sets the http server listener.ServerConfBuilder
setPort(int port)
Sets the http server port.ServerConfBuilder
setPrincipalBuilder(Class<? extends AzkarraPrincipalBuilder> cls)
Sets theAzkarraPrincipalBuilder
used to build the principal for an authenticated user.ServerConfBuilder
setTrustStoreLocation(String trustStoreLocation)
Sets the location of the trust store file.ServerConfBuilder
setTrustStorePassword(String trustStorePassword)
Sets the store password for the trust store file.ServerConfBuilder
setTrustStoreType(String trustStoreType)
Sets the file format of the key trust file.ServerConfBuilder
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
-
newBuilder
public static ServerConfBuilder newBuilder()
-
setPort
public ServerConfBuilder setPort(int port)
Sets the http server port.- Parameters:
port
- the http port.- Returns:
this
.
-
setListener
public ServerConfBuilder setListener(String listener)
Sets the http server listener.- Parameters:
listener
- the http listener.- Returns:
this
.
-
enableUI
public ServerConfBuilder 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 ServerConfBuilder setAuthenticationMethod(String method)
Sets the authentication mode.- Parameters:
method
- the authentication method.- Returns:
this
.
-
setAuthenticationRealm
public ServerConfBuilder setAuthenticationRealm(String realm)
Sets the authentication realm.- Parameters:
realm
- the authentication realM- Returns:
this
.
-
setAuthenticationRoles
public ServerConfBuilder setAuthenticationRoles(String roles)
Sets the authentication roles.- Parameters:
roles
- the authentication roles.- Returns:
this
.
-
setBasicSilentAuthentication
public ServerConfBuilder 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 ServerConfBuilder setAuthenticationRestricted(String roles)
Sets the authentication roles.- Parameters:
roles
- the authentication roles.- Returns:
this
.
-
setUserIdentityManager
public ServerConfBuilder setUserIdentityManager(Class<? extends UsersIdentityManager> cls)
Sets theUsersIdentityManager
used to get information about user to authenticate.- Parameters:
cls
- theUsersIdentityManager
class.- Returns:
this
.
-
setPrincipalBuilder
public ServerConfBuilder setPrincipalBuilder(Class<? extends AzkarraPrincipalBuilder> cls)
Sets theAzkarraPrincipalBuilder
used to build the principal for an authenticated user.- Parameters:
cls
- theAzkarraPrincipalBuilder
class.- Returns:
this
.
-
setAuthenticationUsers
public ServerConfBuilder setAuthenticationUsers(String users)
Sets the authentication users.- Parameters:
users
- the list users to authenticate separated by comma.- Returns:
this
.
-
setIgnoreSslHostnameVerification
public ServerConfBuilder setIgnoreSslHostnameVerification(boolean ignore)
Enables the SSL.- Returns:
this
.
-
enableSsl
public ServerConfBuilder enableSsl()
Enables the SSL.- Returns:
this
.
-
disableSsl
public ServerConfBuilder disableSsl()
Disables SSL.- Returns:
this
.
-
setKeyStoreLocation
public ServerConfBuilder setKeyStoreLocation(String keyStoreLocation)
Sets the location of the key store file.- Parameters:
keyStoreLocation
- the location of the key store file.- Returns:
this
.
-
setKeyStorePassword
public ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder setTrustStoreLocation(String trustStoreLocation)
Sets the location of the trust store file.- Parameters:
trustStoreLocation
- the location of the trust store file.- Returns:
this
.
-
setTrustStorePassword
public ServerConfBuilder 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 ServerConfBuilder 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 ServerConfBuilder enableHeadlessMode()
Enables the headless mode.- Returns:
this
-
disableHeadlessMode
public ServerConfBuilder disableHeadlessMode()
Disables the headless mode.- Returns:
this
-
enableRestExtensions
public ServerConfBuilder enableRestExtensions()
Enables support for rest extensions.- Returns:
this
- See Also:
AzkarraRestExtension
-
disableRestExtensions
public ServerConfBuilder disableRestExtensions()
Disables support for rest extensions.- Returns:
this
- See Also:
AzkarraRestExtension
-
build
public Conf build()
-
-