blob: 3262b472d5934e16e4278f6b10c1150a9b7f0c55 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>WikiSession (Apache JSPWiki 2.12.2-SNAPSHOT API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="WikiSession (Apache JSPWiki 2.12.2-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":9,"i16":9,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":9,"i26":41,"i27":41};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/WikiSession.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" id="allclasses_navbar_top">
<li><a href="../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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 id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.wiki</a></div>
<h2 title="Class WikiSession" class="title">Class WikiSession</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.wiki.WikiSession</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code>java.util.EventListener</code>, <code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code>, <code><a href="event/WikiEventListener.html" title="interface in org.apache.wiki.event">WikiEventListener</a></code></dd>
</dl>
<hr>
<object type="image/svg+xml" data="WikiSession.svg" style="max-width:60%;float:right;"></object>
<pre style="white-space:pre-wrap;">public class <a href="../../../src-html/org/apache/wiki/WikiSession.html#line.61">WikiSession</a>
extends java.lang.Object
implements <a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></pre>
<div class="block"><p>Default implementation for <a href="api/core/Session.html" title="interface in org.apache.wiki.api.core"><code>Session</code></a>.</p>
<p>In addition to methods for examining individual <code>WikiSession</code> objects, this class also contains a number of static
methods for managing WikiSessions for an entire wiki. These methods allow callers to find, query and remove WikiSession objects, and
to obtain a list of the current wiki session users.</p></div>
</li>
</ul>
</div>
<div class="summary" style="clear:right;">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.apache.wiki.api.core.Session">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;org.apache.wiki.api.core.<a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></h3>
<code><a href="api/core/Session.html#ANONYMOUS">ANONYMOUS</a>, <a href="api/core/Session.html#ASSERTED">ASSERTED</a>, <a href="api/core/Session.html#AUTHENTICATED">AUTHENTICATED</a></code></li>
</ul>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#actionPerformed(org.apache.wiki.event.WikiEvent)">actionPerformed</a></span>&#8203;(<a href="event/WikiEvent.html" title="class in org.apache.wiki.event">WikiEvent</a>&nbsp;event)</code></th>
<td class="colLast">
<div class="block">Listens for WikiEvents generated by source objects such as the GroupManager, UserManager or AuthenticationManager.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMessage(java.lang.String)">addMessage</a></span>&#8203;(java.lang.String&nbsp;message)</code></th>
<td class="colLast">
<div class="block">Adds a message to the generic list of messages associated with the session.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMessage(java.lang.String,java.lang.String)">addMessage</a></span>&#8203;(java.lang.String&nbsp;topic,
java.lang.String&nbsp;message)</code></th>
<td class="colLast">
<div class="block">Adds a message to the specific set of messages associated with the session.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#antiCsrfToken()">antiCsrfToken</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the CSRF protection Token associated with this wiki session.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearMessages()">clearMessages</a></span>()</code></th>
<td class="colLast">
<div class="block">Clears all messages associated with this session.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clearMessages(java.lang.String)">clearMessages</a></span>&#8203;(java.lang.String&nbsp;topic)</code></th>
<td class="colLast">
<div class="block">Clears all messages associated with a session topic.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.util.Locale</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLocale()">getLocale</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a cached Locale object for this user.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.security.Principal</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLoginPrincipal()">getLoginPrincipal</a></span>()</code></th>
<td class="colLast">
<div class="block"> Returns the Principal used to log in to an authenticated session.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMessages()">getMessages</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns all generic messages associated with this session.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>java.lang.String[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMessages(java.lang.String)">getMessages</a></span>&#8203;(java.lang.String&nbsp;topic)</code></th>
<td class="colLast">
<div class="block">Returns all messages associated with a session topic.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>java.security.Principal[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPrincipals()">getPrincipals</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns all user Principals associated with this session.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>java.security.Principal[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRoles()">getRoles</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns an array of Principal objects that represents the groups and roles that the user associated with a Session possesses.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStatus()">getStatus</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the status of the wiki session as a text string.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>javax.security.auth.Subject</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSubject()">getSubject</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <code>Subject</code> associated to the session.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>java.security.Principal</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUserPrincipal()">getUserPrincipal</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the primary user Principal associated with this session.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static <a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWikiSession(org.apache.wiki.api.core.Engine,javax.servlet.http.HttpServletRequest)">getWikiSession</a></span>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine,
javax.servlet.http.HttpServletRequest&nbsp;request)</code></th>
<td class="colLast">
<div class="block">Static factory method that returns the Session object associated with the current HTTP request.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static <a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#guestSession(org.apache.wiki.api.core.Engine)">guestSession</a></span>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</code></th>
<td class="colLast">
<div class="block">Static factory method that creates a new "guest" session containing a single user Principal
<a href="auth/WikiPrincipal.html#GUEST"><code>WikiPrincipal.GUEST</code></a>, plus the role principals <a href="auth/authorize/Role.html#ALL"><code>Role.ALL</code></a> and <a href="auth/authorize/Role.html#ANONYMOUS"><code>Role.ANONYMOUS</code></a>.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasPrincipal(java.security.Principal)">hasPrincipal</a></span>&#8203;(java.security.Principal&nbsp;principal)</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code> if the Session's Subject possess a supplied Principal.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#injectGroupPrincipals()">injectGroupPrincipals</a></span>()</code></th>
<td class="colLast">
<div class="block">Injects GroupPrincipal objects into the user's Principal set based on the groups the user belongs to.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#injectUserProfilePrincipals()">injectUserProfilePrincipals</a></span>()</code></th>
<td class="colLast">
<div class="block">Adds Principal objects to the Subject that correspond to the logged-in user's profile attributes for the wiki name, full name
and login name.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#invalidate()">invalidate</a></span>()</code></th>
<td class="colLast">
<div class="block">Invalidates the Session and resets its Subject's Principals to the equivalent of a "guest session".</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAnonymous()">isAnonymous</a></span>()</code></th>
<td class="colLast">
<div class="block">Determines whether the current session is anonymous.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAsserted()">isAsserted</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code> if the user is considered asserted via a session cookie; that is, the Subject contains the Principal
Role.ASSERTED.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAuthenticated()">isAuthenticated</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the authentication status of the user's session.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isInGroup(org.apache.wiki.auth.authorize.Group)">isInGroup</a></span>&#8203;(<a href="auth/authorize/Group.html" title="class in org.apache.wiki.auth.authorize">Group</a>&nbsp;group)</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code> if one of this WikiSession's user Principals can be shown to belong to a particular wiki group.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeWikiSession(org.apache.wiki.api.core.Engine,javax.servlet.http.HttpServletRequest)">removeWikiSession</a></span>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine,
javax.servlet.http.HttpServletRequest&nbsp;request)</code></th>
<td class="colLast">
<div class="block">Removes the wiki session associated with the user's HTTP request from the cache of wiki sessions, typically as part of a
logout process.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sessions(org.apache.wiki.api.core.Engine)">sessions</a></span>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="auth/SessionMonitor.html#sessions()"><code>SessionMonitor.sessions()</code></a> instead</div>
</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>static java.security.Principal[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#userPrincipals(org.apache.wiki.api.core.Engine)">userPrincipals</a></span>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="auth/SessionMonitor.html#userPrincipals()"><code>SessionMonitor.userPrincipals()</code></a> instead</div>
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="isInGroup(org.apache.wiki.auth.authorize.Group)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInGroup</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.92">isInGroup</a>&#8203;(<a href="auth/authorize/Group.html" title="class in org.apache.wiki.auth.authorize">Group</a>&nbsp;group)</pre>
<div class="block">Returns <code>true</code> if one of this WikiSession's user Principals can be shown to belong to a particular wiki group. If
the user is not authenticated, this method will always return <code>false</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>group</code> - the group to test</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the result</dd>
</dl>
</li>
</ul>
<a id="isAsserted()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAsserted</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.103">isAsserted</a>()</pre>
<div class="block">Returns <code>true</code> if the user is considered asserted via a session cookie; that is, the Subject contains the Principal
Role.ASSERTED.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#isAsserted()">isAsserted</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns <code>true</code> if the user is asserted</dd>
</dl>
</li>
</ul>
<a id="isAuthenticated()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAuthenticated</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.109">isAuthenticated</a>()</pre>
<div class="block">Returns the authentication status of the user's session. The user is considered authenticated if the Subject contains the
Principal Role.AUTHENTICATED. If this method determines that an earlier LoginModule did not inject Role.AUTHENTICATED, it
will inject one if the user is not anonymous <em>and</em> not asserted.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#isAuthenticated()">isAuthenticated</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns <code>true</code> if the user is authenticated</dd>
</dl>
</li>
</ul>
<a id="isAnonymous()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAnonymous</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.126">isAnonymous</a>()</pre>
<div class="block"><p>Determines whether the current session is anonymous. This will be true if any of these conditions are true:</p>
<ul>
<li>The session's Principal set contains <a href="auth/authorize/Role.html#ANONYMOUS"><code>Role.ANONYMOUS</code></a></li>
<li>The session's Principal set contains <a href="auth/WikiPrincipal.html#GUEST"><code>WikiPrincipal.GUEST</code></a></li>
<li>The Principal returned by <a href="api/core/Session.html#getUserPrincipal()"><code>Session.getUserPrincipal()</code></a> evaluates to an IP address.</li>
</ul>
<p>The criteria above are listed in the order in which they are evaluated.</p></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#isAnonymous()">isAnonymous</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether the current user's identity is equivalent to an IP address</dd>
</dl>
</li>
</ul>
<a id="getLoginPrincipal()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLoginPrincipal</h4>
<pre class="methodSignature">public&nbsp;java.security.Principal&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.135">getLoginPrincipal</a>()</pre>
<div class="block"><p> Returns the Principal used to log in to an authenticated session. The login principal is determined by examining the
Subject's Principal set for PrincipalWrappers or WikiPrincipals with type designator <code>LOGIN_NAME</code>; the first one
found is the login principal. If one is not found, this method returns the first principal that isn't of type Role or
GroupPrincipal. If neither of these conditions hold, this method returns
<a href="auth/WikiPrincipal.html#GUEST"><code>WikiPrincipal.GUEST</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getLoginPrincipal()">getLoginPrincipal</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the login Principal. If it is a PrincipalWrapper containing an externally-provided Principal, the object returned is the
Principal, not the wrapper around it.</dd>
</dl>
</li>
</ul>
<a id="getUserPrincipal()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserPrincipal</h4>
<pre class="methodSignature">public&nbsp;java.security.Principal&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.141">getUserPrincipal</a>()</pre>
<div class="block"><p>Returns the primary user Principal associated with this session. The primary user principal is determined as follows:</p>
<ol>
<li>If the Subject's Principal set contains WikiPrincipals, the first WikiPrincipal with type designator
<code>WIKI_NAME</code> or (alternatively) <code>FULL_NAME</code> is the primary Principal.</li>
<li>For all other cases, the first Principal in the Subject's principal collection that that isn't of type Role or
GroupPrincipal is the primary.</li>
</ol>
If no primary user Principal is found, this method returns <a href="auth/WikiPrincipal.html#GUEST"><code>WikiPrincipal.GUEST</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getUserPrincipal()">getUserPrincipal</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the primary user Principal</dd>
</dl>
</li>
</ul>
<a id="antiCsrfToken()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>antiCsrfToken</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.147">antiCsrfToken</a>()</pre>
<div class="block">Returns the CSRF protection Token associated with this wiki session.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#antiCsrfToken()">antiCsrfToken</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the CSRF protection Token associated with this wiki session.</dd>
</dl>
</li>
</ul>
<a id="getLocale()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocale</h4>
<pre class="methodSignature">public&nbsp;java.util.Locale&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.153">getLocale</a>()</pre>
<div class="block">Returns a cached Locale object for this user. It's better to use WikiContext's corresponding getBundle() method, since that
will actually react if the user changes the locale in the middle, but if that's not available (or, for some reason, you need
the speed), this method can also be used. The Locale expires when the Session expires, and currently there is no way to
reset the Locale.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getLocale()">getLocale</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A cached Locale object</dd>
</dl>
</li>
</ul>
<a id="addMessage(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMessage</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.159">addMessage</a>&#8203;(java.lang.String&nbsp;message)</pre>
<div class="block">Adds a message to the generic list of messages associated with the session. These messages retain their order of insertion and
remain until the <a href="api/core/Session.html#clearMessages()"><code>Session.clearMessages()</code></a> method is called.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#addMessage(java.lang.String)">addMessage</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>message</code> - the message to add; if <code>null</code> it is ignored.</dd>
</dl>
</li>
</ul>
<a id="addMessage(java.lang.String,java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMessage</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.165">addMessage</a>&#8203;(java.lang.String&nbsp;topic,
java.lang.String&nbsp;message)</pre>
<div class="block">Adds a message to the specific set of messages associated with the session. These messages retain their order of insertion and
remain until the <a href="api/core/Session.html#clearMessages()"><code>Session.clearMessages()</code></a> method is called.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#addMessage(java.lang.String,java.lang.String)">addMessage</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>topic</code> - the topic to associate the message to;</dd>
<dd><code>message</code> - the message to add</dd>
</dl>
</li>
</ul>
<a id="clearMessages()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearMessages</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.175">clearMessages</a>()</pre>
<div class="block">Clears all messages associated with this session.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#clearMessages()">clearMessages</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
</dl>
</li>
</ul>
<a id="clearMessages(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearMessages</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.181">clearMessages</a>&#8203;(java.lang.String&nbsp;topic)</pre>
<div class="block">Clears all messages associated with a session topic.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#clearMessages(java.lang.String)">clearMessages</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>topic</code> - the topic whose messages should be cleared.</dd>
</dl>
</li>
</ul>
<a id="getMessages()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessages</h4>
<pre class="methodSignature">public&nbsp;java.lang.String[]&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.190">getMessages</a>()</pre>
<div class="block">Returns all generic messages associated with this session. The messages stored with the session persist throughout the
session unless they have been reset with <a href="api/core/Session.html#clearMessages()"><code>Session.clearMessages()</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getMessages()">getMessages</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current messages.</dd>
</dl>
</li>
</ul>
<a id="getMessages(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessages</h4>
<pre class="methodSignature">public&nbsp;java.lang.String[]&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.196">getMessages</a>&#8203;(java.lang.String&nbsp;topic)</pre>
<div class="block">Returns all messages associated with a session topic. The messages stored with the session persist throughout the
session unless they have been reset with <a href="api/core/Session.html#clearMessages(java.lang.String)"><code>Session.clearMessages(String)</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getMessages(java.lang.String)">getMessages</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>topic</code> - The topic</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current messages.</dd>
</dl>
</li>
</ul>
<a id="getPrincipals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPrincipals</h4>
<pre class="methodSignature">public&nbsp;java.security.Principal[]&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.206">getPrincipals</a>()</pre>
<div class="block">Returns all user Principals associated with this session. User principals are those in the Subject's principal collection that
aren't of type Role or of type GroupPrincipal. This is a defensive copy.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getPrincipals()">getPrincipals</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the user principal</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="auth/AuthenticationManager.html#isUserPrincipal(java.security.Principal)"><code>AuthenticationManager.isUserPrincipal(Principal)</code></a></dd>
</dl>
</li>
</ul>
<a id="getRoles()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRoles</h4>
<pre class="methodSignature">public&nbsp;java.security.Principal[]&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.215">getRoles</a>()</pre>
<div class="block">Returns an array of Principal objects that represents the groups and roles that the user associated with a Session possesses.
The array is built by iterating through the Subject's Principal set and extracting all Role and GroupPrincipal objects into a
list. The list is returned as an array sorted in the natural order implied by each Principal's <code>getName</code> method. Note
that this method does <em>not</em> consult the external Authorizer or GroupManager; it relies on the Principals that have been
injected into the user's Subject at login time, or after group creation/modification/deletion.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getRoles()">getRoles</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of Principal objects corresponding to the roles the Subject possesses</dd>
</dl>
</li>
</ul>
<a id="hasPrincipal(java.security.Principal)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasPrincipal</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.232">hasPrincipal</a>&#8203;(java.security.Principal&nbsp;principal)</pre>
<div class="block">Returns <code>true</code> if the Session's Subject possess a supplied Principal. This method eliminates the need to externally
request and inspect the JAAS subject.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#hasPrincipal(java.security.Principal)">hasPrincipal</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>principal</code> - the Principal to test</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the result</dd>
</dl>
</li>
</ul>
<a id="actionPerformed(org.apache.wiki.event.WikiEvent)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>actionPerformed</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.243">actionPerformed</a>&#8203;(<a href="event/WikiEvent.html" title="class in org.apache.wiki.event">WikiEvent</a>&nbsp;event)</pre>
<div class="block">Listens for WikiEvents generated by source objects such as the GroupManager, UserManager or AuthenticationManager. This method adds
Principals to the private Subject managed by the WikiSession.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="event/WikiEventListener.html#actionPerformed(org.apache.wiki.event.WikiEvent)">actionPerformed</a></code>&nbsp;in interface&nbsp;<code><a href="event/WikiEventListener.html" title="interface in org.apache.wiki.event">WikiEventListener</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>event</code> - a WikiEvent object</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="event/WikiEventListener.html#actionPerformed(org.apache.wiki.event.WikiEvent)"><code>WikiEventListener.actionPerformed(WikiEvent)</code></a></dd>
</dl>
</li>
</ul>
<a id="invalidate()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invalidate</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.369">invalidate</a>()</pre>
<div class="block">Invalidates the Session and resets its Subject's Principals to the equivalent of a "guest session".</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#invalidate()">invalidate</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
</dl>
</li>
</ul>
<a id="injectGroupPrincipals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>injectGroupPrincipals</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.387">injectGroupPrincipals</a>()</pre>
<div class="block">Injects GroupPrincipal objects into the user's Principal set based on the groups the user belongs to. For Groups, the algorithm
first calls the <a href="auth/Authorizer.html#getRoles()"><code>Authorizer.getRoles()</code></a> to obtain the array of GroupPrincipals the authorizer knows about. Then, the
method <a href="auth/Authorizer.html#isUserInRole(org.apache.wiki.api.core.Session,java.security.Principal)"><code>Authorizer.isUserInRole(Session, Principal)</code></a> is called for each Principal. If the user is a member of the
group, an equivalent GroupPrincipal is injected into the user's principal set. Existing GroupPrincipals are flushed and replaced.
This method should generally be called after a user's <a href="auth/user/UserProfile.html" title="interface in org.apache.wiki.auth.user"><code>UserProfile</code></a> is saved. If the wiki session
is null, or there is no matching user profile, the method returns silently.</div>
</li>
</ul>
<a id="injectUserProfilePrincipals()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>injectUserProfilePrincipals</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.405">injectUserProfilePrincipals</a>()</pre>
<div class="block">Adds Principal objects to the Subject that correspond to the logged-in user's profile attributes for the wiki name, full name
and login name. These Principals will be WikiPrincipals, and they will replace all other WikiPrincipals in the Subject. <em>Note:
this method is never called during anonymous or asserted sessions.</em></div>
</li>
</ul>
<a id="getStatus()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStatus</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.443">getStatus</a>()</pre>
<div class="block"><p>Returns the status of the wiki session as a text string. Valid values are:</p>
<ul>
<li><a href="api/core/Session.html#AUTHENTICATED"><code>Session.AUTHENTICATED</code></a></li>
<li><a href="api/core/Session.html#ASSERTED"><code>Session.ASSERTED</code></a></li>
<li><a href="api/core/Session.html#ANONYMOUS"><code>Session.ANONYMOUS</code></a></li>
</ul></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getStatus()">getStatus</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the user's session status</dd>
</dl>
</li>
</ul>
<a id="getSubject()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubject</h4>
<pre class="methodSignature">public&nbsp;javax.security.auth.Subject&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.449">getSubject</a>()</pre>
<div class="block">Returns the <code>Subject</code> associated to the session.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="api/core/Session.html#getSubject()">getSubject</a></code>&nbsp;in interface&nbsp;<code><a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>Subject</code> associated to the session.</dd>
</dl>
</li>
</ul>
<a id="removeWikiSession(org.apache.wiki.api.core.Engine,javax.servlet.http.HttpServletRequest)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeWikiSession</h4>
<pre class="methodSignature">public static&nbsp;void&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.461">removeWikiSession</a>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine,
javax.servlet.http.HttpServletRequest&nbsp;request)</pre>
<div class="block">Removes the wiki session associated with the user's HTTP request from the cache of wiki sessions, typically as part of a
logout process.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>engine</code> - the wiki engine</dd>
<dd><code>request</code> - the user's HTTP request</dd>
</dl>
</li>
</ul>
<a id="getWikiSession(org.apache.wiki.api.core.Engine,javax.servlet.http.HttpServletRequest)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWikiSession</h4>
<pre class="methodSignature">public static&nbsp;<a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a>&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.483">getWikiSession</a>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine,
javax.servlet.http.HttpServletRequest&nbsp;request)</pre>
<div class="block"><p>Static factory method that returns the Session object associated with the current HTTP request. This method looks up
the associated HttpSession in an internal WeakHashMap and attempts to retrieve the WikiSession. If not found, one is created.
This method is guaranteed to always return a Session, although the authentication status is unpredictable until the user
attempts to log in. If the servlet request parameter is <code>null</code>, a synthetic <a href="#guestSession(org.apache.wiki.api.core.Engine)"><code>guestSession(Engine)</code></a> is
returned.</p>
<p>When a session is created, this method attaches a WikiEventListener to the GroupManager, UserManager and AuthenticationManager,
so that changes to users, groups, logins, etc. are detected automatically.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>engine</code> - the engine</dd>
<dd><code>request</code> - the servlet request object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the existing (or newly created) session</dd>
</dl>
</li>
</ul>
<a id="guestSession(org.apache.wiki.api.core.Engine)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>guestSession</h4>
<pre class="methodSignature">public static&nbsp;<a href="api/core/Session.html" title="interface in org.apache.wiki.api.core">Session</a>&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.508">guestSession</a>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</pre>
<div class="block">Static factory method that creates a new "guest" session containing a single user Principal
<a href="auth/WikiPrincipal.html#GUEST"><code>WikiPrincipal.GUEST</code></a>, plus the role principals <a href="auth/authorize/Role.html#ALL"><code>Role.ALL</code></a> and <a href="auth/authorize/Role.html#ANONYMOUS"><code>Role.ANONYMOUS</code></a>. This
method also adds the session as a listener for GroupManager, AuthenticationManager and UserManager events.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>engine</code> - the wiki engine</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the guest wiki session</dd>
</dl>
</li>
</ul>
<a id="sessions(org.apache.wiki.api.core.Engine)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>sessions</h4>
<pre class="methodSignature">@Deprecated
public static&nbsp;int&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.552">sessions</a>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="auth/SessionMonitor.html#sessions()"><code>SessionMonitor.sessions()</code></a> instead</div>
</div>
<div class="block">Returns the total number of active wiki sessions for a particular wiki. This method delegates to the wiki's
<a href="auth/SessionMonitor.html#sessions()"><code>SessionMonitor.sessions()</code></a> method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>engine</code> - the wiki session</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of sessions</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="auth/SessionMonitor.html#sessions()"><code>SessionMonitor.sessions()</code></a></dd>
</dl>
</li>
</ul>
<a id="userPrincipals(org.apache.wiki.api.core.Engine)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>userPrincipals</h4>
<pre class="methodSignature">@Deprecated
public static&nbsp;java.security.Principal[]&nbsp;<a href="../../../src-html/org/apache/wiki/WikiSession.html#line.568">userPrincipals</a>&#8203;(<a href="api/core/Engine.html" title="interface in org.apache.wiki.api.core">Engine</a>&nbsp;engine)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">use <a href="auth/SessionMonitor.html#userPrincipals()"><code>SessionMonitor.userPrincipals()</code></a> instead</div>
</div>
<div class="block">Returns Principals representing the current users known to a particular wiki. Each Principal will correspond to the
value returned by each WikiSession's <a href="#getUserPrincipal()"><code>getUserPrincipal()</code></a> method. This method delegates to
<a href="auth/SessionMonitor.html#userPrincipals()"><code>SessionMonitor.userPrincipals()</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>engine</code> - the wiki engine</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of Principal objects, sorted by name</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="auth/SessionMonitor.html#userPrincipals()"><code>SessionMonitor.userPrincipals()</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/WikiSession.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" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses.html">All&nbsp;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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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 id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright (c) 2001-2023 The Apache Software Foundation. All rights reserved.</small></p>
</footer>
</body>
</html>