Class Agent
java.lang.Object
org.jivesoftware.smackx.workgroup.agent.Agent
The
Agent
class is used to represent one agent in a Workgroup Queue.-
Method Summary
Modifier and TypeMethodDescriptiongetName()
Return the agents name.getUser()
Return the agents JID.static Collection<String>
getWorkgroups
(Jid serviceJID, Jid agentJID, XMPPConnection connection) void
Changes the name of the agent in the server.
-
Method Details
-
getWorkgroups
public static Collection<String> getWorkgroups(Jid serviceJID, Jid agentJID, XMPPConnection connection) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
getUser
Return the agents JID.- Returns:
- - the agents JID.
-
getName
public String getName() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionReturn the agents name.- Returns:
- - the agents name.
- Throws:
XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-
setName
public void setName(String newName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException Changes the name of the agent in the server. The server may have this functionality disabled for all the agents or for this agent in particular. If the agent is not allowed to change his name then an exception will be thrown with a service_unavailable error code.- Parameters:
newName
- the new name of the agent.- Throws:
XMPPException.XMPPErrorException
- if there was an XMPP error returned.SmackException.NoResponseException
- if there was no response from the remote entity.SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.
-