📄 roster.html
字号:
updates.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#getSubscriptionMode()">getSubscriptionMode</A></B>()</CODE><BR> Returns the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../org/jivesoftware/smack/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A>></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#getUnfiledEntries()">getUnfiledEntries</A></B>()</CODE><BR> Returns an unmodifiable collection for the unfiled roster entries.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#getUnfiledEntryCount()">getUnfiledEntryCount</A></B>()</CODE><BR> Returns a count of the unfiled entries in the roster.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#reload()">reload</A></B>()</CODE><BR> Reloads the entire roster from the server.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#removeEntry(org.jivesoftware.smack.RosterEntry)">removeEntry</A></B>(<A HREF="../../../org/jivesoftware/smack/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A> entry)</CODE><BR> Removes a roster entry from the roster.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#removeRosterListener(org.jivesoftware.smack.RosterListener)">removeRosterListener</A></B>(<A HREF="../../../org/jivesoftware/smack/RosterListener.html" title="interface in org.jivesoftware.smack">RosterListener</A> rosterListener)</CODE><BR> Removes a listener from this roster.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#setDefaultSubscriptionMode(org.jivesoftware.smack.Roster.SubscriptionMode)">setDefaultSubscriptionMode</A></B>(<A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> subscriptionMode)</CODE><BR> Sets the default subscription processing mode to use when a new Roster is created.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/smack/Roster.html#setSubscriptionMode(org.jivesoftware.smack.Roster.SubscriptionMode)">setSubscriptionMode</A></B>(<A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> subscriptionMode)</CODE><BR> Sets the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</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="getDefaultSubscriptionMode()"><!-- --></A><H3>getDefaultSubscriptionMode</H3><PRE>public static <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> <B>getDefaultSubscriptionMode</B>()</PRE><DL><DD>Returns the default subscription processing mode to use when a new Roster is created. The subscription processing mode dictates what action Smack will take when subscription requests from other users are made. The default subscription mode is <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html#accept_all"><CODE>Roster.SubscriptionMode.accept_all</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>the default subscription mode to use for new Rosters</DL></DD></DL><HR><A NAME="setDefaultSubscriptionMode(org.jivesoftware.smack.Roster.SubscriptionMode)"><!-- --></A><H3>setDefaultSubscriptionMode</H3><PRE>public static void <B>setDefaultSubscriptionMode</B>(<A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> subscriptionMode)</PRE><DL><DD>Sets the default subscription processing mode to use when a new Roster is created. The subscription processing mode dictates what action Smack will take when subscription requests from other users are made. The default subscription mode is <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html#accept_all"><CODE>Roster.SubscriptionMode.accept_all</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>subscriptionMode</CODE> - the default subscription mode to use for new Rosters.</DL></DD></DL><HR><A NAME="getSubscriptionMode()"><!-- --></A><H3>getSubscriptionMode</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> <B>getSubscriptionMode</B>()</PRE><DL><DD>Returns the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made. The default subscription mode is <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html#accept_all"><CODE>Roster.SubscriptionMode.accept_all</CODE></A>.<p> <p/> If using the manual mode, a PacketListener should be registered that listens for Presence packets that have a type of <A HREF="../../../org/jivesoftware/smack/packet/Presence.Type.html#subscribe"><CODE>Presence.Type.subscribe</CODE></A>.<P><DD><DL><DT><B>Returns:</B><DD>the subscription mode.</DL></DD></DL><HR><A NAME="setSubscriptionMode(org.jivesoftware.smack.Roster.SubscriptionMode)"><!-- --></A><H3>setSubscriptionMode</H3><PRE>public void <B>setSubscriptionMode</B>(<A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum in org.jivesoftware.smack">Roster.SubscriptionMode</A> subscriptionMode)</PRE><DL><DD>Sets the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made. The default subscription mode is <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html#accept_all"><CODE>Roster.SubscriptionMode.accept_all</CODE></A>.<p> <p/> If using the manual mode, a PacketListener should be registered that listens for Presence packets that have a type of <A HREF="../../../org/jivesoftware/smack/packet/Presence.Type.html#subscribe"><CODE>Presence.Type.subscribe</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>subscriptionMode</CODE> - the subscription mode.</DL></DD></DL><HR><A NAME="reload()"><!-- --></A><H3>reload</H3><PRE>public void <B>reload</B>()</PRE><DL><DD>Reloads the entire roster from the server. This is an asynchronous operation, which means the method will return immediately, and the roster will be reloaded at a later point when the server responds to the reload request.<P><DD><DL></DL></DD></DL><HR><A NAME="addRosterListener(org.jivesoftware.smack.RosterListener)"><!-- --></A><H3>addRosterListener</H3><PRE>public void <B>addRosterListener</B>(<A HREF="../../../org/jivesoftware/smack/RosterListener.html" title="interface in org.jivesoftware.smack">RosterListener</A> rosterListener)</PRE><DL><DD>Adds a listener to this roster. The listener will be fired anytime one or more changes to the roster are pushed from the server.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>rosterListener</CODE> - a roster listener.</DL></DD></DL><HR><A NAME="removeRosterListener(org.jivesoftware.smack.RosterListener)"><!-- --></A><H3>removeRosterListener</H3><PRE>public void <B>removeRosterListener</B>(<A HREF="../../../org/jivesoftware/smack/RosterListener.html" title="interface in org.jivesoftware.smack">RosterListener</A> rosterListener)</PRE><DL><DD>Removes a listener from this roster. The listener will be fired anytime one or more changes to the roster are pushed from the server.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>rosterListener</CODE> - a roster listener.</DL></DD></DL><HR><A NAME="createGroup(java.lang.String)"><!-- --></A><H3>createGroup</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/RosterGroup.html" title="class in org.jivesoftware.smack">RosterGroup</A> <B>createGroup</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)</PRE><DL><DD>Creates a new group.<p> <p/> Note: you must add at least one entry to the group for the group to be kept after a logout/login. This is due to the way that XMPP stores group information.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the group.<DT><B>Returns:</B><DD>a new group.</DL></DD></DL><HR><A NAME="createEntry(java.lang.String, java.lang.String, java.lang.String[])"><!-- --></A><H3>createEntry</H3><PRE>public void <B>createEntry</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> user, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] groups) throws <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Creates a new roster entry and presence subscription. The server will asynchronously update the roster with the subscription status.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the user. (e.g. johndoe@jabber.org)<DD><CODE>name</CODE> - the nickname of the user.<DD><CODE>groups</CODE> - the list of group names the entry will belong to, or <tt>null</tt> if the the roster entry won't belong to a group.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an XMPP exception occurs.</DL></DD></DL><HR><A NAME="removeEntry(org.jivesoftware.smack.RosterEntry)"><!-- --></A><H3>removeEntry</H3><PRE>public void <B>removeEntry</B>(<A HREF="../../../org/jivesoftware/smack/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A> entry) throws <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Removes a roster entry from the roster. The roster entry will also be removed from the unfiled entries or from any roster group where it could belong and will no longer be part of the roster. Note that this is an asynchronous call -- Smack must wait for the server to send an updated subscription status.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>entry</CODE> - a roster entry.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an XMPP error occurs.</DL></DD></DL><HR><A NAME="getEntryCount()"><!-- --></A><H3>getEntryCount</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -