Interface Session

    • Method Detail

      • getDeviceType

        java.lang.String getDeviceType()
        Returns the device type that this session belongs to.

        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.

        Since:
        2.4.1
      • getAttribute

        java.lang.Object getAttribute​(java.lang.String name)
        Returns the value of the specified custom attribute.
        Specified by:
        getAttribute in interface Scope
      • setAttribute

        java.lang.Object setAttribute​(java.lang.String name,
                                      java.lang.Object value)
        Sets the value of the specified custom attribute.
        Specified by:
        setAttribute in interface Scope
        Returns:
        the previous value if any (since ZK 5)
      • removeAttribute

        java.lang.Object removeAttribute​(java.lang.String name)
        Removes the specified custom attribute.
        Specified by:
        removeAttribute in interface Scope
        Returns:
        the previous value if any (since ZK 5)
      • getAttributes

        java.util.Map<java.lang.String,​java.lang.Object> getAttributes()
        Returns a map of custom attributes associated with this session.
        Specified by:
        getAttributes in interface Scope
      • getWebApp

        WebApp getWebApp()
        Returns the Web application that this session belongs to.
      • getRemoteHost

        java.lang.String getRemoteHost()
        Deprecated.
        as of release 7.0.0, use Execution.getRemoteHost() instead.
        Returns the fully qualified name of the client or the last proxy that sent the first request creating this session. If the engine cannot or chooses not to resolve the hostname (to improve performance), this method returns the dotted-string form of the IP address.
        Since:
        3.0.1
      • getRemoteAddr

        java.lang.String getRemoteAddr()
        Deprecated.
        as of release 7.0.0, use Execution.getRemoteAddr() instead.
        Returns the Internet Protocol (IP) address of the client or last proxy that sent the first request creating this session.
        Since:
        3.0.1
      • getServerName

        java.lang.String getServerName()
        Deprecated.
        as of release 7.0.0, use Execution.getServerName() instead.
        Returns the host name of the server to which the first request was sent (and created this session). It is the value of the part before ":" in the Host header value, if any, or the resolved server name, or the server IP address.
        Since:
        3.0.1
        See Also:
        getLocalName()
      • getLocalName

        java.lang.String getLocalName()
        Deprecated.
        as of release 7.0.0, use Execution.getLocalName() instead.
        Returns the host name of the Internet Protocol (IP) interface on which the first request was received (and creates this session).

        Note: it is the host name defined in the server. To retrieve the name in URL, use getServerName().

        Since:
        3.0.1
        See Also:
        getServerName()
      • getLocalAddr

        java.lang.String getLocalAddr()
        Deprecated.
        as of release 7.0.0, use Execution.getLocalAddr() instead.
        Returns the Internet Protocol (IP) address of the interface on which the first request was received (and creates this session).
        Since:
        3.0.1
      • invalidate

        void invalidate()
        Invalidates this session then unbinds any objects bound to it.

        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.

      • getNativeSession

        java.lang.Object getNativeSession()
        Returns the native session, or null if not available. The returned object depends on the type of clients. If HTTP, the object is an instance of javax.servlet.http.HttpSession. If portlet, the object is an instance of javax.portlet.PortletSession.