📄 agentsession.html
字号:
<TD><CODE><B><A HREF="../../../../../org/jivesoftware/smackx/workgroup/agent/AgentSession.html#setStatus(org.jivesoftware.smack.packet.Presence.Mode, int)">setStatus</A></B>(<A HREF="../../../../../org/jivesoftware/smack/packet/Presence.Mode.html" title="enum in org.jivesoftware.smack.packet">Presence.Mode</A> presenceMode, int maxChats)</CODE><BR> Sets the agent's current status with the workgroup.</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/smackx/workgroup/agent/AgentSession.html#setStatus(org.jivesoftware.smack.packet.Presence.Mode, int, java.lang.String)">setStatus</A></B>(<A HREF="../../../../../org/jivesoftware/smack/packet/Presence.Mode.html" title="enum in org.jivesoftware.smack.packet">Presence.Mode</A> presenceMode, int maxChats, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> status)</CODE><BR> Sets the agent's current status with the workgroup.</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/smackx/workgroup/agent/AgentSession.html#setStatus(org.jivesoftware.smack.packet.Presence.Mode, java.lang.String)">setStatus</A></B>(<A HREF="../../../../../org/jivesoftware/smack/packet/Presence.Mode.html" title="enum in org.jivesoftware.smack.packet">Presence.Mode</A> presenceMode, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> status)</CODE><BR> Sets the agent's current status with the workgroup.</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><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="AgentSession(java.lang.String, org.jivesoftware.smack.XMPPConnection)"><!-- --></A><H3>AgentSession</H3><PRE>public <B>AgentSession</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> workgroupJID, <A HREF="../../../../../org/jivesoftware/smack/XMPPConnection.html" title="class in org.jivesoftware.smack">XMPPConnection</A> connection)</PRE><DL><DD>Constructs a new agent session instance. Note, the <A HREF="../../../../../org/jivesoftware/smackx/workgroup/agent/AgentSession.html#setOnline(boolean)"><CODE>setOnline(boolean)</CODE></A> method must be called with an argument of <tt>true</tt> to mark the agent as available to accept chat requests.<P><DL><DT><B>Parameters:</B><DD><CODE>connection</CODE> - a connection instance which must have already gone through authentication.<DD><CODE>workgroupJID</CODE> - the fully qualified JID of the workgroup.</DL></DL><!-- ============ 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="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD>Close the agent session. The underlying connection will remain opened but the packet listeners that were added by this agent session will be removed.<P><DD><DL></DL></DD></DL><HR><A NAME="getAgentRoster()"><!-- --></A><H3>getAgentRoster</H3><PRE>public <A HREF="../../../../../org/jivesoftware/smackx/workgroup/agent/AgentRoster.html" title="class in org.jivesoftware.smackx.workgroup.agent">AgentRoster</A> <B>getAgentRoster</B>()</PRE><DL><DD>Returns the agent roster for the workgroup, which contains<P><DD><DL><DT><B>Returns:</B><DD>the AgentRoster</DL></DD></DL><HR><A NAME="getPresenceMode()"><!-- --></A><H3>getPresenceMode</H3><PRE>public <A HREF="../../../../../org/jivesoftware/smack/packet/Presence.Mode.html" title="enum in org.jivesoftware.smack.packet">Presence.Mode</A> <B>getPresenceMode</B>()</PRE><DL><DD>Returns the agent's current presence mode.<P><DD><DL><DT><B>Returns:</B><DD>the agent's current presence mode.</DL></DD></DL><HR><A NAME="getMaxChats()"><!-- --></A><H3>getMaxChats</H3><PRE>public int <B>getMaxChats</B>()</PRE><DL><DD>Returns the maximum number of chats the agent can participate in.<P><DD><DL><DT><B>Returns:</B><DD>the maximum number of chats the agent can participate in.</DL></DD></DL><HR><A NAME="isOnline()"><!-- --></A><H3>isOnline</H3><PRE>public boolean <B>isOnline</B>()</PRE><DL><DD>Returns true if the agent is online with the workgroup.<P><DD><DL><DT><B>Returns:</B><DD>true if the agent is online with the workgroup.</DL></DD></DL><HR><A NAME="setMetaData(java.lang.String, java.lang.String)"><!-- --></A><H3>setMetaData</H3><PRE>public void <B>setMetaData</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> key, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> val) throws <A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Allows the addition of a new key-value pair to the agent's meta data, if the value is new data, the revised meta data will be rebroadcast in an agent's presence broadcast.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the meta data key<DD><CODE>val</CODE> - the non-null meta data value<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an exception occurs.</DL></DD></DL><HR><A NAME="removeMetaData(java.lang.String)"><!-- --></A><H3>removeMetaData</H3><PRE>public void <B>removeMetaData</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> key) throws <A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Allows the removal of data from the agent's meta data, if the key represents existing data, the revised meta data will be rebroadcast in an agent's presence broadcast.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the meta data key.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an exception occurs.</DL></DD></DL><HR><A NAME="getMetaData(java.lang.String)"><!-- --></A><H3>getMetaData</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getMetaData</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> key)</PRE><DL><DD>Allows the retrieval of meta data for a specified key.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the meta data key<DT><B>Returns:</B><DD>the meta data value associated with the key or <tt>null</tt> if the meta-data doesn't exist..</DL></DD></DL><HR><A NAME="setOnline(boolean)"><!-- --></A><H3>setOnline</H3><PRE>public void <B>setOnline</B>(boolean online) throws <A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Sets whether the agent is online with the workgroup. If the user tries to go online with the workgroup but is not allowed to be an agent, an XMPPError with error code 401 will be thrown.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>online</CODE> - true to set the agent as online with the workgroup.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an error occurs setting the online status.</DL></DD></DL><HR><A NAME="setStatus(org.jivesoftware.smack.packet.Presence.Mode, int)"><!-- --></A><H3>setStatus</H3><PRE>public void <B>setStatus</B>(<A HREF="../../../../../org/jivesoftware/smack/packet/Presence.Mode.html" title="enum in org.jivesoftware.smack.packet">Presence.Mode</A> presenceMode, int maxChats) throws <A HREF="../../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Sets the agent's current status with the workgroup. The presence mode affects how offers are routed to the agent. The possible presence modes with their meanings are as follows:<ul> <p/> <li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats (equivalent to Presence.Mode.CHAT). <li>Presence.Mode.DO_NOT_DISTURB -
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -