| <!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:27 PDT 2013 --> |
| <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> |
| <title>DelegatingSubject (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="DelegatingSubject (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/DelegatingSubject.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/subject/support/DefaultSubjectContext.html" title="class in org.apache.shiro.subject.support"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/subject/support/DisabledSessionException.html" title="class in org.apache.shiro.subject.support"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/subject/support/DelegatingSubject.html" target="_top">Frames</a></li> |
| <li><a href="DelegatingSubject.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </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.subject.support</div> |
| <h2 title="Class DelegatingSubject" class="title">Class DelegatingSubject</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.subject.support.DelegatingSubject</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/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../org/apache/shiro/web/subject/support/WebDelegatingSubject.html" title="class in org.apache.shiro.web.subject.support">WebDelegatingSubject</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.71">DelegatingSubject</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/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></pre> |
| <div class="block">Implementation of the <code>Subject</code> interface that delegates |
| method calls to an underlying <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt"><code>SecurityManager</code></a> instance for security checks. |
| It is essentially a <code>SecurityManager</code> proxy. |
| <p/> |
| This implementation does not maintain state such as roles and permissions (only <code>Subject</code> |
| <a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getPrincipals()"><code>principals</code></a>, such as usernames or user primary keys) for better performance in a stateless |
| architecture. It instead asks the underlying <code>SecurityManager</code> every time to perform |
| the authorization check. |
| <p/> |
| A common misconception in using this implementation is that an EIS resource (RDBMS, etc) would |
| be "hit" every time a method is called. This is not necessarily the case and is |
| up to the implementation of the underlying <code>SecurityManager</code> instance. If caching of authorization |
| data is desired (to eliminate EIS round trips and therefore improve database performance), it is considered |
| much more elegant to let the underlying <code>SecurityManager</code> implementation or its delegate components |
| manage caching, not this class. A <code>SecurityManager</code> is considered a business-tier component, |
| where caching strategies are better managed. |
| <p/> |
| Applications from large and clustered to simple and JVM-local all benefit from |
| stateless architectures. This implementation plays a part in the stateless programming |
| paradigm and should be used whenever possible.</div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>0.1</dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_class_summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested_classes_inherited_from_class_org.apache.shiro.subject.Subject"> |
| <!-- --> |
| </a> |
| <h3>Nested classes/interfaces inherited from interface org.apache.shiro.subject.<a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></h3> |
| <code><a href="../../../../../org/apache/shiro/subject/Subject.Builder.html" title="class in org.apache.shiro.subject">Subject.Builder</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#authenticated">authenticated</a></strong></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <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/subject/support/DelegatingSubject.html#host">host</a></strong></code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#principals">principals</a></strong></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#securityManager">securityManager</a></strong></code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#session">session</a></strong></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#sessionCreationEnabled">sessionCreationEnabled</a></strong></code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== 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/subject/support/DelegatingSubject.html#DelegatingSubject(org.apache.shiro.subject.PrincipalCollection, boolean, java.lang.String, org.apache.shiro.session.Session, boolean, org.apache.shiro.mgt.SecurityManager)">DelegatingSubject</a></strong>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals, |
| boolean authenticated, |
| <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> host, |
| <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session, |
| boolean sessionCreationEnabled, |
| <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#DelegatingSubject(org.apache.shiro.subject.PrincipalCollection, boolean, java.lang.String, org.apache.shiro.session.Session, org.apache.shiro.mgt.SecurityManager)">DelegatingSubject</a></strong>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals, |
| boolean authenticated, |
| <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> host, |
| <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session, |
| <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#DelegatingSubject(org.apache.shiro.mgt.SecurityManager)">DelegatingSubject</a></strong>(<a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="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/subject/support/DelegatingSubject.html#assertAuthzCheckPossible()">assertAuthzCheckPossible</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><V> <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#associateWith(java.util.concurrent.Callable)">associateWith</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V> callable)</code> |
| <div class="block">Returns a <code>Callable</code> instance matching the given argument while additionally ensuring that it will |
| retain and execute under this Subject's identity.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#associateWith(java.lang.Runnable)">associateWith</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a> runnable)</code> |
| <div class="block">Returns a <code>Runnable</code> instance matching the given argument while additionally ensuring that it will |
| retain and execute under this Subject's identity.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkPermission(org.apache.shiro.authz.Permission)">checkPermission</a></strong>(<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a> permission)</code> |
| <div class="block">Ensures this Subject <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> the specified <code>Permission</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkPermission(java.lang.String)">checkPermission</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> permission)</code> |
| <div class="block">Ensures this Subject implies the specified permission String.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkPermissions(java.util.Collection)">checkPermissions</a></strong>(<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/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions)</code> |
| <div class="block">Ensures this Subject |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> all of the |
| specified permission strings.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkPermissions(java.lang.String...)">checkPermissions</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>... permissions)</code> |
| <div class="block">Ensures this Subject |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> all of the |
| specified permission strings.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkRole(java.lang.String)">checkRole</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> role)</code> |
| <div class="block">Asserts this Subject has the specified role by returning quietly if they do or throwing an |
| <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> if they do not.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkRoles(java.util.Collection)">checkRoles</a></strong>(<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="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> roles)</code> |
| <div class="block">Asserts this Subject has all of the specified roles by returning quietly if they do or throwing an |
| <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> if they do not.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#checkRoles(java.lang.String...)">checkRoles</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>... roleIdentifiers)</code> |
| <div class="block">Same as <code>checkRoles(Collection<String> roleIdentifiers)</code> but |
| doesn't require a collection as a an argument.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/session/mgt/SessionContext.html" title="interface in org.apache.shiro.session.mgt">SessionContext</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#createSessionContext()">createSessionContext</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#decorate(org.apache.shiro.session.Session)">decorate</a></strong>(<a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><V> V</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#execute(java.util.concurrent.Callable)">execute</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V> callable)</code> |
| <div class="block">Associates the specified <code>Callable</code> with this <code>Subject</code> instance and then executes it on the |
| currently running thread.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#execute(java.lang.Runnable)">execute</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a> runnable)</code> |
| <div class="block">Associates the specified <code>Runnable</code> with this <code>Subject</code> instance and then executes it on the |
| currently running thread.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <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/subject/support/DelegatingSubject.html#getHost()">getHost</a></strong>()</code> |
| <div class="block">Returns the host name or IP associated with the client who created/is interacting with this Subject.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getPreviousPrincipals()">getPreviousPrincipals</a></strong>()</code> |
| <div class="block">Returns the previous 'pre run as' identity of this <code>Subject</code> before assuming the current |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>runAs</code></a> identity, or <code>null</code> if this <code>Subject</code> is not operating under an assumed |
| identity (normal state).</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><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/subject/support/DelegatingSubject.html#getPrincipal()">getPrincipal</a></strong>()</code> |
| <div class="block">Returns this Subject's application-wide uniquely identifying principal, or <code>null</code> if this |
| Subject is anonymous because it doesn't yet have any associated account data (for example, |
| if they haven't logged in).</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getPrincipals()">getPrincipals</a></strong>()</code> |
| <div class="block">Returns this Subject's principals (identifying attributes) in the form of a <code>PrincipalCollection</code> or |
| <code>null</code> if this Subject is anonymous because it doesn't yet have any associated account data (for example, |
| if they haven't logged in).</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getSecurityManager()">getSecurityManager</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getSession()">getSession</a></strong>()</code> |
| <div class="block">Returns the application <code>Session</code> associated with this Subject.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#getSession(boolean)">getSession</a></strong>(boolean create)</code> |
| <div class="block">Returns the application <code>Session</code> associated with this Subject.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#hasAllRoles(java.util.Collection)">hasAllRoles</a></strong>(<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="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> roleIdentifiers)</code> |
| <div class="block">Returns <code>true</code> if this Subject has all of the specified roles, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#hasPrincipals()">hasPrincipals</a></strong>()</code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#hasRole(java.lang.String)">hasRole</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> roleIdentifier)</code> |
| <div class="block">Returns <code>true</code> if this Subject has the specified role, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#hasRoles(java.util.List)">hasRoles</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</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>> roleIdentifiers)</code> |
| <div class="block">Checks if this Subject has the specified roles, returning a boolean array indicating |
| which roles are associated.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isAuthenticated()">isAuthenticated</a></strong>()</code> |
| <div class="block">Returns <code>true</code> if this Subject/user proved their identity <em>during their current session</em> |
| by providing valid credentials matching those known to the system, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermitted(java.util.List)">isPermitted</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions)</code> |
| <div class="block">Checks if this Subject implies the given Permissions and returns a boolean array indicating which permissions |
| are implied.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermitted(org.apache.shiro.authz.Permission)">isPermitted</a></strong>(<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a> permission)</code> |
| <div class="block">Returns <code>true</code> if this Subject is permitted to perform an action or access a resource summarized by the |
| specified permission.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean[]</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermitted(java.lang.String...)">isPermitted</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>... permissions)</code> |
| <div class="block">Checks if this Subject implies the given permission strings and returns a boolean array indicating which |
| permissions are implied.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermitted(java.lang.String)">isPermitted</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> permission)</code> |
| <div class="block">Returns <code>true</code> if this Subject is permitted to perform an action or access a resource summarized by the |
| specified permission string.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermittedAll(java.util.Collection)">isPermittedAll</a></strong>(<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/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions)</code> |
| <div class="block">Returns <code>true</code> if this Subject implies all of the specified permissions, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isPermittedAll(java.lang.String...)">isPermittedAll</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>... permissions)</code> |
| <div class="block">Returns <code>true</code> if this Subject implies all of the specified permission strings, <code>false</code> otherwise.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isRemembered()">isRemembered</a></strong>()</code> |
| <div class="block">Returns <code>true</code> if this <code>Subject</code> has an identity (it is not anonymous) and the identity |
| (aka <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()"><code>principals</code></a>) is remembered from a successful authentication during a previous |
| session.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isRunAs()">isRunAs</a></strong>()</code> |
| <div class="block">Returns <code>true</code> if this <code>Subject</code> is 'running as' another identity other than its original one or |
| <code>false</code> otherwise (normal <code>Subject</code> state).</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#isSessionCreationEnabled()">isSessionCreationEnabled</a></strong>()</code> |
| <div class="block">Returns <code>true</code> if this Subject is allowed to create sessions, <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/subject/support/DelegatingSubject.html#login(org.apache.shiro.authc.AuthenticationToken)">login</a></strong>(<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token)</code> |
| <div class="block">Performs a login attempt for this Subject/user.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#logout()">logout</a></strong>()</code> |
| <div class="block">Logs out this Subject and invalidates and/or removes any associated entities, |
| such as a <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session"><code>Session</code></a> and authorization data.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#releaseRunAs()">releaseRunAs</a></strong>()</code> |
| <div class="block">Releases the current 'run as' (assumed) identity and reverts back to the previous 'pre run as' |
| identity that existed before <code>#runAs runAs</code> was called.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/subject/support/DelegatingSubject.html#runAs(org.apache.shiro.subject.PrincipalCollection)">runAs</a></strong>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</code> |
| <div class="block">Allows this subject to 'run as' or 'assume' another identity indefinitely.</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> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="principals"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>principals</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.78">principals</a></pre> |
| </li> |
| </ul> |
| <a name="authenticated"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>authenticated</h4> |
| <pre>protected boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.79">authenticated</a></pre> |
| </li> |
| </ul> |
| <a name="host"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>host</h4> |
| <pre>protected <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/subject/support/DelegatingSubject.html#line.80">host</a></pre> |
| </li> |
| </ul> |
| <a name="session"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>session</h4> |
| <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/subject/support/DelegatingSubject.html#line.81">session</a></pre> |
| </li> |
| </ul> |
| <a name="sessionCreationEnabled"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>sessionCreationEnabled</h4> |
| <pre>protected boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.85">sessionCreationEnabled</a></pre> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="securityManager"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>securityManager</h4> |
| <pre>protected transient <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.87">securityManager</a></pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor_detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="DelegatingSubject(org.apache.shiro.mgt.SecurityManager)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DelegatingSubject</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.89">DelegatingSubject</a>(<a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</pre> |
| </li> |
| </ul> |
| <a name="DelegatingSubject(org.apache.shiro.subject.PrincipalCollection, boolean, java.lang.String, org.apache.shiro.session.Session, org.apache.shiro.mgt.SecurityManager)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DelegatingSubject</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.93">DelegatingSubject</a>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals, |
| boolean authenticated, |
| <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> host, |
| <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session, |
| <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</pre> |
| </li> |
| </ul> |
| <a name="DelegatingSubject(org.apache.shiro.subject.PrincipalCollection, boolean, java.lang.String, org.apache.shiro.session.Session, boolean, org.apache.shiro.mgt.SecurityManager)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>DelegatingSubject</h4> |
| <pre>public <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.99">DelegatingSubject</a>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals, |
| boolean authenticated, |
| <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> host, |
| <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session, |
| boolean sessionCreationEnabled, |
| <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> securityManager)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="decorate(org.apache.shiro.session.Session)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>decorate</h4> |
| <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/subject/support/DelegatingSubject.html#line.114">decorate</a>(<a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a> session)</pre> |
| </li> |
| </ul> |
| <a name="getSecurityManager()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSecurityManager</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.121">getSecurityManager</a>()</pre> |
| </li> |
| </ul> |
| <a name="hasPrincipals()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasPrincipals</h4> |
| <pre>protected boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.125">hasPrincipals</a>()</pre> |
| </li> |
| </ul> |
| <a name="getHost()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getHost</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/subject/support/DelegatingSubject.html#line.134">getHost</a>()</pre> |
| <div class="block">Returns the host name or IP associated with the client who created/is interacting with this Subject.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>the host name or IP associated with the client who created/is interacting with this Subject.</dd></dl> |
| </li> |
| </ul> |
| <a name="getPrincipal()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPrincipal</h4> |
| <pre>public <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/subject/support/DelegatingSubject.html#line.148">getPrincipal</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()">Subject</a></code></strong></div> |
| <div class="block">Returns this Subject's application-wide uniquely identifying principal, or <code>null</code> if this |
| Subject is anonymous because it doesn't yet have any associated account data (for example, |
| if they haven't logged in). |
| <p/> |
| The term <em>principal</em> is just a fancy security term for any identifying attribute(s) of an application |
| user, such as a username, or user id, or public key, or anything else you might use in your application to |
| identify a user. |
| <h4>Uniqueness</h4> |
| Although given names and family names (first/last) are technically considered principals as well, |
| Shiro expects the object returned from this method to be an identifying attribute unique across |
| your entire application. |
| <p/> |
| This implies that things like given names and family names are usually poor |
| candidates as return values since they are rarely guaranteed to be unique; Things often used for this value: |
| <ul> |
| <li>A <code>long</code> RDBMS surrogate primary key</li> |
| <li>An application-unique username</li> |
| <li>A <a href="http://java.sun.com/javase/6/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util"><code>UUID</code></a></li> |
| <li>An LDAP Unique ID</li> |
| </ul> |
| or any other similar suitable unique mechanism valuable to your application. |
| <p/> |
| Most implementations will simply return |
| <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()"><code>Subject.getPrincipals()</code></a>.<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html#getPrimaryPrincipal()"><code>getPrimaryPrincipal()</code></a></code></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()">getPrincipal</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>this Subject's application-specific unique identity.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()"><code>Subject.getPrincipal()</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="getPrincipals()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPrincipals</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.152">getPrincipals</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()">Subject</a></code></strong></div> |
| <div class="block">Returns this Subject's principals (identifying attributes) in the form of a <code>PrincipalCollection</code> or |
| <code>null</code> if this Subject is anonymous because it doesn't yet have any associated account data (for example, |
| if they haven't logged in). |
| <p/> |
| The word "principals" is nothing more than a fancy security term for identifying attributes associated |
| with a Subject, aka, application user. For example, user id, a surname (family/last name), given (first) name, |
| social security number, nickname, username, etc, are all examples of a principal.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()">getPrincipals</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>all of this Subject's principals (identifying attributes).</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()"><code>Subject.getPrincipal()</code></a>, |
| <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html#getPrimaryPrincipal()"><code>PrincipalCollection.getPrimaryPrincipal()</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="isPermitted(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermitted</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.157">isPermitted</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> permission)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.lang.String)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject is permitted to perform an action or access a resource summarized by the |
| specified permission string. |
| <p/> |
| This is an overloaded method for the corresponding type-safe <a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><code>Permission</code></a> variant. |
| Please see the class-level JavaDoc for more information on these String-based permission methods.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.lang.String)">isPermitted</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permission</code> - the String representation of a Permission that is being checked.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if this Subject is permitted, false otherwise.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(org.apache.shiro.authz.Permission)"><code>Subject.isPermitted(Permission permission)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="isPermitted(org.apache.shiro.authz.Permission)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermitted</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.161">isPermitted</a>(<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a> permission)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(org.apache.shiro.authz.Permission)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject is permitted to perform an action or access a resource summarized by the |
| specified permission. |
| <p/> |
| More specifically, this method determines if any <code>Permission</code>s associated |
| with the subject <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>imply</code></a> the specified permission.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(org.apache.shiro.authz.Permission)">isPermitted</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permission</code> - the permission that is being checked.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if this Subject is permitted, false otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="isPermitted(java.lang.String...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermitted</h4> |
| <pre>public boolean[] <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.165">isPermitted</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>... permissions)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.lang.String...)">Subject</a></code></strong></div> |
| <div class="block">Checks if this Subject implies the given permission strings and returns a boolean array indicating which |
| permissions are implied. |
| <p/> |
| This is an overloaded method for the corresponding type-safe <a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><code>Permission</code></a> variant. |
| Please see the class-level JavaDoc for more information on these String-based permission methods.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.lang.String...)">isPermitted</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the String representations of the Permissions that are being checked.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a boolean array where indices correspond to the index of the |
| permissions in the given list. A true value at an index indicates this Subject is permitted for |
| for the associated <code>Permission</code> string in the list. A false value at an index |
| indicates otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="isPermitted(java.util.List)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermitted</h4> |
| <pre>public boolean[] <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.173">isPermitted</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.util.List)">Subject</a></code></strong></div> |
| <div class="block">Checks if this Subject implies the given Permissions and returns a boolean array indicating which permissions |
| are implied. |
| <p/> |
| More specifically, this method should determine if each <code>Permission</code> in |
| the array is <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implied</code></a> by permissions |
| already associated with the subject. |
| <p/> |
| This is primarily a performance-enhancing method to help reduce the number of |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.lang.String)"><code>Subject.isPermitted(java.lang.String)</code></a> invocations over the wire in client/server systems.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermitted(java.util.List)">isPermitted</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the permissions that are being checked.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a boolean array where indices correspond to the index of the |
| permissions in the given list. A true value at an index indicates this Subject is permitted for |
| for the associated <code>Permission</code> object in the list. A false value at an index |
| indicates otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="isPermittedAll(java.lang.String...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermittedAll</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.181">isPermittedAll</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>... permissions)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermittedAll(java.lang.String...)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject implies all of the specified permission strings, <code>false</code> otherwise. |
| <p/> |
| This is an overloaded method for the corresponding type-safe <a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><code>Permission</code></a> |
| variant. Please see the class-level JavaDoc for more information on these String-based permission methods.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermittedAll(java.lang.String...)">isPermittedAll</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the String representations of the Permissions that are being checked.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if this Subject has all of the specified permissions, false otherwise.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermittedAll(java.util.Collection)"><code>Subject.isPermittedAll(Collection)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="isPermittedAll(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isPermittedAll</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.185">isPermittedAll</a>(<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/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermittedAll(java.util.Collection)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject implies all of the specified permissions, <code>false</code> otherwise. |
| <p/> |
| More specifically, this method determines if all of the given <code>Permission</code>s are |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implied by</code></a> permissions already associated with this Subject.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isPermittedAll(java.util.Collection)">isPermittedAll</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the permissions to check.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if this Subject has all of the specified permissions, false otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="assertAuthzCheckPossible()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>assertAuthzCheckPossible</h4> |
| <pre>protected void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.189">assertAuthzCheckPossible</a>() |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code></dd></dl> |
| </li> |
| </ul> |
| <a name="checkPermission(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkPermission</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.203">checkPermission</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> permission) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermission(java.lang.String)">Subject</a></code></strong></div> |
| <div class="block">Ensures this Subject implies the specified permission String. |
| <p/> |
| If this subject's existing associated permissions do not <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>Permission.implies(Permission)</code></a> imply} |
| the given permission, an <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> will be thrown. |
| <p/> |
| This is an overloaded method for the corresponding type-safe <a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><code>Permission</code></a> variant. |
| Please see the class-level JavaDoc for more information on these String-based permission methods.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermission(java.lang.String)">checkPermission</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permission</code> - the String representation of the Permission to check.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if the user does not have the permission.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkPermission(org.apache.shiro.authz.Permission)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkPermission</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.208">checkPermission</a>(<a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a> permission) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermission(org.apache.shiro.authz.Permission)">Subject</a></code></strong></div> |
| <div class="block">Ensures this Subject <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> the specified <code>Permission</code>. |
| <p/> |
| If this subject's existing associated permissions do not <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>imply</code></a> |
| the given permission, an <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> will be thrown.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermission(org.apache.shiro.authz.Permission)">checkPermission</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permission</code> - the Permission to check.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if this Subject does not have the permission.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkPermissions(java.lang.String...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkPermissions</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.213">checkPermissions</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>... permissions) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermissions(java.lang.String...)">Subject</a></code></strong></div> |
| <div class="block">Ensures this Subject |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> all of the |
| specified permission strings. |
| <p/> |
| If this subject's existing associated permissions do not |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>imply</code></a> all of the given permissions, |
| an <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> will be thrown. |
| <p/> |
| This is an overloaded method for the corresponding type-safe <a href="../../../../../org/apache/shiro/authz/Permission.html" title="interface in org.apache.shiro.authz"><code>Permission</code></a> variant. |
| Please see the class-level JavaDoc for more information on these String-based permission methods.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermissions(java.lang.String...)">checkPermissions</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the string representations of Permissions to check.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if this Subject does not have all of the given permissions.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkPermissions(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkPermissions</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.218">checkPermissions</a>(<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/authz/Permission.html" title="interface in org.apache.shiro.authz">Permission</a>> permissions) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermissions(java.util.Collection)">Subject</a></code></strong></div> |
| <div class="block">Ensures this Subject |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>implies</code></a> all of the |
| specified permission strings. |
| <p/> |
| If this subject's existing associated permissions do not |
| <a href="../../../../../org/apache/shiro/authz/Permission.html#implies(org.apache.shiro.authz.Permission)"><code>imply</code></a> all of the given permissions, |
| an <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> will be thrown.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkPermissions(java.util.Collection)">checkPermissions</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>permissions</code> - the Permissions to check.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if this Subject does not have all of the given permissions.</dd></dl> |
| </li> |
| </ul> |
| <a name="hasRole(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasRole</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.223">hasRole</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> roleIdentifier)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasRole(java.lang.String)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject has the specified role, <code>false</code> otherwise.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasRole(java.lang.String)">hasRole</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>roleIdentifier</code> - the application-specific role identifier (usually a role id or role name).</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this Subject has the specified role, <code>false</code> otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="hasRoles(java.util.List)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasRoles</h4> |
| <pre>public boolean[] <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.227">hasRoles</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</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>> roleIdentifiers)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasRoles(java.util.List)">Subject</a></code></strong></div> |
| <div class="block">Checks if this Subject has the specified roles, returning a boolean array indicating |
| which roles are associated. |
| <p/> |
| This is primarily a performance-enhancing method to help reduce the number of |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#hasRole(java.lang.String)"><code>Subject.hasRole(java.lang.String)</code></a> invocations over the wire in client/server systems.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasRoles(java.util.List)">hasRoles</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>roleIdentifiers</code> - the application-specific role identifiers to check (usually role ids or role names).</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a boolean array where indices correspond to the index of the |
| roles in the given identifiers. A true value indicates this Subject has the |
| role at that index. False indicates this Subject does not have the role at that index.</dd></dl> |
| </li> |
| </ul> |
| <a name="hasAllRoles(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hasAllRoles</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.235">hasAllRoles</a>(<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="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> roleIdentifiers)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasAllRoles(java.util.Collection)">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject has all of the specified roles, <code>false</code> otherwise.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#hasAllRoles(java.util.Collection)">hasAllRoles</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>roleIdentifiers</code> - the application-specific role identifiers to check (usually role ids or role names).</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>true if this Subject has all the roles, false otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkRole(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkRole</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.239">checkRole</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> role) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRole(java.lang.String)">Subject</a></code></strong></div> |
| <div class="block">Asserts this Subject has the specified role by returning quietly if they do or throwing an |
| <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> if they do not.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRole(java.lang.String)">checkRole</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>role</code> - the application-specific role identifier (usually a role id or role name ).</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if this Subject does not have the role.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkRoles(java.lang.String...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkRoles</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.244">checkRoles</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>... roleIdentifiers) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRoles(java.lang.String...)">Subject</a></code></strong></div> |
| <div class="block">Same as <code>checkRoles(Collection<String> roleIdentifiers)</code> but |
| doesn't require a collection as a an argument. |
| Asserts this Subject has all of the specified roles by returning quietly if they do or throwing an |
| <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> if they do not.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRoles(java.lang.String...)">checkRoles</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>roleIdentifiers</code> - roleIdentifiers the application-specific role identifiers to check (usually role ids or role names).</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - org.apache.shiro.authz.AuthorizationException |
| if this Subject does not have all of the specified roles.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkRoles(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkRoles</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.249">checkRoles</a>(<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="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> roles) |
| throws <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRoles(java.util.Collection)">Subject</a></code></strong></div> |
| <div class="block">Asserts this Subject has all of the specified roles by returning quietly if they do or throwing an |
| <a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz"><code>AuthorizationException</code></a> if they do not.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#checkRoles(java.util.Collection)">checkRoles</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>roles</code> - the application-specific role identifiers to check (usually role ids or role names).</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authz/AuthorizationException.html" title="class in org.apache.shiro.authz">AuthorizationException</a></code> - if this Subject does not have all of the specified roles.</dd></dl> |
| </li> |
| </ul> |
| <a name="login(org.apache.shiro.authc.AuthenticationToken)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>login</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.254">login</a>(<a href="../../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a> token) |
| throws <a href="../../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#login(org.apache.shiro.authc.AuthenticationToken)">Subject</a></code></strong></div> |
| <div class="block">Performs a login attempt for this Subject/user. If unsuccessful, |
| an <a href="../../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc"><code>AuthenticationException</code></a> is thrown, the subclass of which identifies why the attempt failed. |
| If successful, the account data associated with the submitted principals/credentials will be |
| associated with this <code>Subject</code> and the method will return quietly. |
| <p/> |
| Upon returning quietly, this <code>Subject</code> instance can be considered |
| authenticated and <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()"><code>getPrincipal()</code></a> will be non-null and |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()"><code>isAuthenticated()</code></a> will be <code>true</code>.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#login(org.apache.shiro.authc.AuthenticationToken)">login</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>token</code> - the token encapsulating the subject's principals and credentials to be passed to the |
| Authentication subsystem for verification.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/authc/AuthenticationException.html" title="class in org.apache.shiro.authc">AuthenticationException</a></code> - if the authentication attempt fails.</dd></dl> |
| </li> |
| </ul> |
| <a name="isAuthenticated()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAuthenticated</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.292">isAuthenticated</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this Subject/user proved their identity <em>during their current session</em> |
| by providing valid credentials matching those known to the system, <code>false</code> otherwise. |
| <p/> |
| Note that even if this Subject's identity has been remembered via 'remember me' services, this method will |
| still return <code>false</code> unless the user has actually logged in with proper credentials <em>during their |
| current session</em>. See the <a href="../../../../../org/apache/shiro/subject/Subject.html#isRemembered()"><code>isRemembered()</code></a> method JavaDoc for more.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()">isAuthenticated</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this Subject proved their identity during their current session |
| by providing valid credentials matching those known to the system, <code>false</code> otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="isRemembered()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isRemembered</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.296">isRemembered</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isRemembered()">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this <code>Subject</code> has an identity (it is not anonymous) and the identity |
| (aka <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()"><code>principals</code></a>) is remembered from a successful authentication during a previous |
| session. |
| <p/> |
| Although the underlying implementation determines exactly how this method functions, most implementations have |
| this method act as the logical equivalent to this code: |
| <pre> |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipal()"><code>getPrincipal()</code></a> != null && !<a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()"><code>isAuthenticated()</code></a></pre> |
| <p/> |
| Note as indicated by the above code example, if a <code>Subject</code> is remembered, they are |
| <em>NOT</em> considered authenticated. A check against <a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()"><code>isAuthenticated()</code></a> is a more |
| strict check than that reflected by this method. For example, a check to see if a subject can access financial |
| information should almost always depend on <a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()"><code>isAuthenticated()</code></a> to <em>guarantee</em> a |
| verified identity, and not this method. |
| <p/> |
| Once the subject is authenticated, they are no longer considered only remembered because their identity would |
| have been verified during the current session. |
| <h4>Remembered vs Authenticated</h4> |
| Authentication is the process of <em>proving</em> you are who you say you are. When a user is only remembered, |
| the remembered identity gives the system an idea who that user probably is, but in reality, has no way of |
| absolutely <em>guaranteeing</em> if the remembered <code>Subject</code> represents the user currently |
| using the application. |
| <p/> |
| So although many parts of the application can still perform user-specific logic based on the remembered |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()"><code>principals</code></a>, such as customized views, it should never perform highly-sensitive |
| operations until the user has legitimately verified their identity by executing a successful authentication |
| attempt. |
| <p/> |
| We see this paradigm all over the web, and we will use <a href="http://www.amazon.com">Amazon.com</a> as an |
| example: |
| <p/> |
| When you visit Amazon.com and perform a login and ask it to 'remember me', it will set a cookie with your |
| identity. If you don't log out and your session expires, and you come back, say the next day, Amazon still knows |
| who you <em>probably</em> are: you still see all of your book and movie recommendations and similar user-specific |
| features since these are based on your (remembered) user id. |
| <p/> |
| BUT, if you try to do something sensitive, such as access your account's billing data, Amazon forces you |
| to do an actual log-in, requiring your username and password. |
| <p/> |
| This is because although amazon.com assumed your identity from 'remember me', it recognized that you were not |
| actually authenticated. The only way to really guarantee you are who you say you are, and therefore allow you |
| access to sensitive account data, is to force you to perform an actual successful authentication. You can |
| check this guarantee via the <a href="../../../../../org/apache/shiro/subject/Subject.html#isAuthenticated()"><code>isAuthenticated()</code></a> method and not via this method.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isRemembered()">isRemembered</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this <code>Subject</code>'s identity (aka <a href="../../../../../org/apache/shiro/subject/Subject.html#getPrincipals()"><code>principals</code></a>) is |
| remembered from a successful authentication during a previous session, <code>false</code> otherwise.</dd></dl> |
| </li> |
| </ul> |
| <a name="isSessionCreationEnabled()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSessionCreationEnabled</h4> |
| <pre>protected boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.307">isSessionCreationEnabled</a>()</pre> |
| <div class="block">Returns <code>true</code> if this Subject is allowed to create sessions, <code>false</code> otherwise.</div> |
| <dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this Subject is allowed to create sessions, <code>false</code> otherwise.</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="getSession()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSession</h4> |
| <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/subject/support/DelegatingSubject.html#line.311">getSession</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getSession()">Subject</a></code></strong></div> |
| <div class="block">Returns the application <code>Session</code> associated with this Subject. If no session exists when this |
| method is called, a new session will be created, associated with this Subject, and then returned.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#getSession()">getSession</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the application <code>Session</code> associated with this Subject.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#getSession(boolean)"><code>Subject.getSession(boolean)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="getSession(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSession</h4> |
| <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/subject/support/DelegatingSubject.html#line.315">getSession</a>(boolean create)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getSession(boolean)">Subject</a></code></strong></div> |
| <div class="block">Returns the application <code>Session</code> associated with this Subject. Based on the boolean argument, |
| this method functions as follows: |
| <ul> |
| <li>If there is already an existing session associated with this <code>Subject</code>, it is returned and |
| the <code>create</code> argument is ignored.</li> |
| <li>If no session exists and <code>create</code> is <code>true</code>, a new session will be created, associated with |
| this <code>Subject</code> and then returned.</li> |
| <li>If no session exists and <code>create</code> is <code>false</code>, <code>null</code> is returned.</li> |
| </ul></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#getSession(boolean)">getSession</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>create</code> - boolean argument determining if a new session should be created or not if there is no existing session.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the application <code>Session</code> associated with this <code>Subject</code> or <code>null</code> based |
| on the above described logic.</dd></dl> |
| </li> |
| </ul> |
| <a name="createSessionContext()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>createSessionContext</h4> |
| <pre>protected <a href="../../../../../org/apache/shiro/session/mgt/SessionContext.html" title="interface in org.apache.shiro.session.mgt">SessionContext</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.342">createSessionContext</a>()</pre> |
| </li> |
| </ul> |
| <a name="logout()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>logout</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.360">logout</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#logout()">Subject</a></code></strong></div> |
| <div class="block">Logs out this Subject and invalidates and/or removes any associated entities, |
| such as a <a href="../../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session"><code>Session</code></a> and authorization data. After this method is called, the Subject is |
| considered 'anonymous' and may continue to be used for another log-in if desired. |
| <h3>Web Environment Warning</h3> |
| Calling this method in web environments will usually remove any associated session cookie as part of |
| session invalidation. Because cookies are part of the HTTP header, and headers can only be set before the |
| response body (html, image, etc) is sent, this method in web environments must be called before <em>any</em> |
| content has been rendered. |
| <p/> |
| The typical approach most applications use in this scenario is to redirect the user to a different |
| location (e.g. home page) immediately after calling this method. This is an effect of the HTTP protocol |
| itself and not a reflection of Shiro's implementation. |
| <p/> |
| Non-HTTP environments may of course use a logged-out subject for login again if desired.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#logout()">logout</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="execute(java.util.concurrent.Callable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>execute</h4> |
| <pre>public <V> V <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.380">execute</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V> callable) |
| throws <a href="../../../../../org/apache/shiro/subject/ExecutionException.html" title="class in org.apache.shiro.subject">ExecutionException</a></pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#execute(java.util.concurrent.Callable)">Subject</a></code></strong></div> |
| <div class="block">Associates the specified <code>Callable</code> with this <code>Subject</code> instance and then executes it on the |
| currently running thread. If you want to execute the <code>Callable</code> on a different thread, it is better to |
| use the <a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.util.concurrent.Callable)"><code>Subject.associateWith(Callable)</code></a> method instead.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#execute(java.util.concurrent.Callable)">execute</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Type Parameters:</span></dt><dd><code>V</code> - the type of return value the <code>Callable</code> will return</dd><dt><span class="strong">Parameters:</span></dt><dd><code>callable</code> - the Callable to associate with this subject and then execute.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the resulting object returned by the <code>Callable</code>'s execution.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/ExecutionException.html" title="class in org.apache.shiro.subject">ExecutionException</a></code> - if the <code>Callable</code>'s <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true#call()" title="class or interface in java.util.concurrent"><code>call</code></a> method throws an exception.</dd></dl> |
| </li> |
| </ul> |
| <a name="execute(java.lang.Runnable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>execute</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.389">execute</a>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a> runnable)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#execute(java.lang.Runnable)">Subject</a></code></strong></div> |
| <div class="block">Associates the specified <code>Runnable</code> with this <code>Subject</code> instance and then executes it on the |
| currently running thread. If you want to execute the <code>Runnable</code> on a different thread, it is better to |
| use the <a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.lang.Runnable)"><code>Subject.associateWith(Runnable)</code></a> method instead. |
| <p/> |
| <b>Note</b>: This method is primarily provided to execute existing/legacy Runnable implementations. It is better |
| for new code to use <a href="../../../../../org/apache/shiro/subject/Subject.html#execute(java.util.concurrent.Callable)"><code>Subject.execute(Callable)</code></a> since that supports the ability to return values and catch |
| exceptions.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#execute(java.lang.Runnable)">execute</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>runnable</code> - the <code>Runnable</code> to associate with this <code>Subject</code> and then execute.</dd></dl> |
| </li> |
| </ul> |
| <a name="associateWith(java.util.concurrent.Callable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>associateWith</h4> |
| <pre>public <V> <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.394">associateWith</a>(<a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html?is-external=true" title="class or interface in java.util.concurrent">Callable</a><V> callable)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.util.concurrent.Callable)">Subject</a></code></strong></div> |
| <div class="block">Returns a <code>Callable</code> instance matching the given argument while additionally ensuring that it will |
| retain and execute under this Subject's identity. The returned object can be used with an |
| <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html?is-external=true" title="class or interface in java.util.concurrent"><code>ExecutorService</code></a> to execute as this Subject. |
| <p/> |
| This will effectively ensure that any calls to |
| <code>SecurityUtils</code>.<a href="../../../../../org/apache/shiro/SecurityUtils.html#getSubject()"><code>getSubject()</code></a> and related functionality will continue |
| to function properly on any thread that executes the returned <code>Callable</code> instance.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.util.concurrent.Callable)">associateWith</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Type Parameters:</span></dt><dd><code>V</code> - the <code>Callable</code>s return value type</dd><dt><span class="strong">Parameters:</span></dt><dd><code>callable</code> - the callable to execute as this <code>Subject</code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a <code>Callable</code> that can be run as this <code>Subject</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="associateWith(java.lang.Runnable)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>associateWith</h4> |
| <pre>public <a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.398">associateWith</a>(<a href="http://java.sun.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a> runnable)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.lang.Runnable)">Subject</a></code></strong></div> |
| <div class="block">Returns a <code>Runnable</code> instance matching the given argument while additionally ensuring that it will |
| retain and execute under this Subject's identity. The returned object can be used with an |
| <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Executor.html?is-external=true" title="class or interface in java.util.concurrent"><code>Executor</code></a> or another thread to execute as this Subject. |
| <p/> |
| This will effectively ensure that any calls to |
| <code>SecurityUtils</code>.<a href="../../../../../org/apache/shiro/SecurityUtils.html#getSubject()"><code>getSubject()</code></a> and related functionality will continue |
| to function properly on any thread that executes the returned <code>Runnable</code> instance. |
| <p/> |
| *Note that if you need a return value to be returned as a result of the runnable's execution or if you need to |
| react to any Exceptions, it is highly recommended to use the |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.util.concurrent.Callable)"><code>createCallable</code></a> method instead of this one.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.lang.Runnable)">associateWith</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>runnable</code> - the runnable to execute as this <code>Subject</code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a <code>Runnable</code> that can be run as this <code>Subject</code> on another thread.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#associateWith(java.util.concurrent.Callable)"><code>(java.util.concurrent.Callable)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="runAs(org.apache.shiro.subject.PrincipalCollection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>runAs</h4> |
| <pre>public void <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.429">runAs</a>(<a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> principals)</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)">Subject</a></code></strong></div> |
| <div class="block">Allows this subject to 'run as' or 'assume' another identity indefinitely. This can only be |
| called when the <code>Subject</code> instance already has an identity (i.e. they are remembered from a previous |
| log-in or they have authenticated during their current session). |
| <p/> |
| Some notes about <code>runAs</code>: |
| <ul> |
| <li>You can tell if a <code>Subject</code> is 'running as' another identity by calling the |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#isRunAs()"><code>isRunAs()</code></a> method.</li> |
| <li>If running as another identity, you can determine what the previous 'pre run as' identity |
| was by calling the <a href="../../../../../org/apache/shiro/subject/Subject.html#getPreviousPrincipals()"><code>getPreviousPrincipals()</code></a> method.</li> |
| <li>When you want a <code>Subject</code> to stop running as another identity, you can return to its previous |
| 'pre run as' identity by calling the <a href="../../../../../org/apache/shiro/subject/Subject.html#releaseRunAs()"><code>releaseRunAs()</code></a> method.</li> |
| </ul></div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)">runAs</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the identity to 'run as', aka the identity to <em>assume</em> indefinitely.</dd></dl> |
| </li> |
| </ul> |
| <a name="isRunAs()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isRunAs</h4> |
| <pre>public boolean <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.440">isRunAs</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#isRunAs()">Subject</a></code></strong></div> |
| <div class="block">Returns <code>true</code> if this <code>Subject</code> is 'running as' another identity other than its original one or |
| <code>false</code> otherwise (normal <code>Subject</code> state). See the <a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>runAs</code></a> method for more |
| information.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#isRunAs()">isRunAs</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>true</code> if this <code>Subject</code> is 'running as' another identity other than its original one or |
| <code>false</code> otherwise (normal <code>Subject</code> state).</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>Subject.runAs(org.apache.shiro.subject.PrincipalCollection)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="getPreviousPrincipals()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getPreviousPrincipals</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.445">getPreviousPrincipals</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPreviousPrincipals()">Subject</a></code></strong></div> |
| <div class="block">Returns the previous 'pre run as' identity of this <code>Subject</code> before assuming the current |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>runAs</code></a> identity, or <code>null</code> if this <code>Subject</code> is not operating under an assumed |
| identity (normal state). See the <a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>runAs</code></a> method for more information.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#getPreviousPrincipals()">getPreviousPrincipals</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the previous 'pre run as' identity of this <code>Subject</code> before assuming the current |
| <a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>runAs</code></a> identity, or <code>null</code> if this <code>Subject</code> is not operating under an assumed |
| identity (normal state).</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>Subject.runAs(org.apache.shiro.subject.PrincipalCollection)</code></a></dd></dl> |
| </li> |
| </ul> |
| <a name="releaseRunAs()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>releaseRunAs</h4> |
| <pre>public <a href="../../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a> <a href="../../../../../src-html/org/apache/shiro/subject/support/DelegatingSubject.html#line.461">releaseRunAs</a>()</pre> |
| <div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/shiro/subject/Subject.html#releaseRunAs()">Subject</a></code></strong></div> |
| <div class="block">Releases the current 'run as' (assumed) identity and reverts back to the previous 'pre run as' |
| identity that existed before <code>#runAs runAs</code> was called. |
| <p/> |
| This method returne 'run as' (assumed) identity being released or <code>null</code> if this <code>Subject</code> is not |
| operating under an assumed identity.</div> |
| <dl> |
| <dt><strong>Specified by:</strong></dt> |
| <dd><code><a href="../../../../../org/apache/shiro/subject/Subject.html#releaseRunAs()">releaseRunAs</a></code> in interface <code><a href="../../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the 'run as' (assumed) identity being released or <code>null</code> if this <code>Subject</code> is not operating |
| under an assumed identity.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/subject/Subject.html#runAs(org.apache.shiro.subject.PrincipalCollection)"><code>Subject.runAs(org.apache.shiro.subject.PrincipalCollection)</code></a></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/DelegatingSubject.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/subject/support/DefaultSubjectContext.html" title="class in org.apache.shiro.subject.support"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/shiro/subject/support/DisabledSessionException.html" title="class in org.apache.shiro.subject.support"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/shiro/subject/support/DelegatingSubject.html" target="_top">Frames</a></li> |
| <li><a href="DelegatingSubject.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><a href="#field_summary">Field</a> | </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><a href="#field_detail">Field</a> | </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> |
| |