Package org.pentaho.platform.api.engine
Interface IPentahoSession
- All Superinterfaces:
IAuditable
,ILogger
Provides an overall representation of the concept of a session. Sessions are not necessarily user-based, but
typically wrap the HttpSession object and PortletSession object in a standard framework with methods that session
objects typically provide.
- Author:
- jdixon
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the session attribute where the session locale override is stored.static final String
Roles that are authorized in current session.static final String
Key for searching the tenant ID.Fields inherited from interface org.pentaho.platform.api.engine.ILogger
ACTIVITY_LOG, DEBUG, ERROR, FATAL, INFO, INSTANCE_LOG, SESSION_LOG, SOLUTION_LOG, TRACE, UNKNOWN, WARN
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys any resources owned by the session object.getAttribute
(String attributeName) Gets the value of a named session attribute.default String
Gets the locale override of the session.Returns an enumeration of the names of the attributes stored in the session.boolean
Checks the status of a background execution task.getId()
Gets the ID for this session.Gets the locale of the session.getName()
Gets the name for this session, for example if this is an authenticated HTTP or Portlet session, the name will be the name of the user.boolean
Gets whether the session is known to be authenticated or not.removeAttribute
(String attributeName) Removes an attribute from the session and returns it.void
Toggles off the background execution alert status.void
setActionName
(String actionName) Sets the name of the action sequence document that the session is currently performing.void
setAttribute
(String attributeName, Object value) Sets the value of the session attribute.default void
setAttributeLocaleOverride
(String locale) Sets the locale override of the session.void
setAuthenticated
(String name) Sets the name of the session and indicates that the session is authenticated.void
Toggles on an alert condition indicating that the background execution of a task has completed during this session.void
Sets the indication that the user is no longer authenticated.void
setProcessId
(String processId) Sets the name of the process for which an action sequence is being performed.Methods inherited from interface org.pentaho.platform.api.engine.IAuditable
getActionName, getObjectName, getProcessId
-
Field Details
-
TENANT_ID_KEY
Key for searching the tenant ID.- See Also:
-
SESSION_ROLES
Roles that are authorized in current session.- See Also:
-
ATTRIBUTE_LOCALE_OVERRIDE
The name of the session attribute where the session locale override is stored. The format of the locale override attribute is Java's legacyLocale.toString()
format, which uses underscores.- See Also:
-
-
Method Details
-
getName
String getName()Gets the name for this session, for example if this is an authenticated HTTP or Portlet session, the name will be the name of the user.- Returns:
- Returns the name for this session.
-
getId
String getId()Gets the ID for this session. This is typically a GUID or semi-unique string.- Specified by:
getId
in interfaceIAuditable
- Returns:
- Returns the ID for this session.
-
setActionName
Sets the name of the action sequence document that the session is currently performing.- Parameters:
actionName
- The name of the action sequence document.
-
setProcessId
Sets the name of the process for which an action sequence is being performed.- Parameters:
processId
- The name of the process.
-
destroy
void destroy()Destroys any resources owned by the session object. -
getAttribute
Gets the value of a named session attribute.- Parameters:
attributeName
- The name of the attribute.- Returns:
- Returns the value of the attribute.
-
setAttribute
Sets the value of the session attribute.- Parameters:
attributeName
- The name of the attribute.value
- The value of the attribute.
-
removeAttribute
Removes an attribute from the session and returns it.- Parameters:
attributeName
- The name of the attribute to remove.- Returns:
- Returns the value of the removed attribute.
-
getAttributeNames
Iterator getAttributeNames()Returns an enumeration of the names of the attributes stored in the session.- Returns:
- Returns the enumeration of the attributes names.
-
getLocale
Locale getLocale()Gets the locale of the session. This is the initial session locale, defined at construction.- Returns:
- Returns the locale of the session.
-
getAttributeLocaleOverride
Gets the locale override of the session. The format of the locale override attribute should be that returned byLocale.toString()
. If the stored locale is empty,null
is returned instead. The locale override string is stored in the session attribute namedATTRIBUTE_LOCALE_OVERRIDE
.- Returns:
- The locale override, if any;
null
, otherwise. - See Also:
-
setAttributeLocaleOverride
Sets the locale override of the session. If the given locale is empty, it is converted tonull
. The format of the locale override attribute should be that returned byLocale.toString()
. The locale override string is stored in the session attribute namedATTRIBUTE_LOCALE_OVERRIDE
.- Parameters:
locale
- The locale override.- See Also:
-
isAuthenticated
boolean isAuthenticated()Gets whether the session is known to be authenticated or not.- Returns:
- Returns true if the session is authenticated.
-
setAuthenticated
Sets the name of the session and indicates that the session is authenticated. If this is an HTTP or Portlet session the name should be the name of the user that is logged in (e.g. usingrequest.getRemoteUser()
).- Parameters:
name
- The name of the session.
-
setNotAuthenticated
void setNotAuthenticated()Sets the indication that the user is no longer authenticated. -
setBackgroundExecutionAlert
void setBackgroundExecutionAlert()Toggles on an alert condition indicating that the background execution of a task has completed during this session. -
getBackgroundExecutionAlert
boolean getBackgroundExecutionAlert()Checks the status of a background execution task.- Returns:
- Returns true if a background execution has triggered an alert.
-
resetBackgroundExecutionAlert
void resetBackgroundExecutionAlert()Toggles off the background execution alert status.
-