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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()withAttribute(String attribute, String value) You can store important information here and access it later during a refresh.withAuthSourceTrusted(boolean trustAuthSource) 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_DEwithLoginRequired(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
Builderinstance (for chaining)
-
withUserId
Either username or user id must be specified.- Parameters:
userId- (could be null)- Returns:
- this
Builderinstance (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
Builderinstance (for chaining)
-
withLocale
Default isNuclosLocale.DE_DE- Parameters:
locale- for the new session (not null)- Returns:
- this
Builderinstance (for chaining)
-
withDataLanguage
Data language for the new session, if in use be the system.- Parameters:
dataLanguage- (could be null)- Returns:
- this
Builderinstance (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
Builderinstance (for chaining)
-
withLoginRequired
- Parameters:
loginRequired-trueif Nuclos should login the user.false(Default) drops the session after response.- Returns:
- this
Builderinstance (for chaining) - See Also:
-
withAuthSourceTrusted
- Parameters:
trustAuthSource-trueif Nuclos should not load user details from the database.false(Default) load user details from the database.- Returns:
- this
Builderinstance (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
Builderinstance (for chaining) - See Also:
-
withAttribute
You can store important information here and access it later during a refresh.- Parameters:
attribute-value-- Returns:
- this
Builderinstance (for chaining)
-
build
- Returns:
- the
AuthenticationResultwith the requested parameters.
-