Package cloud.piranha

Class DefaultHttpSession

  • java.lang.Object
    • cloud.piranha.DefaultHttpSession
  • All Implemented Interfaces:
    javax.servlet.http.HttpSession


    public class DefaultHttpSession
    extends java.lang.Object
    implements javax.servlet.http.HttpSession
    The default HttpSession.
    Author:
    Manfred Riem (mriem@manorrock.com)
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultHttpSession​(javax.servlet.ServletContext servletContext)
      Constructor.
      DefaultHttpSession​(javax.servlet.ServletContext servletContext, java.lang.String id, boolean newFlag)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getAttribute​(java.lang.String name)
      Get the attribute value.
      java.util.Enumeration<java.lang.String> getAttributeNames​()
      Get the attribute names.
      long getCreationTime​()
      Get the creation time.
      java.lang.String getId​()
      Get the id.
      long getLastAccessedTime​()
      Get the last accessed time.
      int getMaxInactiveInterval​()
      Get the maximum inactive interval.
      javax.servlet.ServletContext getServletContext​()
      Get the servlet context.
      javax.servlet.http.HttpSessionContext getSessionContext​()
      Get the session context.
      java.lang.Object getValue​(java.lang.String name)
      Get the value.
      java.lang.String[] getValueNames​()
      Get the attribute names.
      void invalidate​()
      Invalidate the session.
      boolean isNew​()
      Is the session new.
      void putValue​(java.lang.String name, java.lang.Object value)
      Set the value.
      void removeAttribute​(java.lang.String name)
      Remove the attribute.
      void removeValue​(java.lang.String name)
      Remove the value.
      void setAttribute​(java.lang.String name, java.lang.Object value)
      Set the attribute.
      void setId​(java.lang.String id)
      Set the id.
      void setMaxInactiveInterval​(int maxInactiveInterval)
      Set the maximum inactive interval.
      void setNew​(boolean newFlag)
      Set the new flag.
      void setSessionManager​(cloud.piranha.api.HttpSessionManager sessionManager)
      Set the HTTP session manager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultHttpSession

        public DefaultHttpSession​(javax.servlet.ServletContext servletContext)
        Constructor.
        Parameters:
        servletContext - the servlet context.
      • DefaultHttpSession

        public DefaultHttpSession​(javax.servlet.ServletContext servletContext,
                                  java.lang.String id,
                                  boolean newFlag)
        Constructor.
        Parameters:
        servletContext - the servlet context.
        id - the id.
        newFlag - the new flag.
    • Method Detail

      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
        Get the attribute value.
        Specified by:
        getAttribute in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        Returns:
        the attribute value.
        See Also:
        HttpSession.getAttribute(java.lang.String)
      • getAttributeNames

        public java.util.Enumeration<java.lang.String> getAttributeNames​()
        Get the attribute names.
        Specified by:
        getAttributeNames in interface javax.servlet.http.HttpSession
        Returns:
        the attribute names.
        See Also:
        HttpSession.getAttributeNames()
      • getCreationTime

        public long getCreationTime​()
        Get the creation time.
        Specified by:
        getCreationTime in interface javax.servlet.http.HttpSession
        Returns:
        the creation time.
        See Also:
        HttpSession.getCreationTime()
      • getId

        public java.lang.String getId​()
        Get the id.
        Specified by:
        getId in interface javax.servlet.http.HttpSession
        Returns:
        the id.
        See Also:
        HttpSession.getId()
      • getLastAccessedTime

        public long getLastAccessedTime​()
        Get the last accessed time.
        Specified by:
        getLastAccessedTime in interface javax.servlet.http.HttpSession
        Returns:
        the last accessed time.
        See Also:
        HttpSession.getLastAccessedTime()
      • getMaxInactiveInterval

        public int getMaxInactiveInterval​()
        Get the maximum inactive interval.
        Specified by:
        getMaxInactiveInterval in interface javax.servlet.http.HttpSession
        Returns:
        the maximum inactive interval.
        See Also:
        HttpSession.getMaxInactiveInterval()
      • getServletContext

        public javax.servlet.ServletContext getServletContext​()
        Get the servlet context.
        Specified by:
        getServletContext in interface javax.servlet.http.HttpSession
        Returns:
        the servlet context.
        See Also:
        HttpSession.getServletContext()
      • getSessionContext

        public javax.servlet.http.HttpSessionContext getSessionContext​()
        Get the session context.
        Specified by:
        getSessionContext in interface javax.servlet.http.HttpSession
        Returns:
        null
        See Also:
        HttpSession.getSessionContext()
      • getValue

        public java.lang.Object getValue​(java.lang.String name)
        Get the value.
        Specified by:
        getValue in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        Returns:
        the value.
        See Also:
        HttpSession.getValue(java.lang.String)
      • getValueNames

        public java.lang.String[] getValueNames​()
        Get the attribute names.
        Specified by:
        getValueNames in interface javax.servlet.http.HttpSession
        Returns:
        the attribute names.
        See Also:
        HttpSession.getValueNames()
      • invalidate

        public void invalidate​()
        Invalidate the session.
        Specified by:
        invalidate in interface javax.servlet.http.HttpSession
        See Also:
        HttpSession.invalidate()
      • isNew

        public boolean isNew​()
        Is the session new.
        Specified by:
        isNew in interface javax.servlet.http.HttpSession
        Returns:
        true if it is, false otherwise.
        See Also:
        HttpSession.isNew()
      • putValue

        public void putValue​(java.lang.String name,
                             java.lang.Object value)
        Set the value.
        Specified by:
        putValue in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        value - the attribute value.
        See Also:
        HttpSession.putValue(java.lang.String, java.lang.Object)
      • removeAttribute

        public void removeAttribute​(java.lang.String name)
        Remove the attribute.
        Specified by:
        removeAttribute in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        See Also:
        HttpSession.removeAttribute(java.lang.String)
      • removeValue

        public void removeValue​(java.lang.String name)
        Remove the value.
        Specified by:
        removeValue in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        See Also:
        HttpSession.removeValue(java.lang.String)
      • setAttribute

        public void setAttribute​(java.lang.String name,
                                 java.lang.Object value)
        Set the attribute.
        Specified by:
        setAttribute in interface javax.servlet.http.HttpSession
        Parameters:
        name - the attribute name.
        value - the attribute value.
        See Also:
        HttpSession.setAttribute(java.lang.String, java.lang.Object)
      • setId

        public void setId​(java.lang.String id)
        Set the id.
        Parameters:
        id - the id.
      • setMaxInactiveInterval

        public void setMaxInactiveInterval​(int maxInactiveInterval)
        Set the maximum inactive interval.
        Specified by:
        setMaxInactiveInterval in interface javax.servlet.http.HttpSession
        Parameters:
        maxInactiveInterval - the maximum inactive interval.
        See Also:
        HttpSession.setMaxInactiveInterval(int)
      • setNew

        public void setNew​(boolean newFlag)
        Set the new flag.
        Parameters:
        newFlag - the new flag.
      • setSessionManager

        public void setSessionManager​(cloud.piranha.api.HttpSessionManager sessionManager)
        Set the HTTP session manager.
        Parameters:
        sessionManager - the HTTP session manager.

Copyright © 2020 Piranha Cloud. All rights reserved.