Class DummyProxySession

  • All Implemented Interfaces:
    Session

    public class DummyProxySession
    extends java.lang.Object
    implements Session
    • Constructor Detail

      • DummyProxySession

        public DummyProxySession​(java.lang.String sessionId)
    • Method Detail

      • access

        public void access()
        Description copied from interface: Session
        Update the accessed time information for this session. This method should be called by the context when a request comes in for a particular session, even if the application does not reference it.
        Specified by:
        access in interface Session
      • addSessionListener

        public void addSessionListener​(SessionListener listener)
        Description copied from interface: Session
        Add a session event listener to this component.
        Specified by:
        addSessionListener in interface Session
        Parameters:
        listener - the SessionListener instance that should be notified for session events
      • endAccess

        public void endAccess()
        Description copied from interface: Session
        End access to the session.
        Specified by:
        endAccess in interface Session
      • expire

        public void expire()
        Description copied from interface: Session
        Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
        Specified by:
        expire in interface Session
      • getAuthType

        public java.lang.String getAuthType()
        Specified by:
        getAuthType in interface Session
        Returns:
        the authentication type used to authenticate our cached Principal, if any.
      • getCreationTime

        public long getCreationTime()
        Specified by:
        getCreationTime in interface Session
        Returns:
        the creation time for this session.
      • getCreationTimeInternal

        public long getCreationTimeInternal()
        Specified by:
        getCreationTimeInternal in interface Session
        Returns:
        the creation time for this session, bypassing the session validity checks.
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface Session
        Returns:
        the session identifier for this session.
      • getIdInternal

        public java.lang.String getIdInternal()
        Specified by:
        getIdInternal in interface Session
        Returns:
        the session identifier for this session.
      • getLastAccessedTime

        public long getLastAccessedTime()
        Specified by:
        getLastAccessedTime in interface Session
        Returns:
        the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time. This one gets updated whenever a request finishes.
      • getIdleTime

        public long getIdleTime()
        Specified by:
        getIdleTime in interface Session
        Returns:
        the idle time (in milliseconds) from last client access time.
      • getManager

        public Manager getManager()
        Specified by:
        getManager in interface Session
        Returns:
        the Manager within which this Session is valid.
      • getMaxInactiveInterval

        public int getMaxInactiveInterval()
        Specified by:
        getMaxInactiveInterval in interface Session
        Returns:
        the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.
      • getNote

        public java.lang.Object getNote​(java.lang.String name)
        Specified by:
        getNote in interface Session
        Parameters:
        name - Name of the note to be returned
        Returns:
        the object bound with the specified name to the internal notes for this session, or null if no such binding exists.
      • getNoteNames

        public java.util.Iterator<java.lang.String> getNoteNames()
        Specified by:
        getNoteNames in interface Session
        Returns:
        an Iterator containing the String names of all notes bindings that exist for this session.
      • getPrincipal

        public java.security.Principal getPrincipal()
        Specified by:
        getPrincipal in interface Session
        Returns:
        the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request. If there is no current associated Principal, return null.
      • getSession

        public HttpSession getSession()
        Specified by:
        getSession in interface Session
        Returns:
        the HttpSession for which this object is the facade.
      • getThisAccessedTime

        public long getThisAccessedTime()
        Specified by:
        getThisAccessedTime in interface Session
        Returns:
        the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT. Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time. This one gets updated whenever a request starts.
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface Session
        Returns:
        true if the session is still valid
      • recycle

        public void recycle()
        Description copied from interface: Session
        Release all object references, and initialize instance variables, in preparation for reuse of this object.
        Specified by:
        recycle in interface Session
      • removeNote

        public void removeNote​(java.lang.String name)
        Description copied from interface: Session
        Remove any object bound to the specified name in the internal notes for this session.
        Specified by:
        removeNote in interface Session
        Parameters:
        name - Name of the note to be removed
      • removeSessionListener

        public void removeSessionListener​(SessionListener listener)
        Description copied from interface: Session
        Remove a session event listener from this component.
        Specified by:
        removeSessionListener in interface Session
        Parameters:
        listener - remove the session listener, which will no longer be notified
      • setAuthType

        public void setAuthType​(java.lang.String authType)
        Description copied from interface: Session
        Set the authentication type used to authenticate our cached Principal, if any.
        Specified by:
        setAuthType in interface Session
        Parameters:
        authType - The new cached authentication type
      • setCreationTime

        public void setCreationTime​(long time)
        Description copied from interface: Session
        Set the creation time for this session. This method is called by the Manager when an existing Session instance is reused.
        Specified by:
        setCreationTime in interface Session
        Parameters:
        time - The new creation time
      • setId

        public void setId​(java.lang.String id)
        Description copied from interface: Session
        Set the session identifier for this session and notifies any associated listeners that a new session has been created.
        Specified by:
        setId in interface Session
        Parameters:
        id - The new session identifier
      • setId

        public void setId​(java.lang.String id,
                          boolean notify)
        Description copied from interface: Session
        Set the session identifier for this session and optionally notifies any associated listeners that a new session has been created.
        Specified by:
        setId in interface Session
        Parameters:
        id - The new session identifier
        notify - Should any associated listeners be notified that a new session has been created?
      • setManager

        public void setManager​(Manager manager)
        Description copied from interface: Session
        Set the Manager within which this Session is valid.
        Specified by:
        setManager in interface Session
        Parameters:
        manager - The new Manager
      • setMaxInactiveInterval

        public void setMaxInactiveInterval​(int interval)
        Description copied from interface: Session
        Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. A negative time indicates that the session should never time out.
        Specified by:
        setMaxInactiveInterval in interface Session
        Parameters:
        interval - The new maximum interval
      • setNew

        public void setNew​(boolean isNew)
        Description copied from interface: Session
        Set the isNew flag for this session.
        Specified by:
        setNew in interface Session
        Parameters:
        isNew - The new value for the isNew flag
      • setNote

        public void setNote​(java.lang.String name,
                            java.lang.Object value)
        Description copied from interface: Session
        Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.
        Specified by:
        setNote in interface Session
        Parameters:
        name - Name to which the object should be bound
        value - Object to be bound to the specified name
      • setPrincipal

        public void setPrincipal​(java.security.Principal principal)
        Description copied from interface: Session
        Set the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request.
        Specified by:
        setPrincipal in interface Session
        Parameters:
        principal - The new Principal, or null if none
      • setValid

        public void setValid​(boolean isValid)
        Description copied from interface: Session
        Set the isValid flag for this session.
        Specified by:
        setValid in interface Session
        Parameters:
        isValid - The new value for the isValid flag
      • tellChangedSessionId

        public void tellChangedSessionId​(java.lang.String newId,
                                         java.lang.String oldId,
                                         boolean notifySessionListeners,
                                         boolean notifyContainerListeners)
        Description copied from interface: Session
        Inform the listeners about the change session ID.
        Specified by:
        tellChangedSessionId in interface Session
        Parameters:
        newId - new session ID
        oldId - old session ID
        notifySessionListeners - Should any associated sessionListeners be notified that session ID has been changed?
        notifyContainerListeners - Should any associated ContainerListeners be notified that session ID has been changed?
      • isAttributeDistributable

        public boolean isAttributeDistributable​(java.lang.String name,
                                                java.lang.Object value)
        Description copied from interface: Session
        Does the session implementation support the distributing of the given attribute? If the Manager is marked as distributable, then this method must be used to check attributes before adding them to a session and an IllegalArgumentException thrown if the proposed attribute is not distributable.

        Note that the Manager implementation may further restrict which attributes are distributed but a Manager level restriction should not trigger an IllegalArgumentException in HttpSession.setAttribute(String, Object)

        Specified by:
        isAttributeDistributable in interface Session
        Parameters:
        name - The attribute name
        value - The attribute value
        Returns:
        true if distribution is supported, otherwise false