blob: a2d5b203b6e8103959bd964d9d76476110b93e63 [file] [log] [blame]
<!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_25) on Wed May 25 23:25:56 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>SubjectContext (Apache Shiro 1.2.5 API)</title>
<meta name="date" content="2016-05-25">
<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="SubjectContext (Apache Shiro 1.2.5 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/SubjectContext.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/Subject.Builder.html" title="class in org.apache.shiro.subject"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/shiro/subject/SubjectContext.html" target="_top">Frames</a></li>
<li><a href="SubjectContext.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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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</div>
<h2 title="Interface SubjectContext" class="title">Interface SubjectContext</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</dd>
</dl>
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../org/apache/shiro/web/subject/WebSubjectContext.html" title="interface in org.apache.shiro.web.subject">WebSubjectContext</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/shiro/subject/support/DefaultSubjectContext.html" title="class in org.apache.shiro.subject.support">DefaultSubjectContext</a>, <a href="../../../../org/apache/shiro/web/subject/support/DefaultWebSubjectContext.html" title="class in org.apache.shiro.web.subject.support">DefaultWebSubjectContext</a></dd>
</dl>
<hr>
<br>
<pre>public interface <a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.59">SubjectContext</a>
extends <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<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="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</pre>
<div class="block">A <code>SubjectContext</code> is a 'bucket' of data presented to a <a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt"><code>SecurityManager</code></a> which interprets
this data to construct <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instances. It is essentially a Map of data
with a few additional type-safe methods for easy retrieval of objects commonly used to construct Subject instances.
<p/>
While this interface contains type-safe setters and getters for common data types, the map can contain anything
additional that might be needed by the <a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt"><code>SecurityManager</code></a> or
<a href="../../../../org/apache/shiro/mgt/SubjectFactory.html" title="interface in org.apache.shiro.mgt"><code>SubjectFactory</code></a> implementation to construct <code>Subject</code> instances.
<h2>Data Resolution</h2>
The <a href="../../../../org/apache/shiro/subject/SubjectContext.html" title="interface in org.apache.shiro.subject"><code>SubjectContext</code></a> interface also allows for heuristic resolution of data used to construct a subject
instance. That is, if an attribute has not been explicitly provided via a setter method, the <code>resolve*</code>
methods can use heuristics to obtain that data in another way from other attributes.
<p/>
For example, if one calls <a href="../../../../org/apache/shiro/subject/SubjectContext.html#getPrincipals()"><code>getPrincipals()</code></a> and no principals are returned, perhaps the principals exist
in the <a href="../../../../org/apache/shiro/subject/SubjectContext.html#getSession()"><code>session</code></a> or another attribute in the context. The <a href="../../../../org/apache/shiro/subject/SubjectContext.html#resolvePrincipals()"><code>resolvePrincipals()</code></a> will know
how to resolve the principals based on heuristics. If the <code>resolve*</code> methods return <code>null</code> then the
data could not be achieved by any heuristics and must be considered as not available in the context.
<p/>
The general idea is that the normal getters can be called to see if the value was explicitly set. The
<code>resolve*</code> methods should be used when actually constructing the <code>Subject</code> instance to ensure the most
specific/accurate data can be used.
<p/>
<b>USAGE</b>: Most Shiro end-users will never use a <code>SubjectContext</code> instance directly and instead will use a
<a href="../../../../org/apache/shiro/subject/Subject.Builder.html" title="class in org.apache.shiro.subject"><code>Subject.Builder</code></a> (which internally uses a <code>SubjectContext</code>) and build <code>Subject</code> instances that
way.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/shiro/mgt/SecurityManager.html#createSubject(org.apache.shiro.subject.SubjectContext)"><code>SecurityManager.createSubject</code></a>,
<a href="../../../../org/apache/shiro/mgt/SubjectFactory.html" title="interface in org.apache.shiro.mgt"><code>SubjectFactory</code></a></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_java.util.Map">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;java.util.<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></h3>
<code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">Map.Entry</a>&lt;<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">K</a>,<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.Entry.html?is-external=true" title="class or interface in java.util">V</a>&gt;</code></li>
</ul>
</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">&nbsp;</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><a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#getAuthenticationInfo()">getAuthenticationInfo</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#getAuthenticationToken()">getAuthenticationToken</a></strong>()</code>&nbsp;</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/SubjectContext.html#getHost()">getHost</a></strong>()</code>
<div class="block">Returns the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</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/SubjectContext.html#getPrincipals()">getPrincipals</a></strong>()</code>
<div class="block">Returns the principals (aka identity) that the constructed <code>Subject</code> should reflect.</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/SubjectContext.html#getSecurityManager()">getSecurityManager</a></strong>()</code>
<div class="block">Returns the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance or
<code>null</code> if one has not yet been provided to this context.</div>
</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/SubjectContext.html#getSession()">getSession</a></strong>()</code>
<div class="block">Returns the <code>Session</code> to use when building the <code>Subject</code> instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#getSessionId()">getSessionId</a></strong>()</code>
<div class="block">Returns the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#getSubject()">getSubject</a></strong>()</code>
<div class="block">Returns any existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#isAuthenticated()">isAuthenticated</a></strong>()</code>
<div class="block">Returns <code>true</code> if the constructed <code>Subject</code> should be considered authenticated, <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/SubjectContext.html#isSessionCreationEnabled()">isSessionCreationEnabled</a></strong>()</code>
<div class="block">Returns <code>true</code> if the constructed <code>Subject</code> should be allowed to create a session, <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/SubjectContext.html#resolveAuthenticated()">resolveAuthenticated</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#resolveHost()">resolveHost</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<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/SubjectContext.html#resolvePrincipals()">resolvePrincipals</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<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/SubjectContext.html#resolveSecurityManager()">resolveSecurityManager</a></strong>()</code>
<div class="block">Resolves the <code>SecurityManager</code> instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a>
instance (typically used to support <a href="../../../../org/apache/shiro/subject/support/DelegatingSubject.html" title="class in org.apache.shiro.subject.support"><code>DelegatingSubject</code></a> implementations).</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/SubjectContext.html#resolveSession()">resolveSession</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setAuthenticated(boolean)">setAuthenticated</a></strong>(boolean&nbsp;authc)</code>
<div class="block">Sets whether or not the constructed <code>Subject</code> instance should be considered as authenticated.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setAuthenticationInfo(org.apache.shiro.authc.AuthenticationInfo)">setAuthenticationInfo</a></strong>(<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setAuthenticationToken(org.apache.shiro.authc.AuthenticationToken)">setAuthenticationToken</a></strong>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setHost(java.lang.String)">setHost</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>&nbsp;host)</code>
<div class="block">Sets the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setPrincipals(org.apache.shiro.subject.PrincipalCollection)">setPrincipals</a></strong>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</code>
<div class="block">Sets the principals (aka identity) that the constructed <code>Subject</code> should reflect.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSecurityManager(org.apache.shiro.mgt.SecurityManager)">setSecurityManager</a></strong>(<a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a>&nbsp;securityManager)</code>
<div class="block">Sets the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance
(typically used to support <a href="../../../../org/apache/shiro/subject/support/DelegatingSubject.html" title="class in org.apache.shiro.subject.support"><code>DelegatingSubject</code></a> implementations).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSession(org.apache.shiro.session.Session)">setSession</a></strong>(<a href="../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</code>
<div class="block">Sets the <code>Session</code> to use when building the <code>Subject</code> instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSessionCreationEnabled(boolean)">setSessionCreationEnabled</a></strong>(boolean&nbsp;enabled)</code>
<div class="block">Sets whether or not the constructed <code>Subject</code> instance should be allowed to create a session,
<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/SubjectContext.html#setSessionId(java.io.Serializable)">setSessionId</a></strong>(<a href="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;sessionId)</code>
<div class="block">Sets the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSubject(org.apache.shiro.subject.Subject)">setSubject</a></strong>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a>&nbsp;subject)</code>
<div class="block">Sets the existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.util.Map">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.<a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></h3>
<code><a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#clear()" title="class or interface in java.util">clear</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsKey(java.lang.Object)" title="class or interface in java.util">containsKey</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#containsValue(java.lang.Object)" title="class or interface in java.util">containsValue</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#entrySet()" title="class or interface in java.util">entrySet</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util">equals</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util">get</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#hashCode()" title="class or interface in java.util">hashCode</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util">isEmpty</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util">keySet</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#put(K, V)" title="class or interface in java.util">put</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#putAll(java.util.Map)" title="class or interface in java.util">putAll</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util">remove</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#size()" title="class or interface in java.util">size</a>, <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html?is-external=true#values()" title="class or interface in java.util">values</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getSecurityManager()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSecurityManager</h4>
<pre><a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.68">getSecurityManager</a>()</pre>
<div class="block">Returns the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance or
<code>null</code> if one has not yet been provided to this context.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance or
<code>null</code> if one has not yet been provided to this context.</dd></dl>
</li>
</ul>
<a name="setSecurityManager(org.apache.shiro.mgt.SecurityManager)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSecurityManager</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.77">setSecurityManager</a>(<a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a>&nbsp;securityManager)</pre>
<div class="block">Sets the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance
(typically used to support <a href="../../../../org/apache/shiro/subject/support/DelegatingSubject.html" title="class in org.apache.shiro.subject.support"><code>DelegatingSubject</code></a> implementations).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>securityManager</code> - the SecurityManager instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a>
instance.</dd></dl>
</li>
</ul>
<a name="resolveSecurityManager()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolveSecurityManager</h4>
<pre><a href="../../../../org/apache/shiro/mgt/SecurityManager.html" title="interface in org.apache.shiro.mgt">SecurityManager</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.86">resolveSecurityManager</a>()</pre>
<div class="block">Resolves the <code>SecurityManager</code> instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a>
instance (typically used to support <a href="../../../../org/apache/shiro/subject/support/DelegatingSubject.html" title="class in org.apache.shiro.subject.support"><code>DelegatingSubject</code></a> implementations).</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the <code>SecurityManager</code> instance that should be used to back the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a>
instance</dd></dl>
</li>
</ul>
<a name="getSessionId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSessionId</h4>
<pre><a href="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.96">getSessionId</a>()</pre>
<div class="block">Returns the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance.
<p/>
The construction process is expected to resolve the session with the specified id and then construct the Subject
instance based on the resolved session.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance.</dd></dl>
</li>
</ul>
<a name="setSessionId(java.io.Serializable)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSessionId</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.107">setSessionId</a>(<a href="http://java.sun.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>&nbsp;sessionId)</pre>
<div class="block">Sets the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a> instance.
<p/>
The construction process is expected to resolve the session with the specified id and then construct the Subject
instance based on the resolved session.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sessionId</code> - the session id of the session that should be associated with the constructed <a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><code>Subject</code></a>
instance.</dd></dl>
</li>
</ul>
<a name="getSubject()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubject</h4>
<pre><a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.121">getSubject</a>()</pre>
<div class="block">Returns any existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.
<p/>
This is typically used in the case where the existing <code>Subject</code> instance returned by
this method is unauthenticated and a new <code>Subject</code> instance is being created to reflect a successful
authentication - you want to return most of the state of the previous <code>Subject</code> instance when creating the
newly authenticated instance.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>any existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.</dd></dl>
</li>
</ul>
<a name="setSubject(org.apache.shiro.subject.Subject)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSubject</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.135">setSubject</a>(<a href="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject">Subject</a>&nbsp;subject)</pre>
<div class="block">Sets the existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.
<p/>
This is typically used in the case where the existing <code>Subject</code> instance returned by
this method is unauthenticated and a new <code>Subject</code> instance is being created to reflect a successful
authentication - you want to return most of the state of the previous <code>Subject</code> instance when creating the
newly authenticated instance.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subject</code> - the existing <code>Subject</code> that may be in use at the time the new <code>Subject</code> instance is
being created.</dd></dl>
</li>
</ul>
<a name="getPrincipals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPrincipals</h4>
<pre><a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.142">getPrincipals</a>()</pre>
<div class="block">Returns the principals (aka identity) that the constructed <code>Subject</code> should reflect.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the principals (aka identity) that the constructed <code>Subject</code> should reflect.</dd></dl>
</li>
</ul>
<a name="resolvePrincipals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolvePrincipals</h4>
<pre><a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.144">resolvePrincipals</a>()</pre>
</li>
</ul>
<a name="setPrincipals(org.apache.shiro.subject.PrincipalCollection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPrincipals</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.151">setPrincipals</a>(<a href="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject">PrincipalCollection</a>&nbsp;principals)</pre>
<div class="block">Sets the principals (aka identity) that the constructed <code>Subject</code> should reflect.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>principals</code> - the principals (aka identity) that the constructed <code>Subject</code> should reflect.</dd></dl>
</li>
</ul>
<a name="getSession()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSession</h4>
<pre><a href="../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.160">getSession</a>()</pre>
<div class="block">Returns the <code>Session</code> to use when building the <code>Subject</code> instance. Note that it is more
common to specify a <a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSessionId(java.io.Serializable)"><code>sessionId</code></a> to acquire the desired session rather than having to
construct a <code>Session</code> to be returned by this method.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the <code>Session</code> to use when building the <code>Subject</code> instance.</dd></dl>
</li>
</ul>
<a name="setSession(org.apache.shiro.session.Session)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSession</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.169">setSession</a>(<a href="../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;session)</pre>
<div class="block">Sets the <code>Session</code> to use when building the <code>Subject</code> instance. Note that it is more
common to specify a <a href="../../../../org/apache/shiro/subject/SubjectContext.html#setSessionId(java.io.Serializable)"><code>sessionId</code></a> to automatically resolve the desired session rather than
constructing a <code>Session</code> to call this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>session</code> - the <code>Session</code> to use when building the <code>Subject</code> instance.</dd></dl>
</li>
</ul>
<a name="resolveSession()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolveSession</h4>
<pre><a href="../../../../org/apache/shiro/session/Session.html" title="interface in org.apache.shiro.session">Session</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.171">resolveSession</a>()</pre>
</li>
</ul>
<a name="isAuthenticated()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAuthenticated</h4>
<pre>boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.181">isAuthenticated</a>()</pre>
<div class="block">Returns <code>true</code> if the constructed <code>Subject</code> should be considered authenticated, <code>false</code>
otherwise. Be careful setting this value to <code>true</code> - you should know what you are doing and have a good
reason for ignoring Shiro's default authentication state mechanisms.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the constructed <code>Subject</code> should be considered authenticated, <code>false</code>
otherwise.</dd></dl>
</li>
</ul>
<a name="setAuthenticated(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticated</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.190">setAuthenticated</a>(boolean&nbsp;authc)</pre>
<div class="block">Sets whether or not the constructed <code>Subject</code> instance should be considered as authenticated. Be careful
when specifying <code>true</code> - you should know what you are doing and have a good reason for ignoring Shiro's
default authentication state mechanisms.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>authc</code> - whether or not the constructed <code>Subject</code> instance should be considered as authenticated.</dd></dl>
</li>
</ul>
<a name="isSessionCreationEnabled()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSessionCreationEnabled</h4>
<pre>boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.200">isSessionCreationEnabled</a>()</pre>
<div class="block">Returns <code>true</code> if the constructed <code>Subject</code> should be allowed to create a session, <code>false</code>
otherwise. Shiro's configuration defaults to <code>true</code> as most applications find value in Sessions.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the constructed <code>Subject</code> should be 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="setSessionCreationEnabled(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSessionCreationEnabled</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.210">setSessionCreationEnabled</a>(boolean&nbsp;enabled)</pre>
<div class="block">Sets whether or not the constructed <code>Subject</code> instance should be allowed to create a session,
<code>false</code> otherwise.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>enabled</code> - whether or not the constructed <code>Subject</code> instance should be allowed to create a session,
<code>false</code> otherwise.</dd><dt><span class="strong">Since:</span></dt>
<dd>1.2</dd></dl>
</li>
</ul>
<a name="resolveAuthenticated()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resolveAuthenticated</h4>
<pre>boolean&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.212">resolveAuthenticated</a>()</pre>
</li>
</ul>
<a name="getAuthenticationInfo()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationInfo</h4>
<pre><a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.214">getAuthenticationInfo</a>()</pre>
</li>
</ul>
<a name="setAuthenticationInfo(org.apache.shiro.authc.AuthenticationInfo)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationInfo</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.216">setAuthenticationInfo</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationInfo.html" title="interface in org.apache.shiro.authc">AuthenticationInfo</a>&nbsp;info)</pre>
</li>
</ul>
<a name="getAuthenticationToken()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthenticationToken</h4>
<pre><a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.218">getAuthenticationToken</a>()</pre>
</li>
</ul>
<a name="setAuthenticationToken(org.apache.shiro.authc.AuthenticationToken)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthenticationToken</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.220">setAuthenticationToken</a>(<a href="../../../../org/apache/shiro/authc/AuthenticationToken.html" title="interface in org.apache.shiro.authc">AuthenticationToken</a>&nbsp;token)</pre>
</li>
</ul>
<a name="getHost()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHost</h4>
<pre><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>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.227">getHost</a>()</pre>
<div class="block">Returns the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</dd></dl>
</li>
</ul>
<a name="setHost(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setHost</h4>
<pre>void&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.234">setHost</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>&nbsp;host)</pre>
<div class="block">Sets the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>host</code> - the host name or IP that should reflect the constructed <code>Subject</code>'s originating location.</dd></dl>
</li>
</ul>
<a name="resolveHost()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>resolveHost</h4>
<pre><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>&nbsp;<a href="../../../../src-html/org/apache/shiro/subject/SubjectContext.html#line.236">resolveHost</a>()</pre>
</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/SubjectContext.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/Subject.Builder.html" title="class in org.apache.shiro.subject"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/shiro/subject/SubjectContext.html" target="_top">Frames</a></li>
<li><a href="SubjectContext.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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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 &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>