Class Agent
- java.lang.Object
-
- org.jivesoftware.smackx.workgroup.agent.Agent
-
public class Agent extends java.lang.Object
TheAgent
class is used to represent one agent in a Workgroup Queue.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Return the agents name.Jid
getUser()
Return the agents JID.static java.util.Collection<java.lang.String>
getWorkgroups(Jid serviceJID, Jid agentJID, XMPPConnection connection)
void
setName(java.lang.String newName)
Changes the name of the agent in the server.
-
-
-
Method Detail
-
getWorkgroups
public static java.util.Collection<java.lang.String> getWorkgroups(Jid serviceJID, Jid agentJID, XMPPConnection connection) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
-
getName
public java.lang.String getName() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
Return 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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
setName
public void setName(java.lang.String newName) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.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.java.lang.InterruptedException
- if the calling thread was interrupted.
-
-