| <!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> |
| MemorySessionDAO (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="MemorySessionDAO (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> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemorySessionDAO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><B>PREV CLASS</B></A> |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/RandomSessionIdGenerator.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/MemorySessionDAO.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="MemorySessionDAO.html" target="_top"><B>NO FRAMES</B></A> |
| <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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 MemorySessionDAO</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 "><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">org.apache.shiro.session.mgt.eis.AbstractSessionDAO</A> |
| <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.session.mgt.eis.MemorySessionDAO</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> |
| <HR> |
| <DL> |
| <DT><PRE>public class <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.56"><B>MemorySessionDAO</B></A><DT>extends <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</A></DL> |
| </PRE> |
| |
| <P> |
| Simple memory-based implementation of the SessionDAO that stores all of its sessions in an in-memory |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentMap.html?is-external=true" title="class or interface in java.util.concurrent"><CODE>ConcurrentMap</CODE></A>. <b>This implementation does not page to disk and is therefore unsuitable for applications |
| that could experience a large amount of sessions</b> and would therefore cause <code>OutOfMemoryException</code>s. It is |
| <em>not</em> recommended for production use in most environments. |
| <h2>Memory Restrictions</h2> |
| If your application is expected to host many sessions beyond what can be stored in the |
| memory available to the JVM, it is highly recommended to use a different <code>SessionDAO</code> implementation which |
| uses a more expansive or permanent backing data store. |
| <p/> |
| In this case, it is recommended to instead use a custom |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>CachingSessionDAO</CODE></A> implementation that communicates with a higher-capacity data store of your choice |
| (file system, database, etc). |
| <h2>Changes in 1.0</h2> |
| This implementation prior to 1.0 used to subclass the <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>CachingSessionDAO</CODE></A>, but this caused problems with many |
| cache implementations that would expunge entries due to TTL settings, resulting in Sessions that would be randomly |
| (and permanently) lost. The Shiro 1.0 release refactored this implementation to be 100% memory-based (without |
| <code>Cache</code> usage to avoid this problem. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Since:</B></DT> |
| <DD>0.1</DD> |
| <DT><B>See Also:</B><DD><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/CachingSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis"><CODE>CachingSessionDAO</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/session/mgt/eis/MemorySessionDAO.html#MemorySessionDAO()">MemorySessionDAO</A></B>()</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- ========== 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> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#delete(org.apache.shiro.session.Session)">delete</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</CODE> |
| |
| <BR> |
| Deletes the associated EIS record of the specified <code>session</code>.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>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></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/MemorySessionDAO.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> session)</CODE> |
| |
| <BR> |
| 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 <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/MemorySessionDAO.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> sessionId)</CODE> |
| |
| <BR> |
| 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> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><<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/MemorySessionDAO.html#getActiveSessions()">getActiveSessions</A></B>()</CODE> |
| |
| <BR> |
| Returns all sessions in the EIS that are considered active, meaning all sessions that |
| haven't been stopped/expired.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE>protected <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/MemorySessionDAO.html#storeSession(java.io.Serializable, org.apache.shiro.session.Session)">storeSession</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> id, |
| <A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</CODE> |
| |
| <BR> |
| </TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> void</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#update(org.apache.shiro.session.Session)">update</A></B>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</CODE> |
| |
| <BR> |
| Updates (persists) data from a previously created Session instance in the EIS identified by |
| <code>{@link Session#getId() session.getId()}</code>.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_org.apache.shiro.session.mgt.eis.AbstractSessionDAO"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from class org.apache.shiro.session.mgt.eis.<A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#assignSessionId(org.apache.shiro.session.Session, java.io.Serializable)">assignSessionId</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#create(org.apache.shiro.session.Session)">create</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#generateSessionId(org.apache.shiro.session.Session)">generateSessionId</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#getSessionIdGenerator()">getSessionIdGenerator</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#readSession(java.io.Serializable)">readSession</A>, <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#setSessionIdGenerator(org.apache.shiro.session.mgt.eis.SessionIdGenerator)">setSessionIdGenerator</A></CODE></TD> |
| </TR> |
| </TABLE> |
| <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> |
| |
| <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="MemorySessionDAO()"><!-- --></A><H3> |
| MemorySessionDAO</H3> |
| <PRE> |
| public <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.62"><B>MemorySessionDAO</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="doCreate(org.apache.shiro.session.Session)"><!-- --></A><H3> |
| doCreate</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/MemorySessionDAO.html#line.66"><B>doCreate</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</PRE> |
| <DL> |
| <DD><B>Description copied from class: <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)">AbstractSessionDAO</A></CODE></B></DD> |
| <DD>Subclass hook to actually persist the given <tt>Session</tt> instance to the underlying EIS. |
| <P> |
| <DD><DL> |
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doCreate(org.apache.shiro.session.Session)">doCreate</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</A></CODE></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="storeSession(java.io.Serializable, org.apache.shiro.session.Session)"><!-- --></A><H3> |
| storeSession</H3> |
| <PRE> |
| protected <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/MemorySessionDAO.html#line.73"><B>storeSession</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> id, |
| <A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</PRE> |
| <DL> |
| <DD><DL> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="doReadSession(java.io.Serializable)"><!-- --></A><H3> |
| doReadSession</H3> |
| <PRE> |
| protected <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/MemorySessionDAO.html#line.80"><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> sessionId)</PRE> |
| <DL> |
| <DD><B>Description copied from class: <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doReadSession(java.io.Serializable)">AbstractSessionDAO</A></CODE></B></DD> |
| <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> |
| <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html#doReadSession(java.io.Serializable)">doReadSession</A></CODE> in class <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/AbstractSessionDAO.html" title="class in org.apache.shiro.session.mgt.eis">AbstractSessionDAO</A></CODE></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> |
| <HR> |
| |
| <A NAME="update(org.apache.shiro.session.Session)"><!-- --></A><H3> |
| update</H3> |
| <PRE> |
| public void <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.84"><B>update</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session) |
| throws <A HREF="../../../../../../org/apache/shiro/session/UnknownSessionException.html" title="class in org.apache.shiro.session">UnknownSessionException</A></PRE> |
| <DL> |
| <DD><B>Description copied from interface: <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#update(org.apache.shiro.session.Session)">SessionDAO</A></CODE></B></DD> |
| <DD>Updates (persists) data from a previously created Session instance in the EIS identified by |
| <code>{@link Session#getId() session.getId()}</code>. This effectively propagates |
| the data in the argument to the EIS record previously saved. |
| <p/> |
| In addition to UnknownSessionException, implementations are free to throw any other |
| exceptions that might occur due to integrity violation constraints or other EIS related |
| errors. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>session</CODE> - the Session to update |
| <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 no existing EIS session record exists with the |
| identifier of <A HREF="../../../../../../org/apache/shiro/session/Session.html#getId()"><CODE>session.getSessionId()</CODE></A></DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="delete(org.apache.shiro.session.Session)"><!-- --></A><H3> |
| delete</H3> |
| <PRE> |
| public void <A HREF="../../../../../../src-html/org/apache/shiro/session/mgt/eis/MemorySessionDAO.html#line.88"><B>delete</B></A>(<A HREF="../../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</A> session)</PRE> |
| <DL> |
| <DD><B>Description copied from interface: <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#delete(org.apache.shiro.session.Session)">SessionDAO</A></CODE></B></DD> |
| <DD>Deletes the associated EIS record of the specified <code>session</code>. If there never |
| existed a session EIS record with the identifier of |
| <A HREF="../../../../../../org/apache/shiro/session/Session.html#getId()"><CODE>session.getId()</CODE></A>, then this method does nothing. |
| <P> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>session</CODE> - the session to delete.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getActiveSessions()"><!-- --></A><H3> |
| getActiveSessions</H3> |
| <PRE> |
| public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><<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/MemorySessionDAO.html#line.98"><B>getActiveSessions</B></A>()</PRE> |
| <DL> |
| <DD><B>Description copied from interface: <CODE><A HREF="../../../../../../org/apache/shiro/session/mgt/eis/SessionDAO.html#getActiveSessions()">SessionDAO</A></CODE></B></DD> |
| <DD>Returns all sessions in the EIS that are considered active, meaning all sessions that |
| haven't been stopped/expired. This is primarily used to validate potential orphans. |
| <p/> |
| If there are no active sessions in the EIS, this method may return an empty collection or <code>null</code>. |
| <h4>Performance</h4> |
| This method should be as efficient as possible, especially in larger systems where there might be |
| thousands of active sessions. Large scale/high performance |
| implementations will often return a subset of the total active sessions and perform validation a little more |
| frequently, rather than return a massive set and validate infrequently. If efficient and possible, it would |
| make sense to return the oldest unstopped sessions available, ordered by |
| <A HREF="../../../../../../org/apache/shiro/session/Session.html#getLastAccessTime()"><CODE>lastAccessTime</CODE></A>. |
| <h4>Smart Results</h4> |
| <em>Ideally</em> this method would only return active sessions that the EIS was certain should be invalided. |
| Typically that is any session that is not stopped and where its lastAccessTimestamp is older than the session |
| timeout. |
| <p/> |
| For example, if sessions were backed by a relational database or SQL-92 'query-able' enterprise cache, you might |
| return something similar to the results returned by this query (assuming |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/SimpleSession.html" title="class in org.apache.shiro.session.mgt"><CODE>SimpleSession</CODE></A>s were being stored): |
| <pre> |
| select * from sessions s where s.lastAccessTimestamp < ? and s.stopTimestamp is null |
| </pre> |
| where the <code>?</code> parameter is a date instance equal to 'now' minus the session timeout |
| (e.g. now - 30 minutes). |
| <P> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a Collection of <code>Session</code>s that are considered active, or an |
| empty collection or <code>null</code> if there are no active sessions.</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> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemorySessionDAO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/JavaUuidSessionIdGenerator.html" title="class in org.apache.shiro.session.mgt.eis"><B>PREV CLASS</B></A> |
| <A HREF="../../../../../../org/apache/shiro/session/mgt/eis/RandomSessionIdGenerator.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/MemorySessionDAO.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="MemorySessionDAO.html" target="_top"><B>NO FRAMES</B></A> |
| <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| Copyright © 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. |
| </BODY> |
| </HTML> |