Package org.apache.catalina.manager
Class DummyProxySession
java.lang.Object
org.apache.catalina.manager.DummyProxySession
- All Implemented Interfaces:
Session
-
Field Summary
Fields inherited from interface org.apache.catalina.Session
SESSION_ACTIVATED_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
access()
Update the accessed time information for this session.void
addSessionListener
(SessionListener listener) Add a session event listener to this component.void
End access to the session.void
expire()
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.long
long
getId()
long
long
long
long
int
long
long
boolean
isAttributeDistributable
(String name, Object value) Does the session implementation support the distributing of the given attribute?boolean
isValid()
void
recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.void
removeNote
(String name) Remove any object bound to the specified name in the internal notes for this session.void
removeSessionListener
(SessionListener listener) Remove a session event listener from this component.void
setAuthType
(String authType) Set the authentication type used to authenticate our cached Principal, if any.void
setCreationTime
(long time) Set the creation time for this session.void
Set the session identifier for this session and notifies any associated listeners that a new session has been created.void
Set the session identifier for this session and optionally notifies any associated listeners that a new session has been created.void
setManager
(Manager manager) Set the Manager within which this Session is valid.void
setMaxInactiveInterval
(int interval) Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session.void
setNew
(boolean isNew) Set theisNew
flag for this session.void
Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.void
setPrincipal
(Principal principal) Set the authenticated Principal that is associated with this Session.void
setValid
(boolean isValid) Set theisValid
flag for this session.void
tellChangedSessionId
(String newId, String oldId, boolean notifySessionListeners, boolean notifyContainerListeners) Inform the listeners about the change session ID.
-
Constructor Details
-
DummyProxySession
-
-
Method Details
-
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. -
addSessionListener
Description copied from interface:Session
Add a session event listener to this component.- Specified by:
addSessionListener
in interfaceSession
- 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. -
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. -
getAuthType
- Specified by:
getAuthType
in interfaceSession
- Returns:
- the authentication type used to authenticate our cached Principal, if any.
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in interfaceSession
- Returns:
- the creation time for this session.
-
getCreationTimeInternal
public long getCreationTimeInternal()- Specified by:
getCreationTimeInternal
in interfaceSession
- Returns:
- the creation time for this session, bypassing the session validity checks.
-
getId
-
getIdInternal
- Specified by:
getIdInternal
in interfaceSession
- Returns:
- the session identifier for this session.
-
getLastAccessedTime
public long getLastAccessedTime()- Specified by:
getLastAccessedTime
in interfaceSession
- 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.
-
getLastAccessedTimeInternal
public long getLastAccessedTimeInternal()- Specified by:
getLastAccessedTimeInternal
in interfaceSession
- Returns:
- the last client access time without invalidation check
- See Also:
-
getIdleTime
public long getIdleTime()- Specified by:
getIdleTime
in interfaceSession
- Returns:
- the idle time (in milliseconds) from last client access time.
-
getIdleTimeInternal
public long getIdleTimeInternal()- Specified by:
getIdleTimeInternal
in interfaceSession
- Returns:
- the idle time from last client access time without invalidation check
- See Also:
-
getManager
- Specified by:
getManager
in interfaceSession
- Returns:
- the Manager within which this Session is valid.
-
getMaxInactiveInterval
public int getMaxInactiveInterval()- Specified by:
getMaxInactiveInterval
in interfaceSession
- 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
-
getNoteNames
- Specified by:
getNoteNames
in interfaceSession
- Returns:
- an Iterator containing the String names of all notes bindings that exist for this session.
-
getPrincipal
- Specified by:
getPrincipal
in interfaceSession
- 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 expensiveRealm.authenticate()
calls on every request. If there is no current associated Principal, returnnull
.
-
getSession
- Specified by:
getSession
in interfaceSession
- Returns:
- the
HttpSession
for which this object is the facade.
-
getThisAccessedTime
public long getThisAccessedTime()- Specified by:
getThisAccessedTime
in interfaceSession
- 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.
-
getThisAccessedTimeInternal
public long getThisAccessedTimeInternal()- Specified by:
getThisAccessedTimeInternal
in interfaceSession
- Returns:
- the last client access time without invalidation check
- See Also:
-
isValid
public boolean isValid() -
recycle
public void recycle()Description copied from interface:Session
Release all object references, and initialize instance variables, in preparation for reuse of this object. -
removeNote
Description copied from interface:Session
Remove any object bound to the specified name in the internal notes for this session.- Specified by:
removeNote
in interfaceSession
- Parameters:
name
- Name of the note to be removed
-
removeSessionListener
Description copied from interface:Session
Remove a session event listener from this component.- Specified by:
removeSessionListener
in interfaceSession
- Parameters:
listener
- remove the session listener, which will no longer be notified
-
setAuthType
Description copied from interface:Session
Set the authentication type used to authenticate our cached Principal, if any.- Specified by:
setAuthType
in interfaceSession
- 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 interfaceSession
- Parameters:
time
- The new creation time
-
setId
Description copied from interface:Session
Set the session identifier for this session and notifies any associated listeners that a new session has been created. -
setId
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. -
setManager
Description copied from interface:Session
Set the Manager within which this Session is valid.- Specified by:
setManager
in interfaceSession
- 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 interfaceSession
- Parameters:
interval
- The new maximum interval
-
setNew
public void setNew(boolean isNew) Description copied from interface:Session
Set theisNew
flag for this session. -
setNote
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. -
setPrincipal
Description copied from interface:Session
Set the authenticated Principal that is associated with this Session. This provides anAuthenticator
with a means to cache a previously authenticated Principal, and avoid potentially expensiveRealm.authenticate()
calls on every request.- Specified by:
setPrincipal
in interfaceSession
- Parameters:
principal
- The new Principal, ornull
if none
-
setValid
public void setValid(boolean isValid) Description copied from interface:Session
Set theisValid
flag for this session. -
tellChangedSessionId
public void tellChangedSessionId(String newId, String oldId, boolean notifySessionListeners, boolean notifyContainerListeners) Description copied from interface:Session
Inform the listeners about the change session ID.- Specified by:
tellChangedSessionId
in 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
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 anIllegalArgumentException
thrown if the proposed attribute is not distributable.Note that the
Manager
implementation may further restrict which attributes are distributed but aManager
level restriction should not trigger anIllegalArgumentException
inHttpSession.setAttribute(String, Object)
- Specified by:
isAttributeDistributable
in interfaceSession
- Parameters:
name
- The attribute namevalue
- The attribute value- Returns:
true
if distribution is supported, otherwisefalse
-