Package org.nuclos.api.authentication
Class AuthenticationResult.Builder
java.lang.Object
org.nuclos.api.authentication.AuthenticationResult.Builder
- Enclosing class:
- AuthenticationResult
A builder for
AuthenticationResult
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
withAttribute
(String attribute, String value) You can store important information here and access it later during a refresh.withDataLanguage
(NuclosLocale dataLanguage) Data language for the new session, if in use be the system.withLifetime
(long lifetime, TimeUnit unit) The default lifetime isAuthenticationResult.UNSET
, which means that the system is handling the session lifetime only and a refresh is never called.withLocale
(NuclosLocale locale) Default isNuclosLocale.DE_DE
withLoginRequired
(boolean loginRequired) withMandatorId
(UID mandatorId) If mandators are in use, the new session will need a selected one, similar to the login with a web- or rich-client.withServerUri
(URI serverUri) Clients can reach the application server via this base URI.withUserId
(UID userId) Either username or user id must be specified.withUsername
(String username) Either username or user id must be specified.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
withUsername
Either username or user id must be specified.- Parameters:
username
- (could be null)- Returns:
- this
Builder
instance (for chaining)
-
withUserId
Either username or user id must be specified.- Parameters:
userId
- (could be null)- Returns:
- this
Builder
instance (for chaining)
-
withMandatorId
If mandators are in use, the new session will need a selected one, similar to the login with a web- or rich-client. Otherwise, permission checks could throw errors.- Parameters:
mandatorId
- (could be null)- Returns:
- this
Builder
instance (for chaining)
-
withLocale
Default isNuclosLocale.DE_DE
- Parameters:
locale
- for the new session (not null)- Returns:
- this
Builder
instance (for chaining)
-
withDataLanguage
Data language for the new session, if in use be the system.- Parameters:
dataLanguage
- (could be null)- Returns:
- this
Builder
instance (for chaining)
-
withServerUri
Clients can reach the application server via this base URI. If not specified (null
), the default settings are used. Maybe a reverse proxy exists between server and client and requires an adjustment. This is used to create referencing links between data.- Parameters:
serverUri
- (could be null)- Returns:
- this
Builder
instance (for chaining)
-
withLoginRequired
- Parameters:
loginRequired
-true
if Nuclos should login the user.false
(Default) drops the session after response.- Returns:
- this
Builder
instance (for chaining) - See Also:
-
withLifetime
The default lifetime isAuthenticationResult.UNSET
, which means that the system is handling the session lifetime only and a refresh is never called.- Parameters:
lifetime
-unit
- the unit that lifetime is expressed in- Returns:
- this
Builder
instance (for chaining) - See Also:
-
withAttribute
You can store important information here and access it later during a refresh.- Parameters:
attribute
-value
-- Returns:
- this
Builder
instance (for chaining)
-
build
- Returns:
- the
AuthenticationResult
with the requested parameters.
-