public final class Session extends java.lang.Object implements SessionI
SessionI contract.
This class manages the current user, locale, and persistent global application variables
for the current client session.| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(java.lang.String name)
Retrieves the value of a single global variable by its name.
|
java.util.Locale |
getLocale()
Retrieves the current
Locale set for the user's session. |
SessionReaderI |
getReadOnlyInstance()
Provides a delegated, read-only view of this mutable session instance.
|
Benutzer |
getUser()
Retrieves the instance representing the currently logged-in user for this session.
|
java.util.Map<java.lang.String,java.lang.Object> |
getVariables()
Retrieves all currently stored global variables.
|
java.lang.Object |
set(java.lang.String name,
java.lang.Object value)
Sets or updates the value of a session variable.
|
void |
setUser(Benutzer user)
Sets or updates the value of the current user in this session.
|
public Benutzer getUser()
SessionReaderIgetUser in interface SessionReaderIBenutzer instance representing the current user, or null
if the session is not currently authenticated.public java.util.Locale getLocale()
SessionReaderILocale set for the user's session.
This locale is critical for correctly formatting numbers, dates, currency, and handling localized text.
getLocale in interface SessionReaderILocale.public java.util.Map<java.lang.String,java.lang.Object> getVariables()
SessionReaderIThese variables represent typically machine- or user-profile-specific, application settings.
getVariables in interface SessionReaderIMap<String, Object> containing all variable names (String) and
their values (Object). The map returned is typically unmodifiable.public java.lang.Object get(java.lang.String name)
SessionReaderIget in interface SessionReaderIname - The name of the global variable to retrieve.Object, or null if the variable does not exist.public java.lang.Object set(java.lang.String name,
java.lang.Object value)
SessionIset in interface SessionIname - The name of the variable to set.value - The new value of the variable.null if there was no
value for that name. (A null return can also indicate that the value previously
associated with the name was null.)public void setUser(Benutzer user)
SessionIThis method is typically used to update the authentication state (login/logout).
public SessionReaderI getReadOnlyInstance()
SessionIThis is often used to expose session data to components that should not have write access.
getReadOnlyInstance in interface SessionISessionReaderI instance that delegates all read calls to this object,
but does not expose any write methods.Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.