Package org.nuclos.api.authentication
Class AuthenticationResult
java.lang.Object
org.nuclos.api.authentication.AuthenticationResult
This class is passed to Nuclos as the result of a rule-based authentication.
- See Also:
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationResult.Builder
builder()
Constructs a new builder instance for an authentication result with default settings.boolean
getAttribute
(String attribute) long
getId()
Only a internal id for equals and hashCode.long
The default lifetime isAuthenticationResult.UNSET
, which means that the system is handling the session lifetime only and a refresh is never called.Clients can reach the application server via this base URI.Either username or user id must be specified.Either username or user id must be specified.int
hashCode()
boolean
void
setAttribute
(String attribute, String value) Store important information during authentication, and access them later during refresh.void
setLifetime
(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.toString()
-
Field Details
-
UNSET
public static final long UNSET- See Also:
-
-
Constructor Details
-
AuthenticationResult
protected AuthenticationResult()
-
-
Method Details
-
getId
public long getId()Only a internal id for equals and hashCode.- Returns:
- the internal id of this result.
-
getUsername
Either username or user id must be specified.- Returns:
- the username determined during authentication.
-
getUserId
Either username or user id must be specified.- Returns:
- the user id determined during authentication.
-
getMandatorId
- Returns:
- the mandator id determined during authentication.
-
getLocale
- Returns:
- the locale determined during authentication.
-
getDataLanguage
- Returns:
- the data language determined during authentication.
-
getServerUri
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.- Returns:
- the server uri determined during authentication.
-
isLoginRequired
public boolean isLoginRequired()- Returns:
true
if Nuclos should login the user.false
drops the session after response. (Determined during authentication)
-
getLifetime
public long getLifetime()The default lifetime isAuthenticationResult.UNSET
, which means that the system is handling the session lifetime only and a refresh is never called.- Returns:
- the lifetime
- See Also:
-
getLifetimeUnit
- Returns:
- the unit in which lifetime is expressed in
-
setLifetime
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- See Also:
-
setAttribute
Store important information during authentication, and access them later during refresh.- Parameters:
attribute
-value
-
-
getAttribute
- Parameters:
attribute
-- Returns:
- value (for the attribute)
-
builder
Constructs a new builder instance for an authentication result with default settings. -
equals
-
hashCode
public int hashCode() -
toString
-