Package org.apache.catalina.session

# Class ManagerBase

java.lang.Object
org.apache.catalina.util.LifecycleBase
org.apache.catalina.util.LifecycleMBeanBase
org.apache.catalina.session.ManagerBase

All Implemented Interfaces:
  `MBeanRegistration`, `JmxEnabled`, `Lifecycle`, `Manager`

Direct Known Subclasses:
  `ClusterManagerBase`, `PersistentManagerBase`, `StandardManager`

public abstract class ManagerBase extends LifecycleMBeanBase implements Manager
Minimal implementation of the Manager interface that supports no session persistence or distributable capabilities. This class may be subclassed to create more sophisticated Manager implementations.

Author:
  Craig R. McClanahan

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static final class`
  `ManagerBase.SessionTiming`

  ## Nested classes/interfaces inherited from interface org.apache.catalina.Lifecycle

  `Lifecycle.SingleUse`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected int`
  `duplicates`
  Deprecated.
  This will be removed in Tomcat 11
  `protected final AtomicLong`
  `expiredSessions`
  Number of sessions that have expired.
  `protected int`
  `maxActive`
  `protected int`
  `maxActiveSessions`
  The maximum number of active Sessions allowed, or -1 for no limit.
  `protected int`
  `processExpiresFrequency`
  Frequency of the session expiration, and related manager operations.
  `protected long`
  `processingTime`
  Processing time during session expiration.
  `protected int`
  `rejectedSessions`
  Number of session creations that failed due to maxActiveSessions.
  `protected String`
  `secureRandomAlgorithm`
  The name of the algorithm to use to create instances of `SecureRandom` which are used to generate session IDs.
  `protected String`
  `secureRandomClass`
  The Java class name of the secure random number generator class to be used when generating session identifiers.
  `protected String`
  `secureRandomProvider`
  The name of the provider to use to create instances of `SecureRandom` which are used to generate session IDs.
  `protected long`
  `sessionCounter`
  Deprecated.
  This will be removed in Tomcat 11
  `protected final Deque<ManagerBase.SessionTiming>`
  `sessionCreationTiming`
  `protected final Deque<ManagerBase.SessionTiming>`
  `sessionExpirationTiming`
  `protected SessionIdGenerator`
  `sessionIdGenerator`
  `protected Class<? extends SessionIdGenerator>`
  `sessionIdGeneratorClass`
  `protected int`
  `sessionMaxAliveTime`
  The longest time (in seconds) that an expired session had been alive.
  `protected Map<String,Session>`
  `sessions`
  The set of currently active Sessions for this Manager, keyed by session identifier.
  `protected static final StringManager`
  `sm`
  The string manager for this package.
  `protected final PropertyChangeSupport`
  `support`
  The property change support for this component.
  `protected static final int`
  `TIMING_STATS_CACHE_SIZE`

  ### Fields inherited from class org.apache.catalina.util.LifecycleMBeanBase

  `mserver`

  ### Fields inherited from interface org.apache.catalina.Lifecycle

  `AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ManagerBase()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(Session session)`
  Add this Session to the set of active Sessions for this Manager.
  `void`
  `addPropertyChangeListener(PropertyChangeListener listener)`
  Add a property change listener to this component.
  `void`
  `backgroundProcess()`
  This method will be invoked by the context/container on a periodic basis and allows the manager to implement a method that executes periodic tasks, such as expiring sessions etc.
  `void`
  `changeSessionId(Session session)`
  Change the session ID of the current session to a new randomly generated session ID.
  `void`
  `changeSessionId(Session session, String newId)`
  Change the session ID of the current session to a specified session ID.
  `protected void`
  `changeSessionId(Session session, String newId, boolean notifySessionListeners, boolean notifyContainerListeners)`
  `Session`
  `createEmptySession()`
  Get a session from the recycled ones or create a new empty one.
  `Session`
  `createSession(String sessionId)`
  Construct and return a new session object, based on the default settings specified by this Manager's properties.
  `void`
  `expireSession(String sessionId)`
  `Session`
  `findSession(String id)`
  Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return `null`.
  `Session[]`
  `findSessions()`
  Return the set of active Sessions associated with this Manager.
  `protected String`
  `generateSessionId()`
  Generate and return a new session identifier.
  `int`
  `getActiveSessions()`
  Gets the number of currently active sessions.
  `String`
  `getClassName()`
  `Context`
  `getContext()`
  Get the Context with which this Manager is associated.
  `String`
  `getCreationTime(String sessionId)`
  `long`
  `getCreationTimestamp(String sessionId)`
  `String`
  `getDomainInternal()`
  Method implemented by sub-classes to identify the domain in which MBeans should be registered.
  `int`
  `getDuplicates()`
  Deprecated.
  This will be removed in Tomcat 11
  `Engine`
  `getEngine()`
  Retrieve the enclosing Engine for this Manager.
  `long`
  `getExpiredSessions()`
  Gets the number of sessions that have expired.
  `String`
  `getJvmRoute()`
  Retrieve the JvmRoute for the enclosing Engine.
  `String`
  `getLastAccessedTime(String sessionId)`
  `long`
  `getLastAccessedTimestamp(String sessionId)`
  `int`
  `getMaxActive()`
  Gets the maximum number of sessions that have been active at the same time.
  `int`
  `getMaxActiveSessions()`
  `String`
  `getName()`
  `protected StandardSession`
  `getNewSession()`
  Get new session class to be used in the doLoad() method.
  `boolean`
  `getNotifyAttributeListenerOnUnchangedValue()`
  When an attribute that is already present in the session is added again under the same name and a `HttpSessionAttributeListener` is configured for the session should `HttpSessionAttributeListener.attributeReplaced(javax.servlet.http.HttpSessionBindingEvent)` be called?
  `boolean`
  `getNotifyBindingListenerOnUnchangedValue()`
  When an attribute that is already present in the session is added again under the same name and the attribute implements `HttpSessionBindingListener`, should `HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)` be called followed by `HttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)`?
  `String`
  `getObjectNameKeyProperties()`
  Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.
  `boolean`
  `getPersistAuthentication()`
  Return whether sessions managed by this manager shall persist authentication information or not.
  `boolean`
  `getPersistAuthenticationNotes()`
  Deprecated.
  Will be removed in Tomcat 10.1.x where it is effectively hard-coded to `true`
  `int`
  `getProcessExpiresFrequency()`
  `long`
  `getProcessingTime()`
  `int`
  `getRejectedSessions()`
  Gets the number of sessions that were not created because the maximum number of active sessions was reached.
  `String`
  `getSecureRandomAlgorithm()`
  `String`
  `getSecureRandomClass()`
  `String`
  `getSecureRandomProvider()`
  `HashMap<String,String>`
  `getSession(String sessionId)`
  Returns information about the session with the given session id.
  `String`
  `getSessionAttribute(String sessionId, String key)`
  For debugging.
  `String`
  `getSessionAttributeNameFilter()`
  Obtain the regular expression used to filter session attribute based on attribute name.
  `protected Pattern`
  `getSessionAttributeNamePattern()`
  Provides `getSessionAttributeNameFilter()` as a pre-compiled regular expression pattern.
  `String`
  `getSessionAttributeValueClassNameFilter()`
  Obtain the regular expression used to filter session attribute based on the implementation class of the value.
  `protected Pattern`
  `getSessionAttributeValueClassNamePattern()`
  Provides `getSessionAttributeValueClassNameFilter()` as a pre-compiled regular expression pattern.
  `int`
  `getSessionAverageAliveTime()`
  Gets the average time (in seconds) that expired sessions had been alive.
  `long`
  `getSessionCounter()`
  Returns the total number of sessions created by this manager, which is approximated as the number of active sessions plus the number of expired sessions.
  `int`
  `getSessionCreateRate()`
  Gets the current rate of session creation (in session per minute).
  `int`
  `getSessionExpireRate()`
  Gets the current rate of session expiration (in session per minute).
  `SessionIdGenerator`
  `getSessionIdGenerator()`
  `int`
  `getSessionMaxAliveTime()`
  Gets the longest time (in seconds) that an expired session had been alive.
  `String`
  `getThisAccessedTime(String sessionId)`
  `long`
  `getThisAccessedTimestamp(String sessionId)`
  `boolean`
  `getWarnOnSessionAttributeFilterFailure()`
  Should a warn level log message be generated if a session attribute is not persisted / replicated / restored.
  `protected void`
  `initInternal()`
  Sub-classes implement this method to perform any instance initialisation required.
  `String`
  `listSessionIds()`
  For debugging.
  `void`
  `processExpires()`
  Invalidate all sessions that have expired.
  `void`
  `remove(Session session)`
  Remove this Session from the active Sessions for this Manager.
  `void`
  `remove(Session session, boolean update)`
  Remove this Session from the active Sessions for this Manager.
  `void`
  `removePropertyChangeListener(PropertyChangeListener listener)`
  Remove a property change listener from this component.
  `String`
  `rotateSessionId(Session session)`
  Change the session ID of the current session to a new randomly generated session ID.
  `void`
  `setContext(Context context)`
  Set the Context with which this Manager is associated.
  `void`
  `setDuplicates(int duplicates)`
  Deprecated.
  This will be removed in Tomcat 11
  `void`
  `setExpiredSessions(long expiredSessions)`
  Sets the number of sessions that have expired.
  `void`
  `setMaxActive(int maxActive)`
  (Re)sets the maximum number of sessions that have been active at the same time.
  `void`
  `setMaxActiveSessions(int max)`
  Set the maximum number of active Sessions allowed, or -1 for no limit.
  `void`
  `setNotifyAttributeListenerOnUnchangedValue(boolean notifyAttributeListenerOnUnchangedValue)`
  Configure if `HttpSessionAttributeListener.attributeReplaced(javax.servlet.http.HttpSessionBindingEvent)` when an attribute that is already present in the session is added again under the same name and a `HttpSessionAttributeListener` is configured for the session.
  `void`
  `setNotifyBindingListenerOnUnchangedValue(boolean notifyBindingListenerOnUnchangedValue)`
  Configure if `HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)` be called followed by `HttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)` when an attribute that is already present in the session is added again under the same name and the attribute implements `HttpSessionBindingListener`.
  `void`
  `setPersistAuthentication(boolean persistAuthentication)`
  Set whether sessions managed by this manager shall persist authentication information or not.
  `void`
  `setPersistAuthenticationNotes(boolean persistAuthenticationNotes)`
  Deprecated.
  Will be removed in Tomcat 10.1.x where it is effectively hard-coded to `true`
  `void`
  `setProcessExpiresFrequency(int processExpiresFrequency)`
  Set the manager checks frequency.
  `void`
  `setProcessingTime(long processingTime)`
  `void`
  `setSecureRandomAlgorithm(String secureRandomAlgorithm)`
  Set the secure random number generator algorithm name.
  `void`
  `setSecureRandomClass(String secureRandomClass)`
  Set the secure random number generator class name.
  `void`
  `setSecureRandomProvider(String secureRandomProvider)`
  Set the secure random number generator provider name.
  `void`
  `setSessionAttributeNameFilter(String sessionAttributeNameFilter)`
  Set the regular expression to use to filter session attributes based on attribute name.
  `void`
  `setSessionAttributeValueClassNameFilter(String sessionAttributeValueClassNameFilter)`
  Set the regular expression to use to filter classes used for session attributes.
  `void`
  `setSessionCounter(long sessionCounter)`
  Sets the total number of sessions created by this manager.
  `void`
  `setSessionIdGenerator(SessionIdGenerator sessionIdGenerator)`
  Sets the session id generator
  `void`
  `setSessionMaxAliveTime(int sessionMaxAliveTime)`
  Sets the longest time (in seconds) that an expired session had been alive.
  `void`
  `setWarnOnSessionAttributeFilterFailure(boolean warnOnSessionAttributeFilterFailure)`
  Configure whether or not a warn level log message should be generated if a session attribute is not persisted / replicated / restored.
  `protected void`
  `startInternal()`
  Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method.
  `protected void`
  `stopInternal()`
  Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method.
  `String`
  `toString()`
  `void`
  `updateSessionMaxAliveTime(int sessionAliveTime)`
  Updates the sessionMaxAliveTime attribute if the candidate value is larger than the current value.
  `boolean`
  `willAttributeDistribute(String name, Object value)`
  Would the Manager distribute the given session attribute?

  ### Methods inherited from class org.apache.catalina.util.LifecycleMBeanBase

  `destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister, unregister`

  ### Methods inherited from class org.apache.catalina.util.LifecycleBase

  `addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface org.apache.catalina.Manager

  `load, unload`

- ## Field Details

  - ### secureRandomClass

    protected String secureRandomClass
    The Java class name of the secure random number generator class to be used when generating session identifiers. The random number generator class must be self-seeding and have a zero-argument constructor. If not specified, an instance of `SecureRandom` will be generated.

  - ### secureRandomAlgorithm

    protected String secureRandomAlgorithm
    The name of the algorithm to use to create instances of `SecureRandom` which are used to generate session IDs. If no algorithm is specified, SHA1PRNG is used. If SHA1PRNG is not available, the platform default will be used. To use the platform default (which may be SHA1PRNG), specify the empty string. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults. If that fails, the SecureRandom instances will be created using platform defaults.

  - ### secureRandomProvider

    protected String secureRandomProvider
    The name of the provider to use to create instances of `SecureRandom` which are used to generate session IDs. If no provider is specified the platform default is used. If an invalid algorithm and/or provider is specified the SecureRandom instances will be created using the defaults. If that fails, the SecureRandom instances will be created using platform defaults.

  - ### sessionIdGenerator

    protected SessionIdGenerator sessionIdGenerator

  - ### sessionIdGeneratorClass

    protected Class<? extends SessionIdGenerator> sessionIdGeneratorClass

  - ### sessionMaxAliveTime

    protected volatile int sessionMaxAliveTime
    The longest time (in seconds) that an expired session had been alive.

  - ### TIMING_STATS_CACHE_SIZE

    protected static final int TIMING_STATS_CACHE_SIZE
    See Also:
      - Constant Field Values

  - ### sessionCreationTiming

    protected final Deque<ManagerBase.SessionTiming> sessionCreationTiming

  - ### sessionExpirationTiming

    protected final Deque<ManagerBase.SessionTiming> sessionExpirationTiming

  - ### expiredSessions

    protected final AtomicLong expiredSessions
    Number of sessions that have expired.

  - ### sessions

    protected Map<String,Session> sessions
    The set of currently active Sessions for this Manager, keyed by session identifier.

  - ### sessionCounter

    @Deprecated protected long sessionCounter
    Deprecated.
    This will be removed in Tomcat 11
    Number of sessions created by this manager.

  - ### maxActive

    protected volatile int maxActive

  - ### maxActiveSessions

    protected int maxActiveSessions
    The maximum number of active Sessions allowed, or -1 for no limit.

  - ### rejectedSessions

    protected int rejectedSessions
    Number of session creations that failed due to maxActiveSessions.

  - ### duplicates

    @Deprecated protected volatile int duplicates
    Deprecated.
    This will be removed in Tomcat 11
    Number of duplicated session ids, anything > 0 means we have problems.

  - ### processingTime

    protected long processingTime
    Processing time during session expiration.

  - ### processExpiresFrequency

    protected int processExpiresFrequency
    Frequency of the session expiration, and related manager operations. Manager operations will be done once for the specified amount of backgroundProcess calls (ie, the lower the amount, the most often the checks will occur).

  - ### sm

    protected static final StringManager sm
    The string manager for this package.

  - ### support

    protected final PropertyChangeSupport support
    The property change support for this component.

- ## Constructor Details

  - ### ManagerBase

    public ManagerBase()

- ## Method Details

  - ### getNotifyAttributeListenerOnUnchangedValue

    public boolean getNotifyAttributeListenerOnUnchangedValue()
    Description copied from interface: `Manager`
    When an attribute that is already present in the session is added again under the same name and a `HttpSessionAttributeListener` is configured for the session should `HttpSessionAttributeListener.attributeReplaced(javax.servlet.http.HttpSessionBindingEvent)` be called?

    The default value is `true`.

    Specified by:
      `getNotifyAttributeListenerOnUnchangedValue` in interface `Manager`
    Returns:
      `true` if the listener will be notified, `false` if it will not

  - ### setNotifyAttributeListenerOnUnchangedValue

    public void setNotifyAttributeListenerOnUnchangedValue(boolean notifyAttributeListenerOnUnchangedValue)
    Description copied from interface: `Manager`
    Configure if `HttpSessionAttributeListener.attributeReplaced(javax.servlet.http.HttpSessionBindingEvent)` when an attribute that is already present in the session is added again under the same name and a `HttpSessionAttributeListener` is configured for the session.
    Specified by:
      `setNotifyAttributeListenerOnUnchangedValue` in interface `Manager`
    Parameters:
      `notifyAttributeListenerOnUnchangedValue` - `true` the listener will be called, `false` it will not

  - ### getNotifyBindingListenerOnUnchangedValue

    public boolean getNotifyBindingListenerOnUnchangedValue()
    Description copied from interface: `Manager`
    When an attribute that is already present in the session is added again under the same name and the attribute implements `HttpSessionBindingListener`, should `HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)` be called followed by `HttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)`?

    The default value is `false`.

    Specified by:
      `getNotifyBindingListenerOnUnchangedValue` in interface `Manager`
    Returns:
      `true` if the listener will be notified, `false` if it will not

  - ### setNotifyBindingListenerOnUnchangedValue

    public void setNotifyBindingListenerOnUnchangedValue(boolean notifyBindingListenerOnUnchangedValue)
    Description copied from interface: `Manager`
    Configure if `HttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)` be called followed by `HttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)` when an attribute that is already present in the session is added again under the same name and the attribute implements `HttpSessionBindingListener`.
    Specified by:
      `setNotifyBindingListenerOnUnchangedValue` in interface `Manager`
    Parameters:
      `notifyBindingListenerOnUnchangedValue` - `true` the listener will be called, `false` it will not

  - ### getSessionAttributeNameFilter

    public String getSessionAttributeNameFilter()
    Obtain the regular expression used to filter session attribute based on attribute name. The regular expression is anchored so it must match the entire name
    Returns:
      The regular expression currently used to filter attribute names. `null` means no filter is applied. If an empty string is specified then no names will match the filter and all attributes will be blocked.

  - ### setSessionAttributeNameFilter

    public void setSessionAttributeNameFilter(String sessionAttributeNameFilter) throws PatternSyntaxException
    Set the regular expression to use to filter session attributes based on attribute name. The regular expression is anchored so it must match the entire name.
    Parameters:
      `sessionAttributeNameFilter` - The regular expression to use to filter session attributes based on attribute name. Use `null` if no filtering is required. If an empty string is specified then no names will match the filter and all attributes will be blocked.
    Throws:
      `PatternSyntaxException` - If the expression is not valid

  - ### getSessionAttributeNamePattern

    protected Pattern getSessionAttributeNamePattern()
    Provides `getSessionAttributeNameFilter()` as a pre-compiled regular expression pattern.
    Returns:
      The pre-compiled pattern used to filter session attributes based on attribute name. `null` means no filter is applied.

  - ### getSessionAttributeValueClassNameFilter

    public String getSessionAttributeValueClassNameFilter()
    Obtain the regular expression used to filter session attribute based on the implementation class of the value. The regular expression is anchored and must match the fully qualified class name.
    Returns:
      The regular expression currently used to filter class names. `null` means no filter is applied. If an empty string is specified then no names will match the filter and all attributes will be blocked.

  - ### getSessionAttributeValueClassNamePattern

    protected Pattern getSessionAttributeValueClassNamePattern()
    Provides `getSessionAttributeValueClassNameFilter()` as a pre-compiled regular expression pattern.
    Returns:
      The pre-compiled pattern used to filter session attributes based on the implementation class name of the value. `null` means no filter is applied.

  - ### setSessionAttributeValueClassNameFilter

    public void setSessionAttributeValueClassNameFilter(String sessionAttributeValueClassNameFilter) throws PatternSyntaxException
    Set the regular expression to use to filter classes used for session attributes. The regular expression is anchored and must match the fully qualified class name.
    Parameters:
      `sessionAttributeValueClassNameFilter` - The regular expression to use to filter session attributes based on class name. Use `null` if no filtering is required. If an empty string is specified then no names will match the filter and all attributes will be blocked.
    Throws:
      `PatternSyntaxException` - If the expression is not valid

  - ### getWarnOnSessionAttributeFilterFailure

    public boolean getWarnOnSessionAttributeFilterFailure()
    Should a warn level log message be generated if a session attribute is not persisted / replicated / restored.
    Returns:
      `true` if a warn level log message should be generated

  - ### setWarnOnSessionAttributeFilterFailure

    public void setWarnOnSessionAttributeFilterFailure(boolean warnOnSessionAttributeFilterFailure)
    Configure whether or not a warn level log message should be generated if a session attribute is not persisted / replicated / restored.
    Parameters:
      `warnOnSessionAttributeFilterFailure` - `true` if the warn level message should be generated

  - ### getContext

    public Context getContext()
    Description copied from interface: `Manager`
    Get the Context with which this Manager is associated.
    Specified by:
      `getContext` in interface `Manager`
    Returns:
      The associated Context

  - ### setContext

    public void setContext(Context context)
    Description copied from interface: `Manager`
    Set the Context with which this Manager is associated. The Context must be set to a non-null value before the Manager is first used. Multiple calls to this method before first use are permitted. Once the Manager has been used, this method may not be used to change the Context (including setting a `null` value) that the Manager is associated with.
    Specified by:
      `setContext` in interface `Manager`
    Parameters:
      `context` - The newly associated Context

  - ### getClassName

    public String getClassName()
    Returns:
      The name of the implementation class.

  - ### getSessionIdGenerator

    public SessionIdGenerator getSessionIdGenerator()
    Specified by:
      `getSessionIdGenerator` in interface `Manager`
    Returns:
      the session id generator

  - ### setSessionIdGenerator

    public void setSessionIdGenerator(SessionIdGenerator sessionIdGenerator)
    Description copied from interface: `Manager`
    Sets the session id generator
    Specified by:
      `setSessionIdGenerator` in interface `Manager`
    Parameters:
      `sessionIdGenerator` - The session id generator

  - ### getName

    public String getName()
    Returns:
      The descriptive short name of this Manager implementation.

  - ### getSecureRandomClass

    public String getSecureRandomClass()
    Returns:
      The secure random number generator class name.

  - ### setSecureRandomClass

    public void setSecureRandomClass(String secureRandomClass)
    Set the secure random number generator class name.
    Parameters:
      `secureRandomClass` - The new secure random number generator class name

  - ### getSecureRandomAlgorithm

    public String getSecureRandomAlgorithm()
    Returns:
      The secure random number generator algorithm name.

  - ### setSecureRandomAlgorithm

    public void setSecureRandomAlgorithm(String secureRandomAlgorithm)
    Set the secure random number generator algorithm name.
    Parameters:
      `secureRandomAlgorithm` - The new secure random number generator algorithm name

  - ### getSecureRandomProvider

    public String getSecureRandomProvider()
    Returns:
      The secure random number generator provider name.

  - ### setSecureRandomProvider

    public void setSecureRandomProvider(String secureRandomProvider)
    Set the secure random number generator provider name.
    Parameters:
      `secureRandomProvider` - The new secure random number generator provider name

  - ### getRejectedSessions

    public int getRejectedSessions()
    Description copied from interface: `Manager`
    Gets the number of sessions that were not created because the maximum number of active sessions was reached.
    Specified by:
      `getRejectedSessions` in interface `Manager`
    Returns:
      Number of rejected sessions

  - ### getExpiredSessions

    public long getExpiredSessions()
    Description copied from interface: `Manager`
    Gets the number of sessions that have expired.
    Specified by:
      `getExpiredSessions` in interface `Manager`
    Returns:
      Number of sessions that have expired

  - ### setExpiredSessions

    public void setExpiredSessions(long expiredSessions)
    Description copied from interface: `Manager`
    Sets the number of sessions that have expired.
    Specified by:
      `setExpiredSessions` in interface `Manager`
    Parameters:
      `expiredSessions` - Number of sessions that have expired

  - ### getProcessingTime

    public long getProcessingTime()

  - ### setProcessingTime

    public void setProcessingTime(long processingTime)

  - ### getProcessExpiresFrequency

    public int getProcessExpiresFrequency()
    Returns:
      The frequency of manager checks.

  - ### setProcessExpiresFrequency

    public void setProcessExpiresFrequency(int processExpiresFrequency)
    Set the manager checks frequency.
    Parameters:
      `processExpiresFrequency` - the new manager checks frequency

  - ### getPersistAuthentication

    public boolean getPersistAuthentication()
    Return whether sessions managed by this manager shall persist authentication information or not.
    Returns:
      `true`, sessions managed by this manager shall persist authentication information; `false` otherwise

  - ### setPersistAuthentication

    public void setPersistAuthentication(boolean persistAuthentication)
    Set whether sessions managed by this manager shall persist authentication information or not.
    Parameters:
      `persistAuthentication` - if `true`, sessions managed by this manager shall persist authentication information

  - ### getPersistAuthenticationNotes

    @Deprecated public boolean getPersistAuthenticationNotes()
    Deprecated.
    Will be removed in Tomcat 10.1.x where it is effectively hard-coded to `true`
    Return whether sessions managed by this manager shall persist authentication notes used by FORM authentication or not.
    Returns:
      `true`, sessions managed by this manager shall persist authentication notes used by FORM authentication; `false` otherwise

  - ### setPersistAuthenticationNotes

    @Deprecated public void setPersistAuthenticationNotes(boolean persistAuthenticationNotes)
    Deprecated.
    Will be removed in Tomcat 10.1.x where it is effectively hard-coded to `true`
    Set whether sessions managed by this manager shall persist authentication notes used by FORM authentication or not.
    Parameters:
      `persistAuthenticationNotes` - if `true`, sessions managed by this manager shall persist authentication notes used by FORM authentication

  - ### backgroundProcess

    public void backgroundProcess()
    This method will be invoked by the context/container on a periodic basis and allows the manager to implement a method that executes periodic tasks, such as expiring sessions etc.

    Direct call to `processExpires()`

    Specified by:
      `backgroundProcess` in interface `Manager`

  - ### processExpires

    public void processExpires()
    Invalidate all sessions that have expired.

  - ### initInternal

    protected void initInternal() throws LifecycleException
    Description copied from class: `LifecycleBase`
    Sub-classes implement this method to perform any instance initialisation required.
    Overrides:
      `initInternal` in class `LifecycleMBeanBase`
    Throws:
      `LifecycleException` - If the initialisation fails

  - ### startInternal

    protected void startInternal() throws LifecycleException
    Description copied from class: `LifecycleBase`
    Sub-classes must ensure that the state is changed to `LifecycleState.STARTING` during the execution of this method. Changing state will trigger the `Lifecycle.START_EVENT` event. If a component fails to start it may either throw a `LifecycleException` which will cause it's parent to fail to start or it can place itself in the error state in which case `LifecycleBase.stop()` will be called on the failed component but the parent component will continue to start normally.
    Specified by:
      `startInternal` in class `LifecycleBase`
    Throws:
      `LifecycleException` - Start error occurred

  - ### stopInternal

    protected void stopInternal() throws LifecycleException
    Description copied from class: `LifecycleBase`
    Sub-classes must ensure that the state is changed to `LifecycleState.STOPPING` during the execution of this method. Changing state will trigger the `Lifecycle.STOP_EVENT` event.
    Specified by:
      `stopInternal` in class `LifecycleBase`
    Throws:
      `LifecycleException` - Stop error occurred

  - ### add

    public void add(Session session)
    Description copied from interface: `Manager`
    Add this Session to the set of active Sessions for this Manager.
    Specified by:
      `add` in interface `Manager`
    Parameters:
      `session` - Session to be added

  - ### addPropertyChangeListener

    public void addPropertyChangeListener(PropertyChangeListener listener)
    Description copied from interface: `Manager`
    Add a property change listener to this component.
    Specified by:
      `addPropertyChangeListener` in interface `Manager`
    Parameters:
      `listener` - The listener to add

  - ### createSession

    public Session createSession(String sessionId)
    Description copied from interface: `Manager`
    Construct and return a new session object, based on the default settings specified by this Manager's properties. The session id specified will be used as the session id. If a new session cannot be created for any reason, return `null`.
    Specified by:
      `createSession` in interface `Manager`
    Parameters:
      `sessionId` - The session id which should be used to create the new session; if `null`, the session id will be assigned by this method, and available via the getId() method of the returned session.
    Returns:
      An empty Session object with the given ID or a newly created session ID if none was specified

  - ### createEmptySession

    public Session createEmptySession()
    Description copied from interface: `Manager`
    Get a session from the recycled ones or create a new empty one. The PersistentManager manager does not need to create session data because it reads it from the Store.
    Specified by:
      `createEmptySession` in interface `Manager`
    Returns:
      An empty Session object

  - ### findSession

    public Session findSession(String id) throws IOException
    Description copied from interface: `Manager`
    Return the active Session, associated with this Manager, with the specified session id (if any); otherwise return `null`.
    Specified by:
      `findSession` in interface `Manager`
    Parameters:
      `id` - The session id for the session to be returned
    Returns:
      the request session or `null` if a session with the requested ID could not be found
    Throws:
      `IOException` - if an input/output error occurs while processing this request

  - ### findSessions

    public Session[] findSessions()
    Description copied from interface: `Manager`
    Return the set of active Sessions associated with this Manager. If this Manager has no active Sessions, a zero-length array is returned.
    Specified by:
      `findSessions` in interface `Manager`
    Returns:
      All the currently active sessions managed by this manager

  - ### remove

    public void remove(Session session)
    Description copied from interface: `Manager`
    Remove this Session from the active Sessions for this Manager.
    Specified by:
      `remove` in interface `Manager`
    Parameters:
      `session` - Session to be removed

  - ### remove

    public void remove(Session session, boolean update)
    Description copied from interface: `Manager`
    Remove this Session from the active Sessions for this Manager.
    Specified by:
      `remove` in interface `Manager`
    Parameters:
      `session` - Session to be removed
      `update` - Should the expiration statistics be updated

  - ### removePropertyChangeListener

    public void removePropertyChangeListener(PropertyChangeListener listener)
    Description copied from interface: `Manager`
    Remove a property change listener from this component.
    Specified by:
      `removePropertyChangeListener` in interface `Manager`
    Parameters:
      `listener` - The listener to remove

  - ### changeSessionId

    public void changeSessionId(Session session)
    Description copied from interface: `Manager`
    Change the session ID of the current session to a new randomly generated session ID.
    Specified by:
      `changeSessionId` in interface `Manager`
    Parameters:
      `session` - The session to change the session ID for

  - ### rotateSessionId

    public String rotateSessionId(Session session)
    Description copied from interface: `Manager`
    Change the session ID of the current session to a new randomly generated session ID.
    Specified by:
      `rotateSessionId` in interface `Manager`
    Parameters:
      `session` - The session to change the session ID for
    Returns:
      The new session ID

  - ### changeSessionId

    public void changeSessionId(Session session, String newId)
    Description copied from interface: `Manager`
    Change the session ID of the current session to a specified session ID.
    Specified by:
      `changeSessionId` in interface `Manager`
    Parameters:
      `session` - The session to change the session ID for
      `newId` - new session ID

  - ### changeSessionId

    protected void changeSessionId(Session session, String newId, boolean notifySessionListeners, boolean notifyContainerListeners)

  - ### willAttributeDistribute

    public boolean willAttributeDistribute(String name, Object value)
    Would the Manager distribute the given session attribute? Manager implementations may provide additional configuration options to control which attributes are distributable.

    This implementation excludes session attributes from distribution if the:

    - attribute name matches `getSessionAttributeNameFilter()`
    Specified by:
      `willAttributeDistribute` in interface `Manager`
    Parameters:
      `name` - The attribute name
      `value` - The attribute value
    Returns:
      `true` if the Manager would distribute the given attribute otherwise `false`

  - ### getNewSession

    protected StandardSession getNewSession()
    Get new session class to be used in the doLoad() method.
    Returns:
      a new session for use with this manager

  - ### generateSessionId

    protected String generateSessionId()
    Generate and return a new session identifier.
    Returns:
      a new session id

  - ### getEngine

    public Engine getEngine()
    Retrieve the enclosing Engine for this Manager.
    Returns:
      an Engine object (or null).

  - ### getJvmRoute

    public String getJvmRoute()
    Retrieve the JvmRoute for the enclosing Engine.
    Returns:
      the JvmRoute or null.

  - ### setSessionCounter

    public void setSessionCounter(long sessionCounter)
    Description copied from interface: `Manager`
    Sets the total number of sessions created by this manager.
    Specified by:
      `setSessionCounter` in interface `Manager`
    Parameters:
      `sessionCounter` - Total number of sessions created by this manager.

  - ### getSessionCounter

    public long getSessionCounter()
    Description copied from interface: `Manager`
    Returns the total number of sessions created by this manager, which is approximated as the number of active sessions plus the number of expired sessions.
    Specified by:
      `getSessionCounter` in interface `Manager`
    Returns:
      Total number of sessions created by this manager.

  - ### getDuplicates

    @Deprecated public int getDuplicates()
    Deprecated.
    This will be removed in Tomcat 11
    Number of duplicated session IDs generated by the random source. Anything bigger than 0 means problems.
    Returns:
      The count of duplicates

  - ### setDuplicates

    @Deprecated public void setDuplicates(int duplicates)
    Deprecated.
    This will be removed in Tomcat 11
    Set duplicates count.
    Parameters:
      `duplicates` - the new duplicates count

  - ### getActiveSessions

    public int getActiveSessions()
    Description copied from interface: `Manager`
    Gets the number of currently active sessions.
    Specified by:
      `getActiveSessions` in interface `Manager`
    Returns:
      Number of currently active sessions

  - ### getMaxActive

    public int getMaxActive()
    Description copied from interface: `Manager`
    Gets the maximum number of sessions that have been active at the same time.
    Specified by:
      `getMaxActive` in interface `Manager`
    Returns:
      Maximum number of sessions that have been active at the same time

  - ### setMaxActive

    public void setMaxActive(int maxActive)
    Description copied from interface: `Manager`
    (Re)sets the maximum number of sessions that have been active at the same time.
    Specified by:
      `setMaxActive` in interface `Manager`
    Parameters:
      `maxActive` - Maximum number of sessions that have been active at the same time.

  - ### getMaxActiveSessions

    public int getMaxActiveSessions()
    Returns:
      The maximum number of active Sessions allowed, or -1 for no limit.

  - ### setMaxActiveSessions

    public void setMaxActiveSessions(int max)
    Set the maximum number of active Sessions allowed, or -1 for no limit.
    Parameters:
      `max` - The new maximum number of sessions

  - ### getSessionMaxAliveTime

    public int getSessionMaxAliveTime()
    Description copied from interface: `Manager`
    Gets the longest time (in seconds) that an expired session had been alive.
    Specified by:
      `getSessionMaxAliveTime` in interface `Manager`
    Returns:
      Longest time (in seconds) that an expired session had been alive.

  - ### setSessionMaxAliveTime

    public void setSessionMaxAliveTime(int sessionMaxAliveTime)
    Description copied from interface: `Manager`
    Sets the longest time (in seconds) that an expired session had been alive.
    Specified by:
      `setSessionMaxAliveTime` in interface `Manager`
    Parameters:
      `sessionMaxAliveTime` - Longest time (in seconds) that an expired session had been alive.

  - ### updateSessionMaxAliveTime

    public void updateSessionMaxAliveTime(int sessionAliveTime)
    Updates the sessionMaxAliveTime attribute if the candidate value is larger than the current value.
    Parameters:
      `sessionAliveTime` - The candidate value (in seconds) for the new sessionMaxAliveTime value.

  - ### getSessionAverageAliveTime

    public int getSessionAverageAliveTime()
    Gets the average time (in seconds) that expired sessions had been alive. This may be based on sample data.

    Based on the last 100 sessions to expire. If less than 100 sessions have expired then all available data is used.

    Specified by:
      `getSessionAverageAliveTime` in interface `Manager`
    Returns:
      Average time (in seconds) that expired sessions had been alive.

  - ### getSessionCreateRate

    public int getSessionCreateRate()
    Gets the current rate of session creation (in session per minute). This may be based on sample data.

    Based on the creation time of the previous 100 sessions created. If less than 100 sessions have been created then all available data is used.

    Specified by:
      `getSessionCreateRate` in interface `Manager`
    Returns:
      The current rate (in sessions per minute) of session creation

  - ### getSessionExpireRate

    public int getSessionExpireRate()
    Gets the current rate of session expiration (in session per minute). This may be based on sample data

    Based on the expiry time of the previous 100 sessions expired. If less than 100 sessions have expired then all available data is used.

    Specified by:
      `getSessionExpireRate` in interface `Manager`
    Returns:
      The current rate (in sessions per minute) of session expiration

  - ### listSessionIds

    public String listSessionIds()
    For debugging.
    Returns:
      A space separated list of all session IDs currently active

  - ### getSessionAttribute

    public String getSessionAttribute(String sessionId, String key)
    For debugging.
    Parameters:
      `sessionId` - The ID for the session of interest
      `key` - The key for the attribute to obtain
    Returns:
      The attribute value for the specified session, if found, null otherwise

  - ### getSession

    public HashMap<String,String> getSession(String sessionId)
    Returns information about the session with the given session id.

    The session information is organized as a HashMap, mapping session attribute names to the String representation of their values.

    Parameters:
      `sessionId` - Session id
    Returns:
      HashMap mapping session attribute names to the String representation of their values, or null if no session with the specified id exists, or if the session does not have any attributes

  - ### expireSession

    public void expireSession(String sessionId)

  - ### getThisAccessedTimestamp

    public long getThisAccessedTimestamp(String sessionId)

  - ### getThisAccessedTime

    public String getThisAccessedTime(String sessionId)

  - ### getLastAccessedTimestamp

    public long getLastAccessedTimestamp(String sessionId)

  - ### getLastAccessedTime

    public String getLastAccessedTime(String sessionId)

  - ### getCreationTime

    public String getCreationTime(String sessionId)

  - ### getCreationTimestamp

    public long getCreationTimestamp(String sessionId)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getObjectNameKeyProperties

    public String getObjectNameKeyProperties()
    Description copied from class: `LifecycleMBeanBase`
    Allow sub-classes to specify the key properties component of the `ObjectName` that will be used to register this component.
    Specified by:
      `getObjectNameKeyProperties` in class `LifecycleMBeanBase`
    Returns:
      The string representation of the key properties component of the desired `ObjectName`

  - ### getDomainInternal

    public String getDomainInternal()
    Description copied from class: `LifecycleMBeanBase`
    Method implemented by sub-classes to identify the domain in which MBeans should be registered.
    Specified by:
      `getDomainInternal` in class `LifecycleMBeanBase`
    Returns:
      The name of the domain to use to register MBeans.