| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_21) on Thu May 30 14:51:26 PDT 2013 --> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>CachingRealm (Apache Shiro 1.2.1 API)</title> |
| <meta name="date" content="2013-05-30"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="CachingRealm (Apache Shiro 1.2.1 API)"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CachingRealm.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/realm/CachingRealm.html" target="_top">Frames</a></li> |
| <li><a href="CachingRealm.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.shiro.realm</div> |
| <h2 title="Class CachingRealm" class="title">Class CachingRealm</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><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></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.shiro.realm.CachingRealm</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a>, <a href="../../../../org/apache/shiro/cache/CacheManagerAware.html" title="interface in org.apache.shiro.cache">CacheManagerAware</a>, <a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>, <a href="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</a></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../org/apache/shiro/realm/AuthenticatingRealm.html" title="class in org.apache.shiro.realm">AuthenticatingRealm</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public abstract class <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.48">CachingRealm</a> |
| 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> |
| implements <a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a>, <a href="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</a>, <a href="../../../../org/apache/shiro/cache/CacheManagerAware.html" title="interface in org.apache.shiro.cache">CacheManagerAware</a>, <a href="../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></pre> |
| <div class="block">A very basic abstract extension point for the <a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><code>Realm</code></a> interface that provides caching support for subclasses. |
| <p/> |
| It also provides a convenience method, |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)"><code>getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)</code></a>, which is useful across all |
| realm subclasses for obtaining a realm-specific principal/identity. |
| <p/> |
| All actual Realm method implementations are left to subclasses.</div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>0.9</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)"><code>clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a>, |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#onLogout(org.apache.shiro.subject.PrincipalCollection)"><code>onLogout(org.apache.shiro.subject.PrincipalCollection)</code></a>, |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)"><code>getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)</code></a></dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#CachingRealm()">CachingRealm</a></strong>()</code> |
| <div class="block">Default no-argument constructor that defaults |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#isCachingEnabled()"><code>cachingEnabled</code></a> (for general caching) to <code>true</code> and sets a |
| default <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getName()"><code>name</code></a> based on the class name.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#afterCacheManagerSet()">afterCacheManagerSet</a></strong>()</code> |
| <div class="block">Template method that may be implemented by subclasses should they wish to react to a |
| <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> instance being set on the realm instance via the |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>setCacheManager(org.apache.shiro.cache.CacheManager)</code></a> mutator.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)">clearCache</a></strong>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <div class="block">Clears out any cached data associated with the specified account identity/identities.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#doClearCache(org.apache.shiro.subject.PrincipalCollection)">doClearCache</a></strong>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <div class="block">This implementation does nothing - it is a template to be overridden by subclasses if necessary.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <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></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)">getAvailablePrincipal</a></strong>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <div class="block">A utility method for subclasses that returns the first available principal of interest to this particular realm.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#getCacheManager()">getCacheManager</a></strong>()</code> |
| <div class="block">Returns the <tt>CacheManager</tt> used for data caching to reduce EIS round trips, or <tt>null</tt> if |
| caching is disabled.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#getName()">getName</a></strong>()</code> |
| <div class="block">Returns the (application-unique) name assigned to this <code>Realm</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#isCachingEnabled()">isCachingEnabled</a></strong>()</code> |
| <div class="block">Returns <code>true</code> if caching should be used if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>configured</code></a>, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></strong>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <div class="block">If caching is enabled, this will clear any cached data associated with the specified account identity.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)">setCacheManager</a></strong>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a> cacheManager)</code> |
| <div class="block">Sets the <tt>CacheManager</tt> to be used for data caching to reduce EIS round trips.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCachingEnabled(boolean)">setCachingEnabled</a></strong>(boolean cachingEnabled)</code> |
| <div class="block">Sets whether or not caching should be used if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>configured</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../org/apache/shiro/realm/CachingRealm.html#setName(java.lang.String)">setName</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> |
| <div class="block">Sets the (preferably application unique) name for this component.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="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></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods_inherited_from_class_org.apache.shiro.realm.Realm"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface org.apache.shiro.realm.<a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a></h3> |
| <code><a href="../../../../org/apache/shiro/realm/Realm.html#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)">getAuthenticationInfo</a>, <a href="../../../../org/apache/shiro/realm/Realm.html#supports(org.apache.shiro.authc.AuthenticationToken)">supports</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="CachingRealm()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>CachingRealm</h4> |
| <pre>public <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.71">CachingRealm</a>()</pre> |
| <div class="block">Default no-argument constructor that defaults |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#isCachingEnabled()"><code>cachingEnabled</code></a> (for general caching) to <code>true</code> and sets a |
| default <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getName()"><code>name</code></a> based on the class name. |
| <p/> |
| Note that while in general, caching may be enabled by default, subclasses have control over |
| if specific caching is enabled.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="getCacheManager()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCacheManager</h4> |
| <pre>public <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a> <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.83">getCacheManager</a>()</pre> |
| <div class="block">Returns the <tt>CacheManager</tt> used for data caching to reduce EIS round trips, or <tt>null</tt> if |
| caching is disabled.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>the <tt>CacheManager</tt> used for data caching to reduce EIS round trips, or <tt>null</tt> if |
| caching is disabled.</dd></dl> |
| </li> |
| </ul> |
| <a name="setCacheManager(org.apache.shiro.cache.CacheManager)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCacheManager</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.94">setCacheManager</a>(<a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache">CacheManager</a> cacheManager)</pre> |
| <div class="block">Sets the <tt>CacheManager</tt> to be used for data caching to reduce EIS round trips. |
| <p/> |
| This property is <tt>null</tt> by default, indicating that caching is turned off.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../org/apache/shiro/cache/CacheManagerAware.html#setCacheManager(org.apache.shiro.cache.CacheManager)">setCacheManager</a></code> in interface <code><a href="../../../../org/apache/shiro/cache/CacheManagerAware.html" title="interface in org.apache.shiro.cache">CacheManagerAware</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>cacheManager</code> - the <tt>CacheManager</tt> to use for data caching, or <tt>null</tt> to disable caching.</dd></dl> |
| </li> |
| </ul> |
| <a name="isCachingEnabled()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isCachingEnabled</h4> |
| <pre>public boolean <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.110">isCachingEnabled</a>()</pre> |
| <div class="block">Returns <code>true</code> if caching should be used if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>configured</code></a>, <code>false</code> otherwise. |
| <p/> |
| The default value is <code>true</code> since the large majority of Realms will benefit from caching if a CacheManager |
| has been configured. However, memory-only realms should set this value to <code>false</code> since they would |
| manage account data in memory already lookups would already be as efficient as possible.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if caching will be globally enabled if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been |
| configured, <code>false</code> otherwise</dd></dl> |
| </li> |
| </ul> |
| <a name="setCachingEnabled(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCachingEnabled</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.120">setCachingEnabled</a>(boolean cachingEnabled)</pre> |
| <div class="block">Sets whether or not caching should be used if a <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> has been |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>configured</code></a>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>cachingEnabled</code> - whether or not to globally enable caching for this realm.</dd></dl> |
| </li> |
| </ul> |
| <a name="getName()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getName</h4> |
| <pre>public <a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.124">getName</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../org/apache/shiro/realm/Realm.html#getName()">Realm</a></code></strong></div> |
| <div class="block">Returns the (application-unique) name assigned to this <code>Realm</code>. All realms configured for a single |
| application must have a unique name.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../org/apache/shiro/realm/Realm.html#getName()">getName</a></code> in interface <code><a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm">Realm</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the (application-unique) name assigned to this <code>Realm</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="setName(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setName</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.128">setName</a>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../org/apache/shiro/util/Nameable.html#setName(java.lang.String)">Nameable</a></code></strong></div> |
| <div class="block">Sets the (preferably application unique) name for this component.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../org/apache/shiro/util/Nameable.html#setName(java.lang.String)">setName</a></code> in interface <code><a href="../../../../org/apache/shiro/util/Nameable.html" title="interface in org.apache.shiro.util">Nameable</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the preferably application unique name for this component.</dd></dl> |
| </li> |
| </ul> |
| <a name="afterCacheManagerSet()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>afterCacheManagerSet</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.137">afterCacheManagerSet</a>()</pre> |
| <div class="block">Template method that may be implemented by subclasses should they wish to react to a |
| <a href="../../../../org/apache/shiro/cache/CacheManager.html" title="interface in org.apache.shiro.cache"><code>CacheManager</code></a> instance being set on the realm instance via the |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#setCacheManager(org.apache.shiro.cache.CacheManager)"><code>setCacheManager(org.apache.shiro.cache.CacheManager)</code></a> mutator.</div> |
| </li> |
| </ul> |
| <a name="onLogout(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>onLogout</h4> |
| <pre>public void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.151">onLogout</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">If caching is enabled, this will clear any cached data associated with the specified account identity. |
| Subclasses are free to override for additional behavior, but be sure to call <code>super.onLogout</code> first. |
| <p/> |
| This default implementation merely calls <a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)"><code>clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a>.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../org/apache/shiro/authc/LogoutAware.html#onLogout(org.apache.shiro.subject.PrincipalCollection)">onLogout</a></code> in interface <code><a href="../../../../org/apache/shiro/authc/LogoutAware.html" title="interface in org.apache.shiro.authc">LogoutAware</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the application-specific Subject/user identifier that is logging out.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/shiro/realm/CachingRealm.html#clearCache(org.apache.shiro.subject.PrincipalCollection)"><code>clearCache(org.apache.shiro.subject.PrincipalCollection)</code></a>, |
| <a href="../../../../org/apache/shiro/realm/CachingRealm.html#getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)"><code>getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="clearCache(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>clearCache</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.164">clearCache</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">Clears out any cached data associated with the specified account identity/identities. |
| <p/> |
| This implementation will return quietly if the principals argument is null or empty. Otherwise it delegates |
| to <a href="../../../../org/apache/shiro/realm/CachingRealm.html#doClearCache(org.apache.shiro.subject.PrincipalCollection)"><code>doClearCache(org.apache.shiro.subject.PrincipalCollection)</code></a>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the principals of the account for which to clear any cached data.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="doClearCache(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>doClearCache</h4> |
| <pre>protected void <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.177">doClearCache</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">This implementation does nothing - it is a template to be overridden by subclasses if necessary.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - principals the principals of the account for which to clear any cached data.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="getAvailablePrincipal(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getAvailablePrincipal</h4> |
| <pre>protected <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> <a href="../../../../src-html/org/apache/shiro/realm/CachingRealm.html#line.198">getAvailablePrincipal</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block">A utility method for subclasses that returns the first available principal of interest to this particular realm. |
| The heuristic used to acquire the principal is as follows: |
| <ul> |
| <li>Attempt to get <em>this particular Realm's</em> 'primary' principal in the <code>PrincipalCollection</code> via a |
| <code>principals.<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html#fromRealm(java.lang.String)"><code>fromRealm</code></a>(<a href="../../../../org/apache/shiro/realm/CachingRealm.html#getName()"><code>getName()</code></a>)</code> |
| call.</li> |
| <li>If the previous call does not result in any principals, attempt to get the overall 'primary' principal |
| from the PrincipalCollection via <a href="../../../../org/apache/shiro/subject/PrincipalCollection.html#getPrimaryPrincipal()"><code>PrincipalCollection.getPrimaryPrincipal()</code></a>.</li> |
| <li>If there are no principals from that call (or the PrincipalCollection argument was null to begin with), |
| return <code>null</code></li> |
| </ul></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the PrincipalCollection holding all principals (from all realms) associated with a single Subject.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the 'primary' principal attributed to this particular realm, or the fallback 'master' principal if it |
| exists, or if not <code>null</code>.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/CachingRealm.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/shiro/realm/AuthorizingRealm.html" title="class in org.apache.shiro.realm"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/shiro/realm/Realm.html" title="interface in org.apache.shiro.realm"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/shiro/realm/CachingRealm.html" target="_top">Frames</a></li> |
| <li><a href="CachingRealm.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor_summary">Constr</a> | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor_detail">Constr</a> | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2004-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p> |
| </body> |
| </html> |
| |