Package org.apache.catalina.manager
Class DummyProxySession
- java.lang.Object
-
- org.apache.catalina.manager.DummyProxySession
-
-
Field Summary
-
Fields inherited from interface org.apache.catalina.Session
SESSION_ACTIVATED_EVENT, SESSION_CHANGED_ID_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT
-
-
Constructor Summary
Constructors Constructor Description DummyProxySession(java.lang.String sessionId)Construct a DummyProxySession with the given session ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccess()Update the accessed time information for this session.voidaddSessionListener(SessionListener listener)Add a session event listener to this component.voidendAccess()End access to the session.voidexpire()Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.java.lang.StringgetAuthType()Returns the authentication type used to authenticate the cached Principal, if any.longgetCreationTime()Returns the creation time for this session.longgetCreationTimeInternal()Returns the creation time for this session, bypassing the session validity checks.java.lang.StringgetId()Returns the session identifier for this session.java.lang.StringgetIdInternal()Returns the session identifier for this session, bypassing validity checks.longgetIdleTime()Returns the idle time from last client access time.longgetIdleTimeInternal()Returns the idle time from last client access time without invalidation check.longgetLastAccessedTime()Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT.longgetLastAccessedTimeInternal()Returns the last client access time without invalidation check.ManagergetManager()Returns the Manager within which this Session is valid.intgetMaxInactiveInterval()Returns the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.java.lang.ObjectgetNote(java.lang.String name)Returns the object bound with the specified name to the internal notes for this session, ornullif no such binding exists.java.util.Iterator<java.lang.String>getNoteNames()Returns an Iterator containing the String names of all notes bindings that exist for this session.java.security.PrincipalgetPrincipal()Returns the authenticated Principal that is associated with this Session.HttpSessiongetSession()Returns theHttpSessionfor which this object is the facade.longgetThisAccessedTime()Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight, January 1, 1970 GMT.longgetThisAccessedTimeInternal()Returns the last client access time without invalidation check.booleanisAttributeDistributable(java.lang.String name, java.lang.Object value)Does the session implementation support the distributing of the given attribute?booleanisValid()Returns whether the session is still valid.voidrecycle()Release all object references, and initialize instance variables, in preparation for reuse of this object.voidremoveNote(java.lang.String name)Remove any object bound to the specified name in the internal notes for this session.voidremoveSessionListener(SessionListener listener)Remove a session event listener from this component.voidsetAuthType(java.lang.String authType)Set the authentication type used to authenticate our cached Principal, if any.voidsetCreationTime(long time)Set the creation time for this session.voidsetId(java.lang.String id)Set the session identifier for this session and notifies any associated listeners that a new session has been created.voidsetId(java.lang.String id, boolean notify)Set the session identifier for this session and optionally notifies any associated listeners that a new session has been created.voidsetManager(Manager manager)Set the Manager within which this Session is valid.voidsetMaxInactiveInterval(int interval)Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.voidsetNew(boolean isNew)Set theisNewflag for this session.voidsetNote(java.lang.String name, java.lang.Object value)Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.voidsetPrincipal(java.security.Principal principal)Set the authenticated Principal that is associated with this Session.voidsetValid(boolean isValid)Set theisValidflag for this session.voidtellChangedSessionId(java.lang.String newId, java.lang.String oldId, boolean notifySessionListeners, boolean notifyContainerListeners)Inform the listeners about the change session ID.
-
-
-
Method Detail
-
access
public void access()
Description copied from interface:SessionUpdate 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.
-
addSessionListener
public void addSessionListener(SessionListener listener)
Description copied from interface:SessionAdd a session event listener to this component.- Specified by:
addSessionListenerin interfaceSession- Parameters:
listener- the SessionListener instance that should be notified for session events
-
endAccess
public void endAccess()
Description copied from interface:SessionEnd access to the session.
-
expire
public void expire()
Description copied from interface:SessionPerform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.
-
getAuthType
public java.lang.String getAuthType()
Description copied from interface:SessionReturns the authentication type used to authenticate the cached Principal, if any.- Specified by:
getAuthTypein interfaceSession- Returns:
- the authentication type
-
getCreationTime
public long getCreationTime()
Description copied from interface:SessionReturns the creation time for this session.- Specified by:
getCreationTimein interfaceSession- Returns:
- the creation time in milliseconds since midnight, January 1, 1970 GMT
-
getCreationTimeInternal
public long getCreationTimeInternal()
Description copied from interface:SessionReturns the creation time for this session, bypassing the session validity checks.- Specified by:
getCreationTimeInternalin interfaceSession- Returns:
- the creation time in milliseconds since midnight, January 1, 1970 GMT
-
getId
public java.lang.String getId()
Description copied from interface:SessionReturns the session identifier for this session.
-
getIdInternal
public java.lang.String getIdInternal()
Description copied from interface:SessionReturns the session identifier for this session, bypassing validity checks.- Specified by:
getIdInternalin interfaceSession- Returns:
- the session identifier
-
getLastAccessedTime
public long getLastAccessedTime()
Description copied from interface:SessionReturns 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.- Specified by:
getLastAccessedTimein interfaceSession- Returns:
- the last access time in milliseconds
-
getLastAccessedTimeInternal
public long getLastAccessedTimeInternal()
Description copied from interface:SessionReturns the last client access time without invalidation check.- Specified by:
getLastAccessedTimeInternalin interfaceSession- Returns:
- the last access time in milliseconds
- See Also:
Session.getLastAccessedTime()
-
getIdleTime
public long getIdleTime()
Description copied from interface:SessionReturns the idle time from last client access time.- Specified by:
getIdleTimein interfaceSession- Returns:
- the idle time in milliseconds
-
getIdleTimeInternal
public long getIdleTimeInternal()
Description copied from interface:SessionReturns the idle time from last client access time without invalidation check.- Specified by:
getIdleTimeInternalin interfaceSession- Returns:
- the idle time in milliseconds
- See Also:
Session.getIdleTime()
-
getManager
public Manager getManager()
Description copied from interface:SessionReturns the Manager within which this Session is valid.- Specified by:
getManagerin interfaceSession- Returns:
- the manager
-
getMaxInactiveInterval
public int getMaxInactiveInterval()
Description copied from interface:SessionReturns 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:
getMaxInactiveIntervalin interfaceSession- Returns:
- the maximum inactive interval in seconds
-
getNote
public java.lang.Object getNote(java.lang.String name)
Description copied from interface:SessionReturns the object bound with the specified name to the internal notes for this session, ornullif no such binding exists.
-
getNoteNames
public java.util.Iterator<java.lang.String> getNoteNames()
Description copied from interface:SessionReturns an Iterator containing the String names of all notes bindings that exist for this session.- Specified by:
getNoteNamesin interfaceSession- Returns:
- the iterator of note names
-
getPrincipal
public java.security.Principal getPrincipal()
Description copied from interface:SessionReturns the authenticated Principal that is associated with this Session. This provides anAuthenticatorwith a means to cache a previously authenticated Principal, and avoid potentially expensiveRealm.authenticate()calls on every request. If there is no current associated Principal, returnnull.- Specified by:
getPrincipalin interfaceSession- Returns:
- the authenticated principal, or
nullif none
-
getSession
public HttpSession getSession()
Description copied from interface:SessionReturns theHttpSessionfor which this object is the facade.- Specified by:
getSessionin interfaceSession- Returns:
- the HTTP session
-
getThisAccessedTime
public long getThisAccessedTime()
Description copied from interface:SessionReturns 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.- Specified by:
getThisAccessedTimein interfaceSession- Returns:
- the last access time in milliseconds
-
getThisAccessedTimeInternal
public long getThisAccessedTimeInternal()
Description copied from interface:SessionReturns the last client access time without invalidation check.- Specified by:
getThisAccessedTimeInternalin interfaceSession- Returns:
- the last access time in milliseconds
- See Also:
Session.getThisAccessedTime()
-
isValid
public boolean isValid()
Description copied from interface:SessionReturns whether the session is still valid.
-
recycle
public void recycle()
Description copied from interface:SessionRelease all object references, and initialize instance variables, in preparation for reuse of this object.
-
removeNote
public void removeNote(java.lang.String name)
Description copied from interface:SessionRemove any object bound to the specified name in the internal notes for this session.- Specified by:
removeNotein interfaceSession- Parameters:
name- Name of the note to be removed
-
removeSessionListener
public void removeSessionListener(SessionListener listener)
Description copied from interface:SessionRemove a session event listener from this component.- Specified by:
removeSessionListenerin interfaceSession- Parameters:
listener- remove the session listener, which will no longer be notified
-
setAuthType
public void setAuthType(java.lang.String authType)
Description copied from interface:SessionSet the authentication type used to authenticate our cached Principal, if any.- Specified by:
setAuthTypein interfaceSession- Parameters:
authType- The new cached authentication type
-
setCreationTime
public void setCreationTime(long time)
Description copied from interface:SessionSet the creation time for this session. This method is called by the Manager when an existing Session instance is reused.- Specified by:
setCreationTimein interfaceSession- Parameters:
time- The new creation time
-
setId
public void setId(java.lang.String id)
Description copied from interface:SessionSet the session identifier for this session and notifies any associated listeners that a new session has been created.
-
setId
public void setId(java.lang.String id, boolean notify)Description copied from interface:SessionSet the session identifier for this session and optionally notifies any associated listeners that a new session has been created.
-
setManager
public void setManager(Manager manager)
Description copied from interface:SessionSet the Manager within which this Session is valid.- Specified by:
setManagerin interfaceSession- Parameters:
manager- The new Manager
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
Description copied from interface:SessionSet 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:
setMaxInactiveIntervalin interfaceSession- Parameters:
interval- The new maximum interval
-
setNew
public void setNew(boolean isNew)
Description copied from interface:SessionSet theisNewflag for this session.
-
setNote
public void setNote(java.lang.String name, java.lang.Object value)Description copied from interface:SessionBind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.
-
setPrincipal
public void setPrincipal(java.security.Principal principal)
Description copied from interface:SessionSet the authenticated Principal that is associated with this Session. This provides anAuthenticatorwith a means to cache a previously authenticated Principal, and avoid potentially expensiveRealm.authenticate()calls on every request.- Specified by:
setPrincipalin interfaceSession- Parameters:
principal- The new Principal, ornullif none
-
setValid
public void setValid(boolean isValid)
Description copied from interface:SessionSet theisValidflag for this session.
-
tellChangedSessionId
public void tellChangedSessionId(java.lang.String newId, java.lang.String oldId, boolean notifySessionListeners, boolean notifyContainerListeners)Description copied from interface:SessionInform the listeners about the change session ID.- Specified by:
tellChangedSessionIdin interfaceSession- Parameters:
newId- new session IDoldId- old session IDnotifySessionListeners- 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:SessionDoes 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 anIllegalArgumentExceptionthrown if the proposed attribute is not distributable.Note that the
Managerimplementation may further restrict which attributes are distributed but aManagerlevel restriction should not trigger anIllegalArgumentExceptioninHttpSession.setAttribute(String, Object)- Specified by:
isAttributeDistributablein interfaceSession- Parameters:
name- The attribute namevalue- The attribute value- Returns:
trueif distribution is supported, otherwisefalse
-
-