blob: 906f2f2c4ef051f0384b0ddb4eba9aae07db51bf [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.6) on Mon Mar 23 13:34:45 EDT 2020 -->
<title>MemorySessionDAO (Apache Shiro :: Core 1.5.2 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-03-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MemorySessionDAO (Apache Shiro :: Core 1.5.2 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MemorySessionDAO.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.shiro.session.mgt.eis</a></div>
<h2 title="Class MemorySessionDAO" class="title">Class MemorySessionDAO</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">org.apache.shiro.session.mgt.eis.AbstractSessionDAO</a></li>
<li>
<ul class="inheritance">
<li>org.apache.shiro.session.mgt.eis.MemorySessionDAO</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</a></code></dd>
</dl>
<hr>
<pre>public class <a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.56">MemorySessionDAO</a>
extends <a href="AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</a></pre>
<div class="block">Simple memory-based implementation of the SessionDAO that stores all of its sessions in an in-memory
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent" class="externalLink"><code>ConcurrentMap</code></a>. <b>This implementation does not page to disk and is therefore unsuitable for applications
that could experience a large amount of sessions</b> and would therefore cause <code>OutOfMemoryException</code>s. It is
<em>not</em> recommended for production use in most environments.
<h2>Memory Restrictions</h2>
If your application is expected to host many sessions beyond what can be stored in the
memory available to the JVM, it is highly recommended to use a different <code>SessionDAO</code> implementation which
uses a more expansive or permanent backing data store.
<p/>
In this case, it is recommended to instead use a custom
<a href="CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><code>CachingSessionDAO</code></a> implementation that communicates with a higher-capacity data store of your choice
(file system, database, etc).
<h2>Changes in 1.0</h2>
This implementation prior to 1.0 used to subclass the <a href="CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><code>CachingSessionDAO</code></a>, but this caused problems with many
cache implementations that would expunge entries due to TTL settings, resulting in Sessions that would be randomly
(and permanently) lost. The Shiro 1.0 release refactored this implementation to be 100% memory-based (without
<code>Cache</code> usage to avoid this problem.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>0.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><code>CachingSessionDAO</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">MemorySessionDAO</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#delete(org.apache.shiro.session.Session)">delete</a></span>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</code></th>
<td class="colLast">
<div class="block">Deletes the associated EIS record of the specified <code>session</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doCreate(org.apache.shiro.session.Session)">doCreate</a></span>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</code></th>
<td class="colLast">
<div class="block">Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected <a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#doReadSession(java.io.Serializable)">doReadSession</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>&nbsp;sessionId)</code></th>
<td class="colLast">
<div class="block">Subclass implementation hook that retrieves the Session object from the underlying EIS or <code>null</code> if a
session with that ID could not be found.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getActiveSessions()">getActiveSessions</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns all sessions in the EIS that are considered active, meaning all sessions that
haven't been stopped/expired.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected <a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#storeSession(java.io.Serializable,org.apache.shiro.session.Session)">storeSession</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>&nbsp;id,
<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(org.apache.shiro.session.Session)">update</a></span>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</code></th>
<td class="colLast">
<div class="block">Updates (persists) data from a previously created Session instance in the EIS identified by
<code>{@link Session#getId() session.getId()}</code>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.shiro.session.mgt.eis.AbstractSessionDAO">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.shiro.session.mgt.eis.<a href="AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</a></h3>
<code><a href="AbstractSessionDAO.html#assignSessionId(org.apache.shiro.session.Session,java.io.Serializable)">assignSessionId</a>, <a href="AbstractSessionDAO.html#create(org.apache.shiro.session.Session)">create</a>, <a href="AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)">generateSessionId</a>, <a href="AbstractSessionDAO.html#getSessionIdGenerator()">getSessionIdGenerator</a>, <a href="AbstractSessionDAO.html#readSession(java.io.Serializable)">readSession</a>, <a href="AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)">setSessionIdGenerator</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>MemorySessionDAO</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.62">MemorySessionDAO</a>()</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="doCreate(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doCreate</h4>
<pre class="methodSignature">protected&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.66">doCreate</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)">AbstractSessionDAO</a></code></span></div>
<div class="block">Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)">doCreate</a></code>&nbsp;in class&nbsp;<code><a href="AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - the Session instance to persist to the EIS.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the id of the session created in the EIS (i.e. this is almost always a primary key and should be the
value returned from <a href="../../Session.html#getId()"><code>Session.getId()</code></a>.</dd>
</dl>
</li>
</ul>
<a id="storeSession(java.io.Serializable,org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>storeSession</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.73">storeSession</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>&nbsp;id,
<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
</li>
</ul>
<a id="doReadSession(java.io.Serializable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doReadSession</h4>
<pre class="methodSignature">protected&nbsp;<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.80">doReadSession</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a>&nbsp;sessionId)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="AbstractSessionDAO.html#doReadSession(java.io.Serializable)">AbstractSessionDAO</a></code></span></div>
<div class="block">Subclass implementation hook that retrieves the Session object from the underlying EIS or <code>null</code> if a
session with that ID could not be found.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="AbstractSessionDAO.html#doReadSession(java.io.Serializable)">doReadSession</a></code>&nbsp;in class&nbsp;<code><a href="AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sessionId</code> - the id of the <tt>Session</tt> to retrieve.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Session in the EIS identified by <tt>sessionId</tt> or <code>null</code> if a
session with that ID could not be found.</dd>
</dl>
</li>
</ul>
<a id="update(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.84">update</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)
throws <a href="../../UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="SessionDAO.html#update(org.apache.shiro.session.Session)">SessionDAO</a></code></span></div>
<div class="block">Updates (persists) data from a previously created Session instance in the EIS identified by
<code>{@link Session#getId() session.getId()}</code>. This effectively propagates
the data in the argument to the EIS record previously saved.
<p/>
In addition to UnknownSessionException, implementations are free to throw any other
exceptions that might occur due to integrity violation constraints or other EIS related
errors.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - the Session to update</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</a></code> - if no existing EIS session record exists with the
identifier of <a href="../../Session.html#getId()"><code>session.getSessionId()</code></a></dd>
</dl>
</li>
</ul>
<a id="delete(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>delete</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.88">delete</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="SessionDAO.html#delete(org.apache.shiro.session.Session)">SessionDAO</a></code></span></div>
<div class="block">Deletes the associated EIS record of the specified <code>session</code>. If there never
existed a session EIS record with the identifier of
<a href="../../Session.html#getId()"><code>session.getId()</code></a>, then this method does nothing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - the session to delete.</dd>
</dl>
</li>
</ul>
<a id="getActiveSessions()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getActiveSessions</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a>&lt;<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&gt;&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.98">getActiveSessions</a>()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="SessionDAO.html#getActiveSessions()">SessionDAO</a></code></span></div>
<div class="block">Returns all sessions in the EIS that are considered active, meaning all sessions that
haven't been stopped/expired. This is primarily used to validate potential orphans.
<p/>
If there are no active sessions in the EIS, this method may return an empty collection or <code>null</code>.
<h4>Performance</h4>
This method should be as efficient as possible, especially in larger systems where there might be
thousands of active sessions. Large scale/high performance
implementations will often return a subset of the total active sessions and perform validation a little more
frequently, rather than return a massive set and validate infrequently. If efficient and possible, it would
make sense to return the oldest unstopped sessions available, ordered by
<a href="../../Session.html#getLastAccessTime()"><code>lastAccessTime</code></a>.
<h4>Smart Results</h4>
<em>Ideally</em> this method would only return active sessions that the EIS was certain should be invalided.
Typically that is any session that is not stopped and where its lastAccessTimestamp is older than the session
timeout.
<p/>
For example, if sessions were backed by a relational database or SQL-92 'query-able' enterprise cache, you might
return something similar to the results returned by this query (assuming
<a href="../SimpleSession.html" title="class in org.apache.shiro.session.mgt"><code>SimpleSession</code></a>s were being stored):
<pre>
select * from sessions s where s.lastAccessTimestamp < ? and s.stopTimestamp is null
</pre>
where the <code>?</code> parameter is a date instance equal to 'now' minus the session timeout
(e.g. now - 30 minutes).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Collection of <code>Session</code>s that are considered active, or an
empty collection or <code>null</code> if there are no active sessions.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MemorySessionDAO.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2004&#x2013;2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>