blob: ad7d79c342fd6a01c79761cf0d5bc993280fd4c7 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Fri Mar 04 17:58:56 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
DefaultSubjectDAO (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DefaultSubjectDAO (Apache Shiro 1.2.4 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DefaultSubjectDAO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectFactory.html" title="class in org.apache.shiro.mgt"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/mgt/DefaultSubjectDAO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DefaultSubjectDAO.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.mgt</FONT>
<BR>
Class DefaultSubjectDAO</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.mgt.DefaultSubjectDAO</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/apache/shiro/mgt/SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.82"><B>DefaultSubjectDAO</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="../../../../org/apache/shiro/mgt/SubjectDAO.html" title="interface in org.apache.shiro.mgt">SubjectDAO</A></DL>
</PRE>
<P>
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.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.2</DD>
<DT><B>See Also:</B><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></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#DefaultSubjectDAO()">DefaultSubjectDAO</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#delete(org.apache.shiro.subject.Subject)">delete</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes any existing subject state from the subject's session (if the session exists).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#getSessionStorageEvaluator()">getSessionStorageEvaluator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in
the Subject's session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#isSessionStorageEnabled(org.apache.shiro.subject.Subject)">isSessionStorageEnabled</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Determines if the subject's session will be used to persist subject state or not.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#mergeAuthenticationState(org.apache.shiro.subject.Subject)">mergeAuthenticationState</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Merges the Subject's current authentication state with whatever may be in
any available session.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#mergePrincipals(org.apache.shiro.subject.Subject)">mergePrincipals</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#removeFromSession(org.apache.shiro.subject.Subject)">removeFromSession</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes any existing subject state from the Subject's session (if the session exists).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#save(org.apache.shiro.subject.Subject)">save</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#saveToSession(org.apache.shiro.subject.Subject)">saveToSession</A></B>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectDAO.html#setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)">setSessionStorageEvaluator</A></B>(<A HREF="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</A>&nbsp;sessionStorageEvaluator)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in
the Subject's session.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.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="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.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="http://java.sun.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></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="DefaultSubjectDAO()"><!-- --></A><H3>
DefaultSubjectDAO</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.91"><B>DefaultSubjectDAO</B></A>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="isSessionStorageEnabled(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
isSessionStorageEnabled</H3>
<PRE>
protected boolean <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.107"><B>isSessionStorageEnabled</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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).
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the subject to inspect to determine if the subject's session will be used to persist subject
state or not.
<DT><B>Returns:</B><DD><code>true</code> if the subject's session will be used to persist subject state, <code>false</code> otherwise.<DT><B>See Also:</B><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></DL>
</DD>
</DL>
<HR>
<A NAME="getSessionStorageEvaluator()"><!-- --></A><H3>
getSessionStorageEvaluator</H3>
<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.119"><B>getSessionStorageEvaluator</B></A>()</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>SessionStorageEvaluator</code> that will determine if a <code>Subject</code>'s state may be persisted in
the Subject's session.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><CODE>DefaultSessionStorageEvaluator</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setSessionStorageEvaluator(org.apache.shiro.mgt.SessionStorageEvaluator)"><!-- --></A><H3>
setSessionStorageEvaluator</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.131"><B>setSessionStorageEvaluator</B></A>(<A HREF="../../../../org/apache/shiro/mgt/SessionStorageEvaluator.html" title="interface in org.apache.shiro.mgt">SessionStorageEvaluator</A>&nbsp;sessionStorageEvaluator)</PRE>
<DL>
<DD>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>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><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.<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><CODE>DefaultSessionStorageEvaluator</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="save(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
save</H3>
<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.145"><B>save</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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).
<P>
<DD><DL>
<DT><B>Specified by:</B><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></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the Subject instance for which its state will be created or updated.
<DT><B>Returns:</B><DD>the same <code>Subject</code> passed in (a new Subject instance is not created).</DL>
</DD>
</DL>
<HR>
<A NAME="saveToSession(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
saveToSession</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.164"><B>saveToSession</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the subject for which state will be persisted to its session.</DL>
</DD>
</DL>
<HR>
<A NAME="mergePrincipals(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
mergePrincipals</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.177"><B>mergePrincipals</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the Subject for which principals will potentially be merged into the Subject's session.</DL>
</DD>
</DL>
<HR>
<A NAME="mergeAuthenticationState(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
mergeAuthenticationState</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.233"><B>mergeAuthenticationState</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the Subject for which principals will potentially be merged into the Subject's session.</DL>
</DD>
</DL>
<HR>
<A NAME="removeFromSession(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
removeFromSession</H3>
<PRE>
protected void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.267"><B>removeFromSession</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the subject for which any existing subject state will be removed from its session.</DL>
</DD>
</DL>
<HR>
<A NAME="delete(org.apache.shiro.subject.Subject)"><!-- --></A><H3>
delete</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/mgt/DefaultSubjectDAO.html#line.280"><B>delete</B></A>(<A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</A>&nbsp;subject)</PRE>
<DL>
<DD>Removes any existing subject state from the subject's session (if the session exists).
<P>
<DD><DL>
<DT><B>Specified by:</B><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></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - the Subject instance for which any persistent state should be deleted.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DefaultSubjectDAO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/mgt/DefaultSessionStorageEvaluator.html" title="class in org.apache.shiro.mgt"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/shiro/mgt/DefaultSubjectFactory.html" title="class in org.apache.shiro.mgt"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/mgt/DefaultSubjectDAO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DefaultSubjectDAO.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>