blob: 3065f7a7c319effd9e6c28b3ca1c3047f1356d46 [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 Tue Feb 25 18:15:50 EST 2014 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
AbstractSessionDAO (Apache Shiro 1.2.3 API)
</TITLE>
<META NAME="date" CONTENT="2014-02-25">
<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="AbstractSessionDAO (Apache Shiro 1.2.3 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/AbstractSessionDAO.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AbstractSessionDAO.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.session.mgt.eis</FONT>
<BR>
Class AbstractSessionDAO</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.session.mgt.eis.AbstractSessionDAO</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">CachingSessionDAO</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/MemorySessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">MemorySessionDAO</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.46"><B>AbstractSessionDAO</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/session/mgt/eis/SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</A></DL>
</PRE>
<P>
An abstract <code>SessionDAO</code> implementation that performs some sanity checks on session creation and reading and
allows for pluggable Session ID generation strategies if desired. The <code>SessionDAO</code>
<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#update(org.apache.shiro.session.Session)"><CODE>update</CODE></A> and <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#delete(org.apache.shiro.session.Session)"><CODE>delete</CODE></A> methods are left to
subclasses.
<h3>Session ID Generation</h3>
This class also allows for plugging in a <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis"><CODE>SessionIdGenerator</CODE></A> for custom ID generation strategies. This is
optional, as the default generator is probably sufficient for most cases. Subclass implementations that do use a
generator (default or custom) will want to call the
<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A> method from within their <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A>
implementations.
<p/>
Subclass implementations that rely on the EIS data store to generate the ID automatically (e.g. when the session
ID is also an auto-generated primary key), they can simply ignore the <code>SessionIdGenerator</code> concept
entirely and just return the data store's ID from the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A> implementation.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>1.0</DD>
</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/session/mgt/eis/AbstractSessionDAO.html#AbstractSessionDAO()">AbstractSessionDAO</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default no-arg constructor that defaults the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><CODE>sessionIdGenerator</CODE></A> to be a
<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>JavaUuidSessionIdGenerator</CODE></A>.</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>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#assignSessionId(org.apache.shiro.session.Session, java.io.Serializable)">assignSessionId</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session,
<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Utility method available to subclasses that wish to
assign a generated session ID to the session instance directly.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#create(org.apache.shiro.session.Session)">create</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates the session by delegating EIS creation to subclasses via the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A> method, and then
asserting that the returned sessionId is not null.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)">doCreate</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract &nbsp;<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doReadSession(java.io.Serializable)">doReadSession</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Subclass implementation hook that retrieves the Session object from the underlying EIS or <code>null</code> if a
session with that ID could not be found.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)">generateSessionId</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generates a new ID to be applied to the specified <code>session</code> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#getSessionIdGenerator()">getSessionIdGenerator</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>SessionIdGenerator</code> used by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A>
method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#readSession(java.io.Serializable)">readSession</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the Session object from the underlying EIS identified by <tt>sessionId</tt> by delegating to
the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doReadSession(java.io.Serializable)"><CODE>doReadSession(java.io.Serializable)</CODE></A> method.</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/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)">setSessionIdGenerator</A></B>(<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</A>&nbsp;sessionIdGenerator)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the <code>SessionIdGenerator</code> used by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A>
method.</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;<A NAME="methods_inherited_from_class_org.apache.shiro.session.mgt.eis.SessionDAO"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface org.apache.shiro.session.mgt.eis.<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#delete(org.apache.shiro.session.Session)">delete</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#getActiveSessions()">getActiveSessions</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#update(org.apache.shiro.session.Session)">update</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="AbstractSessionDAO()"><!-- --></A><H3>
AbstractSessionDAO</H3>
<PRE>
public <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.58"><B>AbstractSessionDAO</B></A>()</PRE>
<DL>
<DD>Default no-arg constructor that defaults the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><CODE>sessionIdGenerator</CODE></A> to be a
<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>JavaUuidSessionIdGenerator</CODE></A>.
<P>
</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="getSessionIdGenerator()"><!-- --></A><H3>
getSessionIdGenerator</H3>
<PRE>
public <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.70"><B>getSessionIdGenerator</B></A>()</PRE>
<DL>
<DD>Returns the <code>SessionIdGenerator</code> used by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A>
method. Unless overridden by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><CODE>setSessionIdGenerator(SessionIdGenerator)</CODE></A> method, the default instance
is a <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>JavaUuidSessionIdGenerator</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the <code>SessionIdGenerator</code> used by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A>
method.</DL>
</DD>
</DL>
<HR>
<A NAME="setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><!-- --></A><H3>
setSessionIdGenerator</H3>
<PRE>
public void <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.81"><B>setSessionIdGenerator</B></A>(<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis">SessionIdGenerator</A>&nbsp;sessionIdGenerator)</PRE>
<DL>
<DD>Sets the <code>SessionIdGenerator</code> used by the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A>
method. Unless overridden by this method, the default instance ss a <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>JavaUuidSessionIdGenerator</CODE></A>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sessionIdGenerator</CODE> - the <code>SessionIdGenerator</code> to use in the
<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)"><CODE>generateSessionId(org.apache.shiro.session.Session)</CODE></A> method.</DL>
</DD>
</DL>
<HR>
<A NAME="generateSessionId(org.apache.shiro.session.Session)"><!-- --></A><H3>
generateSessionId</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.101"><B>generateSessionId</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</PRE>
<DL>
<DD>Generates a new ID to be applied to the specified <code>session</code> instance. This method is usually called
from within a subclass's <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A> implementation where they assign the returned id to the session
instance and then create a record with this ID in the EIS data store.
<p/>
Subclass implementations backed by EIS data stores that auto-generate IDs during record creation, such as
relational databases, don't need to use this method or the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#getSessionIdGenerator()"><CODE>sessionIdGenerator</CODE></A>
attribute - they can simply return the data store's generated ID from the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A> implementation
if desired.
<p/>
This implementation uses the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)"><CODE>configured</CODE></A> <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionIdGenerator.html" title="interface in org.apache.shiro.session.mgt.eis"><CODE>SessionIdGenerator</CODE></A> to create
the ID.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - the new session instance for which an ID will be generated and then assigned
<DT><B>Returns:</B><DD>the generated ID to assign</DL>
</DD>
</DL>
<HR>
<A NAME="create(org.apache.shiro.session.Session)"><!-- --></A><H3>
create</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.115"><B>create</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</PRE>
<DL>
<DD>Creates the session by delegating EIS creation to subclasses via the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)"><CODE>doCreate(org.apache.shiro.session.Session)</CODE></A> method, and then
asserting that the returned sessionId is not null.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#create(org.apache.shiro.session.Session)">create</A></CODE> in interface <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - Session object to create in the EIS and associate with an ID.
<DT><B>Returns:</B><DD>the EIS id (e.g. primary key) of the created <code>Session</code> object.</DL>
</DD>
</DL>
<HR>
<A NAME="assignSessionId(org.apache.shiro.session.Session, java.io.Serializable)"><!-- --></A><H3>
assignSessionId</H3>
<PRE>
protected void <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.145"><B>assignSessionId</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session,
<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)</PRE>
<DL>
<DD>Utility method available to subclasses that wish to
assign a generated session ID to the session instance directly. This method is not used by the
<code>AbstractSessionDAO</code> implementation directly, but it is provided so subclasses don't
need to know the <code>Session</code> implementation if they don't need to.
<p/>
This default implementation casts the argument to a <A HREF="../../../../../../org/apache/shiro/session/mgt/SimpleSession.html" title="class in org.apache.shiro.session.mgt"><CODE>SimpleSession</CODE></A>, Shiro's default EIS implementation.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - the session instance to which the sessionId will be applied<DD><CODE>sessionId</CODE> - the id to assign to the specified session instance.</DL>
</DD>
</DL>
<HR>
<A NAME="doCreate(org.apache.shiro.session.Session)"><!-- --></A><H3>
doCreate</H3>
<PRE>
protected abstract <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.156"><B>doCreate</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A>&nbsp;session)</PRE>
<DL>
<DD>Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - the Session instance to persist to the EIS.
<DT><B>Returns:</B><DD>the id of the session created in the EIS (i.e. this is almost always a primary key and should be the
value returned from <A HREF="../../../../../../org/apache/shiro/session/Session.html#getId()"><CODE>Session.getId()</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="readSession(java.io.Serializable)"><!-- --></A><H3>
readSession</H3>
<PRE>
public <A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.167"><B>readSession</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)
throws <A HREF="../../../../../../org/apache/shiro/session/UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</A></PRE>
<DL>
<DD>Retrieves the Session object from the underlying EIS identified by <tt>sessionId</tt> by delegating to
the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doReadSession(java.io.Serializable)"><CODE>doReadSession(java.io.Serializable)</CODE></A> method. If <code>null</code> is returned from that method, an
<A HREF="../../../../../../org/apache/shiro/session/UnknownSessionException.html" title="class in org.apache.shiro.session"><CODE>UnknownSessionException</CODE></A> will be thrown.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#readSession(java.io.Serializable)">readSession</A></CODE> in interface <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html" title="interface in org.apache.shiro.session.mgt.eis">SessionDAO</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sessionId</CODE> - the id of the session to retrieve from the EIS.
<DT><B>Returns:</B><DD>the session identified by <tt>sessionId</tt> in the EIS.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../../org/apache/shiro/session/UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</A></CODE> - if the id specified does not correspond to any session in the EIS.</DL>
</DD>
</DL>
<HR>
<A NAME="doReadSession(java.io.Serializable)"><!-- --></A><H3>
doReadSession</H3>
<PRE>
protected abstract <A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#line.183"><B>doReadSession</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>&nbsp;sessionId)</PRE>
<DL>
<DD>Subclass implementation hook that retrieves the Session object from the underlying EIS or <code>null</code> if a
session with that ID could not be found.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>sessionId</CODE> - the id of the <tt>Session</tt> to retrieve.
<DT><B>Returns:</B><DD>the Session in the EIS identified by <tt>sessionId</tt> or <code>null</code> if a
session with that ID could not be found.</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/AbstractSessionDAO.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="AbstractSessionDAO.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-2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>