| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!--NewPage--> |
| <HTML> |
| <HEAD> |
| <!-- Generated by javadoc (build 1.6.0_65) on Tue Feb 25 18:15:50 EST 2014 --> |
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <TITLE> |
| PrincipalCollection (Apache Shiro 1.2.3 API) |
| </TITLE> |
| |
| <META NAME="date" CONTENT="2014-02-25"> |
| |
| <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> |
| |
| <SCRIPT type="text/javascript"> |
| function windowTitle() |
| { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PrincipalCollection (Apache Shiro 1.2.3 API)"; |
| } |
| } |
| </SCRIPT> |
| <NOSCRIPT> |
| </NOSCRIPT> |
| |
| </HEAD> |
| |
| <BODY BGCOLOR="white" onload="windowTitle();"> |
| <HR> |
| |
| |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <A NAME="navbar_top"><!-- --></A> |
| <A HREF="#skip-navbar_top" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_top_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PrincipalCollection.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../org/apache/shiro/subject/MutablePrincipalCollection.html" title="interface in org.apache.shiro.subject"><B>PREV CLASS</B></A> |
| <A HREF="../../../../org/apache/shiro/subject/PrincipalMap.html" title="interface in org.apache.shiro.subject"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/apache/shiro/subject/PrincipalCollection.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="PrincipalCollection.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_top"></A> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| |
| <HR> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <H2> |
| <FONT SIZE="-1"> |
| org.apache.shiro.subject</FONT> |
| <BR> |
| Interface PrincipalCollection</H2> |
| <DL> |
| <DT><B>All Superinterfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</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></DD> |
| </DL> |
| <DL> |
| <DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/apache/shiro/subject/MutablePrincipalCollection.html" title="interface in org.apache.shiro.subject">MutablePrincipalCollection</A>, <A HREF="../../../../org/apache/shiro/subject/PrincipalMap.html" title="interface in org.apache.shiro.subject">PrincipalMap</A></DD> |
| </DL> |
| <DL> |
| <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/apache/shiro/subject/SimplePrincipalCollection.html" title="class in org.apache.shiro.subject">SimplePrincipalCollection</A>, <A HREF="../../../../org/apache/shiro/subject/SimplePrincipalMap.html" title="class in org.apache.shiro.subject">SimplePrincipalMap</A></DD> |
| </DL> |
| <HR> |
| <DL> |
| <DT><PRE>public interface <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.40"><B>PrincipalCollection</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</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></DL> |
| </PRE> |
| |
| <P> |
| A collection of all principals associated with a corresponding <A HREF="../../../../org/apache/shiro/subject/Subject.html" title="interface in org.apache.shiro.subject"><CODE>Subject</CODE></A>. A <em>principal</em> is |
| just a security term for an identifying attribute, such as a username or user id or social security number or |
| anything else that can be considered an 'identifying' attribute for a <code>Subject</code>. |
| <p/> |
| A PrincipalCollection organizes its internal principals based on the <code>Realm</code> where they came from when the |
| Subject was first created. To obtain the principal(s) for a specific Realm, see the <A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#fromRealm(java.lang.String)"><CODE>fromRealm(java.lang.String)</CODE></A> method. You |
| can also see which realms contributed to this collection via the <A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#getRealmNames()"><CODE>getRealmNames()</CODE></A> method. |
| <P> |
| |
| <P> |
| <DL> |
| <DT><B>Since:</B></DT> |
| <DD>0.9</DD> |
| <DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#getPrimaryPrincipal()"><CODE>getPrimaryPrincipal()</CODE></A>, |
| <A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#fromRealm(java.lang.String)"><CODE>fromRealm(String realmName)</CODE></A>, |
| <A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#getRealmNames()"><CODE>getRealmNames()</CODE></A></DL> |
| <HR> |
| |
| <P> |
| |
| <!-- ========== METHOD SUMMARY =========== --> |
| |
| <A NAME="method_summary"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> |
| <B>Method Summary</B></FONT></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#asList()">asList</A></B>()</CODE> |
| |
| <BR> |
| Returns a single Subject's principals retrieved from all configured Realms as a List, or an empty List if |
| there are not any principals.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#asSet()">asSet</A></B>()</CODE> |
| |
| <BR> |
| Returns a single Subject's principals retrieved from all configured Realms as a Set, or an empty Set if there |
| are not any principals.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><T> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><T></CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#byType(java.lang.Class)">byType</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</CODE> |
| |
| <BR> |
| Returns all principals assignable from the specified type, or an empty Collection if no principals of that |
| type are contained.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#fromRealm(java.lang.String)">fromRealm</A></B>(<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> realmName)</CODE> |
| |
| <BR> |
| Returns a single Subject's principals retrieved from the specified Realm <em>only</em> as a Collection, or an empty |
| Collection if there are not any principals from that realm.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#getPrimaryPrincipal()">getPrimaryPrincipal</A></B>()</CODE> |
| |
| <BR> |
| Returns the primary principal used application-wide to uniquely identify the owning account/Subject.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>></CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#getRealmNames()">getRealmNames</A></B>()</CODE> |
| |
| <BR> |
| Returns the realm names that this collection has principals for.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> boolean</CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#isEmpty()">isEmpty</A></B>()</CODE> |
| |
| <BR> |
| Returns <code>true</code> if this collection is empty, <code>false</code> otherwise.</TD> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| <CODE> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""> |
| <TR ALIGN="right" VALIGN=""> |
| <TD NOWRAP><FONT SIZE="-1"> |
| <CODE><T> T</CODE></FONT></TD> |
| </TR> |
| </TABLE> |
| </CODE></FONT></TD> |
| <TD><CODE><B><A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html#oneByType(java.lang.Class)">oneByType</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</CODE> |
| |
| <BR> |
| Returns the first discovered principal assignable from the specified type, or <code>null</code> if there are none |
| of the specified type.</TD> |
| </TR> |
| </TABLE> |
| <A NAME="methods_inherited_from_class_java.lang.Iterable"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> |
| <TH ALIGN="left"><B>Methods inherited from interface java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A></B></TH> |
| </TR> |
| <TR BGCOLOR="white" CLASS="TableRowColor"> |
| <TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang">iterator</A></CODE></TD> |
| </TR> |
| </TABLE> |
| |
| <P> |
| |
| <!-- ============ METHOD DETAIL ========== --> |
| |
| <A NAME="method_detail"><!-- --></A> |
| <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> |
| <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> |
| <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> |
| <B>Method Detail</B></FONT></TH> |
| </TR> |
| </TABLE> |
| |
| <A NAME="getPrimaryPrincipal()"><!-- --></A><H3> |
| getPrimaryPrincipal</H3> |
| <PRE> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.77"><B>getPrimaryPrincipal</B></A>()</PRE> |
| <DL> |
| <DD>Returns the primary principal used application-wide to uniquely identify the owning account/Subject. |
| <p/> |
| The value is usually always a uniquely identifying attribute specific to the data source that retrieved the |
| account data. Some examples: |
| <ul> |
| <li>a <A HREF="http://java.sun.com/javase/6/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util"><CODE>UUID</CODE></A></li> |
| <li>a <code>long</code> value such as a surrogate primary key in a relational database</li> |
| <li>an LDAP UUID or static DN</li> |
| <li>a String username unique across all user accounts</li> |
| </ul> |
| <h3>Multi-Realm Applications</h3> |
| In a single-<code>Realm</code> application, typically there is only ever one unique principal to retain and that |
| is the value returned from this method. However, in a multi-<code>Realm</code> application, where the |
| <code>PrincipalCollection</code> might retain principals across more than one realm, the value returned from this |
| method should be the single principal that uniquely identifies the subject for the entire application. |
| <p/> |
| That value is of course application specific, but most applications will typically choose one of the primary |
| principals from one of the <code>Realm</code>s. |
| <p/> |
| Shiro's default implementations of this interface make this |
| assumption by usually simply returning <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang"><CODE>Iterable.iterator()</CODE></A>.<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Iterator.html?is-external=true#next()" title="class or interface in java.util"><CODE>next()</CODE></A>, which just |
| returns the first returned principal obtained from the first consulted/configured <code>Realm</code> during the |
| authentication attempt. This means in a multi-<code>Realm</code> application, <code>Realm</code> configuraiton order |
| matters if you want to retain this default heuristic. |
| <p/> |
| If this heuristic is not sufficient, most Shiro end-users will need to implement a custom |
| <A HREF="../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html" title="interface in org.apache.shiro.authc.pam"><CODE>AuthenticationStrategy</CODE></A>. An <code>AuthenticationStrategy</code> has exact control |
| over the <A HREF="../../../../org/apache/shiro/subject/PrincipalCollection.html" title="interface in org.apache.shiro.subject"><CODE>PrincipalCollection</CODE></A> returned at the end of an authentication attempt via the |
| <code>AuthenticationStrategy#<A HREF="../../../../org/apache/shiro/authc/pam/AuthenticationStrategy.html#afterAllAttempts(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)"><CODE>afterAllAttempts</CODE></A></code> |
| implementation. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>the primary principal used to uniquely identify the owning account/Subject<DT><B>Since:</B></DT> |
| <DD>1.0</DD> |
| </DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="oneByType(java.lang.Class)"><!-- --></A><H3> |
| oneByType</H3> |
| <PRE> |
| <T> T <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.88"><B>oneByType</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</PRE> |
| <DL> |
| <DD>Returns the first discovered principal assignable from the specified type, or <code>null</code> if there are none |
| of the specified type. |
| <p/> |
| Note that this will return <code>null</code> if the 'owning' subject has not yet logged in. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>type</CODE> - the type of the principal that should be returned. |
| <DT><B>Returns:</B><DD>a principal of the specified type or <code>null</code> if there isn't one of the specified type.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="byType(java.lang.Class)"><!-- --></A><H3> |
| byType</H3> |
| <PRE> |
| <T> <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A><T> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.100"><B>byType</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A><T> type)</PRE> |
| <DL> |
| <DD>Returns all principals assignable from the specified type, or an empty Collection if no principals of that |
| type are contained. |
| <p/> |
| Note that this will return an empty Collection if the 'owning' subject has not yet logged in. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>type</CODE> - the type of the principals that should be returned. |
| <DT><B>Returns:</B><DD>a Collection of principals that are assignable from the specified type, or |
| an empty Collection if no principals of this type are associated.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="asList()"><!-- --></A><H3> |
| asList</H3> |
| <PRE> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</A> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.110"><B>asList</B></A>()</PRE> |
| <DL> |
| <DD>Returns a single Subject's principals retrieved from all configured Realms as a List, or an empty List if |
| there are not any principals. |
| <p/> |
| Note that this will return an empty List if the 'owning' subject has not yet logged in. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a single Subject's principals retrieved from all configured Realms as a List.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="asSet()"><!-- --></A><H3> |
| asSet</H3> |
| <PRE> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</A> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.120"><B>asSet</B></A>()</PRE> |
| <DL> |
| <DD>Returns a single Subject's principals retrieved from all configured Realms as a Set, or an empty Set if there |
| are not any principals. |
| <p/> |
| Note that this will return an empty Set if the 'owning' subject has not yet logged in. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>a single Subject's principals retrieved from all configured Realms as a Set.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="fromRealm(java.lang.String)"><!-- --></A><H3> |
| fromRealm</H3> |
| <PRE> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</A> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.132"><B>fromRealm</B></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> realmName)</PRE> |
| <DL> |
| <DD>Returns a single Subject's principals retrieved from the specified Realm <em>only</em> as a Collection, or an empty |
| Collection if there are not any principals from that realm. |
| <p/> |
| Note that this will return an empty Collection if the 'owning' subject has not yet logged in. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| <DT><B>Parameters:</B><DD><CODE>realmName</CODE> - the name of the Realm from which the principals were retrieved. |
| <DT><B>Returns:</B><DD>the Subject's principals from the specified Realm only as a Collection or an empty Collection if there |
| are not any principals from that realm.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="getRealmNames()"><!-- --></A><H3> |
| getRealmNames</H3> |
| <PRE> |
| <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</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>> <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.139"><B>getRealmNames</B></A>()</PRE> |
| <DL> |
| <DD>Returns the realm names that this collection has principals for. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD>the names of realms that this collection has one or more principals for.</DL> |
| </DD> |
| </DL> |
| <HR> |
| |
| <A NAME="isEmpty()"><!-- --></A><H3> |
| isEmpty</H3> |
| <PRE> |
| boolean <A HREF="../../../../src-html/org/apache/shiro/subject/PrincipalCollection.html#line.146"><B>isEmpty</B></A>()</PRE> |
| <DL> |
| <DD>Returns <code>true</code> if this collection is empty, <code>false</code> otherwise. |
| <P> |
| <DD><DL> |
| </DL> |
| </DD> |
| <DD><DL> |
| |
| <DT><B>Returns:</B><DD><code>true</code> if this collection is empty, <code>false</code> otherwise.</DL> |
| </DD> |
| </DL> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <HR> |
| |
| |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <A NAME="navbar_bottom"><!-- --></A> |
| <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> |
| <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> |
| <TR> |
| <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> |
| <A NAME="navbar_bottom_firstrow"><!-- --></A> |
| <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> |
| <TR ALIGN="center" VALIGN="top"> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> |
| <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PrincipalCollection.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> |
| </TR> |
| </TABLE> |
| </TD> |
| <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> |
| </EM> |
| </TD> |
| </TR> |
| |
| <TR> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../org/apache/shiro/subject/MutablePrincipalCollection.html" title="interface in org.apache.shiro.subject"><B>PREV CLASS</B></A> |
| <A HREF="../../../../org/apache/shiro/subject/PrincipalMap.html" title="interface in org.apache.shiro.subject"><B>NEXT CLASS</B></A></FONT></TD> |
| <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| <A HREF="../../../../index.html?org/apache/shiro/subject/PrincipalCollection.html" target="_top"><B>FRAMES</B></A> |
| <A HREF="PrincipalCollection.html" target="_top"><B>NO FRAMES</B></A> |
| <SCRIPT type="text/javascript"> |
| <!-- |
| if(window==top) { |
| document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); |
| } |
| //--> |
| </SCRIPT> |
| <NOSCRIPT> |
| <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> |
| </NOSCRIPT> |
| |
| |
| </FONT></TD> |
| </TR> |
| <TR> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> |
| </TR> |
| </TABLE> |
| <A NAME="skip-navbar_bottom"></A> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| |
| <HR> |
| Copyright © 2004-2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved. |
| </BODY> |
| </HTML> |