| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="fr"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_201) on Sat Feb 22 18:53:12 CET 2020 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>DefaultSubjectDAO (Apache Shiro :: Core 1.5.1 API)</title> |
| <meta name="date" content="2020-02-22"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="DefaultSubjectDAO (Apache Shiro :: Core 1.5.1 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"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"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.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"> |
| <li><a href="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/mgt/DefaultSubjectFactory.html" title="class in org.apache.shiro.mgt"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/mgt/DefaultSubjectDAO.html" target="_top">Frames</a></li> |
| <li><a href="DefaultSubjectDAO.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></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> |
| </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 name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.shiro.mgt</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/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">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><a href="../../../../org/apache/shiro/mgt/SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <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/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> |
| implements <a href="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/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="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#setSessionStorageEvaluator-org.apache.shiro.mgt.SessionStorageEvaluator-"><code>sessionStorageEvaluator</code></a>. |
| The default <code>Evaluator</code> is a <a href="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt"><code>SessionStorageEvaluator</code></a> interface and configure it via the |
| <a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#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="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#isSessionStorageEnabled-org.apache.shiro.subject.Subject-"><code>isSessionStorageEnabled(org.apache.shiro.subject.Subject)</code></a>, |
| <a href="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt"><code>SessionStorageEvaluator</code></a>, |
| <a href="../../../../org/apache/shiro/mgt/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 ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#DefaultSubjectDAO--">DefaultSubjectDAO</a></span>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <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="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#delete-org.apache.shiro.subject.Subject-">delete</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <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="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#getSessionStorageEvaluator--">getSessionStorageEvaluator</a></span>()</code> |
| <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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#isSessionStorageEnabled-org.apache.shiro.subject.Subject-">isSessionStorageEnabled</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#mergeAuthenticationState-org.apache.shiro.subject.Subject-">mergeAuthenticationState</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#mergePrincipals-org.apache.shiro.subject.Subject-">mergePrincipals</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <div class="block">Merges the Subject's current <a href="../../../../org/apache/shiro/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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#removeFromSession-org.apache.shiro.subject.Subject-">removeFromSession</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <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="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#save-org.apache.shiro.subject.Subject-">save</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <div class="block">Saves the subject's state to the subject's <a href="../../../../org/apache/shiro/subject/Subject.html#getSession--"><code>session</code></a> only |
| if <a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#saveToSession-org.apache.shiro.subject.Subject-">saveToSession</a></span>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</code> |
| <div class="block">Saves the subject's state (it's principals and authentication state) to its |
| <a href="../../../../org/apache/shiro/subject/Subject.html#getSession--"><code>session</code></a>.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#setSessionStorageEvaluator-org.apache.shiro.mgt.SessionStorageEvaluator-">setSessionStorageEvaluator</a></span>(<a href="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</a> sessionStorageEvaluator)</code> |
| <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 name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="DefaultSubjectDAO--"> |
| <!-- --> |
| </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> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="isSessionStorageEnabled-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSessionStorageEnabled</h4> |
| <pre>protected boolean <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.106">isSessionStorageEnabled</a>(<a href="../../../../org/apache/shiro/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="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#setSessionStorageEvaluator-org.apache.shiro.mgt.SessionStorageEvaluator-"><code>setSessionStorageEvaluator(SessionStorageEvaluator)</code></a>, |
| <a href="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSessionStorageEvaluator--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSessionStorageEvaluator</h4> |
| <pre>public <a href="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setSessionStorageEvaluator-org.apache.shiro.mgt.SessionStorageEvaluator-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setSessionStorageEvaluator</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.130">setSessionStorageEvaluator</a>(<a href="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/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="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><code>DefaultSessionStorageEvaluator</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="save-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>save</h4> |
| <pre>public <a href="../../../../org/apache/shiro/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="../../../../org/apache/shiro/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="../../../../org/apache/shiro/subject/Subject.html#getSession--"><code>session</code></a> only |
| if <a href="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#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="../../../../org/apache/shiro/mgt/SubjectDAO.html#save-org.apache.shiro.subject.Subject-">save</a></code> in interface <code><a href="../../../../org/apache/shiro/mgt/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 name="saveToSession-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>saveToSession</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.163">saveToSession</a>(<a href="../../../../org/apache/shiro/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="../../../../org/apache/shiro/subject/Subject.html#getSession--"><code>session</code></a>. The session can be retrieved at a later time |
| (typically from a <a href="../../../../org/apache/shiro/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 name="mergePrincipals-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mergePrincipals</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.180">mergePrincipals</a>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a> subject)</pre> |
| <div class="block">Merges the Subject's current <a href="../../../../org/apache/shiro/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 name="mergeAuthenticationState-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mergeAuthenticationState</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.236">mergeAuthenticationState</a>(<a href="../../../../org/apache/shiro/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 name="removeFromSession-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeFromSession</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.270">removeFromSession</a>(<a href="../../../../org/apache/shiro/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 name="delete-org.apache.shiro.subject.Subject-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>delete</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.283">delete</a>(<a href="../../../../org/apache/shiro/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="../../../../org/apache/shiro/mgt/SubjectDAO.html#delete-org.apache.shiro.subject.Subject-">delete</a></code> in interface <code><a href="../../../../org/apache/shiro/mgt/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> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.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"> |
| <li><a href="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/mgt/DefaultSubjectFactory.html" title="class in org.apache.shiro.mgt"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/mgt/DefaultSubjectDAO.html" target="_top">Frames</a></li> |
| <li><a href="DefaultSubjectDAO.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.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> |
| </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 name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2004–2020 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |