| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>DefaultSubjectDAO (Apache Shiro 1.10.0 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="DefaultSubjectDAO (Apache Shiro 1.10.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":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"><!-- 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/DefaultSubjectDAO.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 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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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"> </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> <a href="package-summary.html">org.apache.shiro.mgt</a></div> |
| <h2 title="Class DefaultSubjectDAO" class="title">Class DefaultSubjectDAO</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.mgt.DefaultSubjectDAO</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public class <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.81">DefaultSubjectDAO</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="SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</a></pre> |
| <div class="block">Default <code>SubjectDAO</code> implementation that stores Subject state in the Subject's Session by default (but this |
| can be disabled - see below). The Subject instance |
| can be re-created at a later time by first acquiring the associated Session (typically from a |
| <a href="../session/mgt/SessionManager.html" title="interface in org.apache.shiro.session.mgt"><code>SessionManager</code></a>) via a session ID or session key and then |
| building a <code>Subject</code> instance from <code>Session</code> attributes. |
| <h2>Controlling how Sessions are used</h2> |
| Whether or not a <code>Subject</code>'s <code>Session</code> is used or not to persist its own state is controlled on a |
| <em>per-Subject</em> basis as determined by the configured |
| <a href="#setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)"><code>sessionStorageEvaluator</code></a>. |
| The default <code>Evaluator</code> is a <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a>, which supports enabling or disabling |
| session usage for Subject persistence at a global level for all subjects (and defaults to allowing sessions to be |
| used). |
| <h3>Disabling Session Persistence Entirely</h3> |
| Because the default <code>SessionStorageEvaluator</code> instance is a <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a>, you |
| can disable Session usage for Subject state entirely by configuring that instance directly, e.g.: |
| <pre> |
| ((DefaultSessionStorageEvaluator)sessionDAO.getSessionStorageEvaluator()).setSessionStorageEnabled(false); |
| </pre> |
| or, for example, in <code>shiro.ini</code>: |
| <pre> |
| securityManager.subjectDAO.sessionStorageEvaluator.sessionStorageEnabled = false |
| </pre> |
| but <b>note:</b> ONLY do this your |
| application is 100% stateless and you <em>DO NOT</em> need subjects to be remembered across remote |
| invocations, or in a web environment across HTTP requests. |
| <h3>Supporting Both Stateful and Stateless Subject paradigms</h3> |
| Perhaps your application needs to support a hybrid approach of both stateful and stateless Subjects: |
| <ul> |
| <li>Stateful: Stateful subjects might represent web end-users that need their identity and authentication |
| state to be remembered from page to page.</li> |
| <li>Stateless: Stateless subjects might represent API clients (e.g. REST clients) that authenticate on every |
| request, and therefore don't need authentication state to be stored across requests in a session.</li> |
| </ul> |
| To support the hybrid <em>per-Subject</em> approach, you will need to create your own implementation of the |
| <a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt"><code>SessionStorageEvaluator</code></a> interface and configure it via the |
| <a href="#setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)"><code>setSessionStorageEvaluator(SessionStorageEvaluator)</code></a> method, or, with <code>shiro.ini</code>: |
| <pre> |
| myEvaluator = com.my.CustomSessionStorageEvaluator |
| securityManager.subjectDAO.sessionStorageEvaluator = $myEvaluator |
| </pre> |
| <p/> |
| Unless overridden, the default evaluator is a <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a>, which enables session usage for |
| Subject state by default.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.2</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#isSessionStorageEnabled(org.apache.shiro.subject.Subject)"><code>isSessionStorageEnabled(org.apache.shiro.subject.Subject)</code></a>, |
| <a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt"><code>SessionStorageEvaluator</code></a>, |
| <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</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"> </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()">DefaultSubjectDAO</a></span>()</code></th> |
| <td class="colLast"> </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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </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.subject.Subject)">delete</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Removes any existing subject state from the subject's session (if the session exists).</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSessionStorageEvaluator()">getSessionStorageEvaluator</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in |
| the Subject's session.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSessionStorageEnabled(org.apache.shiro.subject.Subject)">isSessionStorageEnabled</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Determines if the subject's session will be used to persist subject state or not.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mergeAuthenticationState(org.apache.shiro.subject.Subject)">mergeAuthenticationState</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Merges the Subject's current authentication state with whatever may be in |
| any available session.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mergePrincipals(org.apache.shiro.subject.Subject)">mergePrincipals</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Merges the Subject's current <a href="../subject/Subject.html#getPrincipals()"><code>Subject.getPrincipals()</code></a> with whatever may be in |
| any available session.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeFromSession(org.apache.shiro.subject.Subject)">removeFromSession</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Removes any existing subject state from the Subject's session (if the session exists).</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code><a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#save(org.apache.shiro.subject.Subject)">save</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Saves the subject's state to the subject's <a href="../subject/Subject.html#getSession()"><code>session</code></a> only |
| if <a href="#isSessionStorageEnabled(org.apache.shiro.subject.Subject)"><code>sessionStorageEnabled(subject)</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#saveToSession(org.apache.shiro.subject.Subject)">saveToSession</a></span>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code></th> |
| <td class="colLast"> |
| <div class="block">Saves the subject's state (it's principals and authentication state) to its |
| <a href="../subject/Subject.html#getSession()"><code>session</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)">setSessionStorageEvaluator</a></span>​(<a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a> sessionStorageEvaluator)</code></th> |
| <td class="colLast"> |
| <div class="block">Sets the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in |
| the Subject's session.</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 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="<init>()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DefaultSubjectDAO</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.90">DefaultSubjectDAO</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="isSessionStorageEnabled(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSessionStorageEnabled</h4> |
| <pre class="methodSignature">protected boolean <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.106">isSessionStorageEnabled</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Determines if the subject's session will be used to persist subject state or not. This implementation |
| merely delegates to the internal <a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt"><code>SessionStorageEvaluator</code></a> (a |
| <code>DefaultSessionStorageEvaluator</code> by default).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the subject to inspect to determine if the subject's session will be used to persist subject |
| state or not.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the subject's session will be used to persist subject state, <code>false</code> otherwise.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)"><code>setSessionStorageEvaluator(SessionStorageEvaluator)</code></a>, |
| <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getSessionStorageEvaluator()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSessionStorageEvaluator</h4> |
| <pre class="methodSignature">public <a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a> <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.118">getSessionStorageEvaluator</a>()</pre> |
| <div class="block">Returns the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in |
| the Subject's session. The default instance is a <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in |
| the Subject's session.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setSessionStorageEvaluator</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.130">setSessionStorageEvaluator</a>​(<a href="SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a> sessionStorageEvaluator)</pre> |
| <div class="block">Sets the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in |
| the Subject's session. The default instance is a <a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>sessionStorageEvaluator</code> - the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s |
| state may be persisted in the Subject's session.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="save(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>save</h4> |
| <pre class="methodSignature">public <a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.144">save</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Saves the subject's state to the subject's <a href="../subject/Subject.html#getSession()"><code>session</code></a> only |
| if <a href="#isSessionStorageEnabled(org.apache.shiro.subject.Subject)"><code>sessionStorageEnabled(subject)</code></a>. If session storage is not enabled |
| for the specific <code>Subject</code>, this method does nothing. |
| <p/> |
| In either case, the argument <code>Subject</code> is returned directly (a new Subject instance is not created).</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="SubjectDAO.html#save(org.apache.shiro.subject.Subject)">save</a></code> in interface <code><a href="SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the Subject instance for which its state will be created or updated.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the same <code>Subject</code> passed in (a new Subject instance is not created).</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="saveToSession(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>saveToSession</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.163">saveToSession</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Saves the subject's state (it's principals and authentication state) to its |
| <a href="../subject/Subject.html#getSession()"><code>session</code></a>. The session can be retrieved at a later time |
| (typically from a <a href="../session/mgt/SessionManager.html" title="interface in org.apache.shiro.session.mgt"><code>SessionManager</code></a> to be used to recreate |
| the <code>Subject</code> instance.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the subject for which state will be persisted to its session.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="mergePrincipals(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mergePrincipals</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.180">mergePrincipals</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Merges the Subject's current <a href="../subject/Subject.html#getPrincipals()"><code>Subject.getPrincipals()</code></a> with whatever may be in |
| any available session. Only updates the Subject's session if the session does not match the current principals |
| state.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the Subject for which principals will potentially be merged into the Subject's session.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="mergeAuthenticationState(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mergeAuthenticationState</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.236">mergeAuthenticationState</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Merges the Subject's current authentication state with whatever may be in |
| any available session. Only updates the Subject's session if the session does not match the current |
| authentication state.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the Subject for which principals will potentially be merged into the Subject's session.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="removeFromSession(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeFromSession</h4> |
| <pre class="methodSignature">protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.270">removeFromSession</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Removes any existing subject state from the Subject's session (if the session exists). If the session |
| does not exist, this method does not do anything.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the subject for which any existing subject state will be removed from its session.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="delete(org.apache.shiro.subject.Subject)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>delete</h4> |
| <pre class="methodSignature">public void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.283">delete</a>​(<a href="../subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Removes any existing subject state from the subject's session (if the session exists).</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="SubjectDAO.html#delete(org.apache.shiro.subject.Subject)">delete</a></code> in interface <code><a href="SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>subject</code> - the Subject instance for which any persistent state should be deleted.</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/DefaultSubjectDAO.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 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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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 © 2004–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |