public interface Session extends Scope
To get the current session, use Sessions.getCurrent()
,
or Desktop.getSession()
.
A session, Session
, might have multiple pages,
Page
, while a page belongs to exactly one session.
A page, Page
, might have many components, Component
, while
a component belongs to exactly one page.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the specified custom attribute.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns a map of custom attributes associated with this session.
|
java.lang.String |
getDeviceType()
Returns the device type that this session belongs to.
|
java.lang.String |
getLocalAddr()
Deprecated.
as of release 7.0.0, use
Execution.getLocalAddr() instead. |
java.lang.String |
getLocalName()
Deprecated.
as of release 7.0.0, use
Execution.getLocalName() instead. |
int |
getMaxInactiveInterval()
Return the time, in seconds, between client requests before
the servlet container will invalidate this session.
|
java.lang.Object |
getNativeSession()
Returns the native session, or null if not available.
|
java.lang.String |
getRemoteAddr()
Deprecated.
as of release 7.0.0, use
Execution.getRemoteAddr() instead. |
java.lang.String |
getRemoteHost()
Deprecated.
as of release 7.0.0, use
Execution.getRemoteHost() instead. |
java.lang.String |
getServerName()
Deprecated.
as of release 7.0.0, use
Execution.getServerName() instead. |
WebApp |
getWebApp()
Returns the Web application that this session belongs to.
|
void |
invalidate()
Invalidates this session then unbinds any objects bound to it.
|
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the specified custom attribute.
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the value of the specified custom attribute.
|
void |
setMaxInactiveInterval(int interval)
Specifies the time, in seconds, between client requests before
the servlet container will invalidate this session.
|
addScopeListener, getAttribute, hasAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
java.lang.String getDeviceType()
A device type identifies the type of a client. For example, "ajax" represents the Web browsers with Ajax support, while "mil" represents clients that supports Mobile Interactive markup Language (on Limited Connected Device, such as mobile phones).
All desktops of the same session must belong to the same device type.
The session's device type is determined by the first desktop's device type.
java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface Scope
java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface Scope
java.lang.Object removeAttribute(java.lang.String name)
removeAttribute
in interface Scope
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
getAttributes
in interface Scope
WebApp getWebApp()
java.lang.String getRemoteHost()
Execution.getRemoteHost()
instead.java.lang.String getRemoteAddr()
Execution.getRemoteAddr()
instead.java.lang.String getServerName()
Execution.getServerName()
instead.getLocalName()
java.lang.String getLocalName()
Execution.getLocalName()
instead.Note: it is the host name defined in the server. To retrieve the name
in URL, use getServerName()
.
getServerName()
java.lang.String getLocalAddr()
Execution.getLocalAddr()
instead.void invalidate()
Note: you usually have to ask the client to redirect to another page
(or reload the same page) by use of Executions.sendRedirect(java.lang.String)
.
The session is not invalidated immediately. Rather, it is invalidated after processing the current request.
void setMaxInactiveInterval(int interval)
int getMaxInactiveInterval()
Configuration.isTimerKeepAlive()
,
Configuration.getSessionMaxInactiveInterval()
java.lang.Object getNativeSession()
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.