blob: 753095de7acba1473214001b84ccc5b0bea7b983 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>AbstractSessionDAO (Apache Shiro 1.9.1 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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.5.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="AbstractSessionDAO (Apache Shiro 1.9.1 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":6,"i3":6,"i4":10,"i5":10,"i6":10,"i7":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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"><!-- Matomo --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ /* We explicitly disable cookie tracking to avoid privacy issues */ _paq.push(['disableCookies']); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//matomo.privacy.apache.org/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '2']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Matomo Code -->
<!-- ========= 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/AbstractSessionDAO.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 AbstractSessionDAO" class="title">Class AbstractSessionDAO</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>org.apache.shiro.session.mgt.eis.AbstractSessionDAO</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>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">CachingSessionDAO</a></code>, <code><a href="MemorySessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">MemorySessionDAO</a></code></dd>
</dl>
<hr>
<pre>public abstract class <a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.46">AbstractSessionDAO</a>
extends <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>
implements <a href="SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</a></pre>
<div class="block">An abstract <code>SessionDAO</code> implementation that performs some sanity checks on session creation and reading and
allows for pluggable Session ID generation strategies if desired. The <code>SessionDAO</code>
<a href="SessionDAO.html#update(org.apache.shiro.session.Session)"><code>update</code></a> and <a href="SessionDAO.html#delete(org.apache.shiro.session.Session)"><code>delete</code></a> methods are left to
subclasses.
<h3>Session ID Generation</h3>
This class also allows for plugging in a <a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis"><code>SessionIdGenerator</code></a> for custom ID generation strategies. This is
optional, as the default generator is probably sufficient for most cases. Subclass implementations that do use a
generator (default or custom) will want to call the
<a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a> method from within their <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a>
implementations.
<p/>
Subclass implementations that rely on the EIS data store to generate the ID automatically (e.g. when the session
ID is also an auto-generated primary key), they can simply ignore the <code>SessionIdGenerator</code> concept
entirely and just return the data store's ID from the <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a> implementation.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</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()">AbstractSessionDAO</a></span>()</code></th>
<td class="colLast">
<div class="block">Default no-arg constructor that defaults the <a href="#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><code>sessionIdGenerator</code></a> to be a
<a href="JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><code>JavaUuidSessionIdGenerator</code></a>.</div>
</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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#assignSessionId(org.apache.shiro.session.Session,java.io.Serializable)">assignSessionId</a></span>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session,
<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">Utility method available to subclasses that wish to
assign a generated session ID to the session instance directly.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><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="#create(org.apache.shiro.session.Session)">create</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">Creates the session by delegating EIS creation to subclasses via the <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a> method, and then
asserting that the returned sessionId is not null.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected abstract <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="i3" class="rowColor">
<td class="colFirst"><code>protected abstract <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="i4" class="altColor">
<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="#generateSessionId(org.apache.shiro.session.Session)">generateSessionId</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">Generates a new ID to be applied to the specified <code>session</code> instance.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSessionIdGenerator()">getSessionIdGenerator</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <code>SessionIdGenerator</code> used by the <a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a>
method.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><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="#readSession(java.io.Serializable)">readSession</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">Retrieves the Session object from the underlying EIS identified by <tt>sessionId</tt> by delegating to
the <a href="#doReadSession(java.io.Serializable)"><code>doReadSession(java.io.Serializable)</code></a> method.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)">setSessionIdGenerator</a></span>&#8203;(<a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</a>&nbsp;sessionIdGenerator)</code></th>
<td class="colLast">
<div class="block">Sets the <code>SessionIdGenerator</code> used by the <a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a>
method.</div>
</td>
</tr>
</table>
<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>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.shiro.session.mgt.eis.SessionDAO">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.shiro.session.mgt.eis.<a href="SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</a></h3>
<code><a href="SessionDAO.html#delete(org.apache.shiro.session.Session)">delete</a>, <a href="SessionDAO.html#getActiveSessions()">getActiveSessions</a>, <a href="SessionDAO.html#update(org.apache.shiro.session.Session)">update</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>AbstractSessionDAO</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.58">AbstractSessionDAO</a>()</pre>
<div class="block">Default no-arg constructor that defaults the <a href="#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><code>sessionIdGenerator</code></a> to be a
<a href="JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><code>JavaUuidSessionIdGenerator</code></a>.</div>
</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="getSessionIdGenerator()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSessionIdGenerator</h4>
<pre class="methodSignature">public&nbsp;<a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</a>&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.70">getSessionIdGenerator</a>()</pre>
<div class="block">Returns the <code>SessionIdGenerator</code> used by the <a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a>
method. Unless overridden by the <a href="#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><code>setSessionIdGenerator(SessionIdGenerator)</code></a> method, the default instance
is a <a href="JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><code>JavaUuidSessionIdGenerator</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <code>SessionIdGenerator</code> used by the <a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a>
method.</dd>
</dl>
</li>
</ul>
<a id="setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSessionIdGenerator</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.81">setSessionIdGenerator</a>&#8203;(<a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</a>&nbsp;sessionIdGenerator)</pre>
<div class="block">Sets the <code>SessionIdGenerator</code> used by the <a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a>
method. Unless overridden by this method, the default instance ss a <a href="JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><code>JavaUuidSessionIdGenerator</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sessionIdGenerator</code> - the <code>SessionIdGenerator</code> to use in the
<a href="#generateSessionId(org.apache.shiro.session.Session)"><code>generateSessionId(org.apache.shiro.session.Session)</code></a> method.</dd>
</dl>
</li>
</ul>
<a id="generateSessionId(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateSessionId</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/AbstractSessionDAO.html#line.101">generateSessionId</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block">Generates a new ID to be applied to the specified <code>session</code> instance. This method is usually called
from within a subclass's <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a> implementation where they assign the returned id to the session
instance and then create a record with this ID in the EIS data store.
<p/>
Subclass implementations backed by EIS data stores that auto-generate IDs during record creation, such as
relational databases, don't need to use this method or the <a href="#getSessionIdGenerator()"><code>sessionIdGenerator</code></a>
attribute - they can simply return the data store's generated ID from the <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a> implementation
if desired.
<p/>
This implementation uses the <a href="#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><code>configured</code></a> <a href="SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis"><code>SessionIdGenerator</code></a> to create
the ID.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - the new session instance for which an ID will be generated and then assigned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the generated ID to assign</dd>
</dl>
</li>
</ul>
<a id="create(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre class="methodSignature">public&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/AbstractSessionDAO.html#line.115">create</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block">Creates the session by delegating EIS creation to subclasses via the <a href="#doCreate(org.apache.shiro.session.Session)"><code>doCreate(org.apache.shiro.session.Session)</code></a> method, and then
asserting that the returned sessionId is not null.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SessionDAO.html#create(org.apache.shiro.session.Session)">create</a></code>&nbsp;in interface&nbsp;<code><a href="SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - Session object to create in the EIS and associate with an ID.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the EIS id (e.g. primary key) of the created <code>Session</code> object.</dd>
</dl>
</li>
</ul>
<a id="assignSessionId(org.apache.shiro.session.Session,java.io.Serializable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assignSessionId</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.145">assignSessionId</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session,
<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">Utility method available to subclasses that wish to
assign a generated session ID to the session instance directly. This method is not used by the
<code>AbstractSessionDAO</code> implementation directly, but it is provided so subclasses don't
need to know the <code>Session</code> implementation if they don't need to.
<p/>
This default implementation casts the argument to a <a href="../SimpleSession.html" title="class in org.apache.shiro.session.mgt"><code>SimpleSession</code></a>, Shiro's default EIS implementation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>session</code> - the session instance to which the sessionId will be applied</dd>
<dd><code>sessionId</code> - the id to assign to the specified session instance.</dd>
</dl>
</li>
</ul>
<a id="doCreate(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doCreate</h4>
<pre class="methodSignature">protected abstract&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/AbstractSessionDAO.html#line.156">doCreate</a>&#8203;(<a href="../../Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block">Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS.</div>
<dl>
<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="readSession(java.io.Serializable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readSession</h4>
<pre class="methodSignature">public&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/AbstractSessionDAO.html#line.167">readSession</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)
throws <a href="../../UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</a></pre>
<div class="block">Retrieves the Session object from the underlying EIS identified by <tt>sessionId</tt> by delegating to
the <a href="#doReadSession(java.io.Serializable)"><code>doReadSession(java.io.Serializable)</code></a> method. If <code>null</code> is returned from that method, an
<a href="../../UnknownSessionException.html" title="class in org.apache.shiro.session"><code>UnknownSessionException</code></a> will be thrown.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="SessionDAO.html#readSession(java.io.Serializable)">readSession</a></code>&nbsp;in interface&nbsp;<code><a href="SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sessionId</code> - the id of the session to retrieve from the EIS.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the session identified by <tt>sessionId</tt> in the EIS.</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 the id specified does not correspond to any session in the EIS.</dd>
</dl>
</li>
</ul>
<a id="doReadSession(java.io.Serializable)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>doReadSession</h4>
<pre class="methodSignature">protected abstract&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/AbstractSessionDAO.html#line.183">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">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="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>
</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/AbstractSessionDAO.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;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>