Class AgentRoster
java.lang.Object
org.jivesoftware.smackx.workgroup.agent.AgentRoster
Manges information about the agents in a workgroup and their presence.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(AgentRosterListener listener) Adds a listener to this roster.booleancontains(org.jxmpp.jid.Jid jid) Returns true if the specified XMPP address is an agent in the workgroup.intReturns a count of all agents in the workgroup.Set<org.jxmpp.jid.EntityBareJid>Returns all agents (String JID values) in the workgroup.org.jivesoftware.smack.packet.PresencegetPresence(org.jxmpp.jid.Jid user) Returns the presence info for a particular agent, ornullif the agent is unavailable (offline) or if no presence information is available.voidreload()Reloads the entire roster from the server.voidremoveListener(AgentRosterListener listener) Removes a listener from this roster.
-
Method Details
-
reload
public void reload() throws org.jivesoftware.smack.SmackException.NotConnectedException, InterruptedExceptionReloads 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.- Throws:
org.jivesoftware.smack.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
addListener
Adds a listener to this roster. The listener will be fired anytime one or more changes to the roster are pushed from the server.- Parameters:
listener- an agent roster listener.
-
removeListener
Removes a listener from this roster. The listener will be fired anytime one or more changes to the roster are pushed from the server.- Parameters:
listener- a roster listener.
-
getAgentCount
public int getAgentCount()Returns a count of all agents in the workgroup.- Returns:
- the number of agents in the workgroup.
-
getAgents
Returns all agents (String JID values) in the workgroup.- Returns:
- all entries in the roster.
-
contains
public boolean contains(org.jxmpp.jid.Jid jid) Returns true if the specified XMPP address is an agent in the workgroup.- Parameters:
jid- the XMPP address of the agent (e.g."jsmith@example.com"). The address can be in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").- Returns:
- true if the XMPP address is an agent in the workgroup.
-
getPresence
public org.jivesoftware.smack.packet.Presence getPresence(org.jxmpp.jid.Jid user) Returns the presence info for a particular agent, ornullif the agent is unavailable (offline) or if no presence information is available.- Parameters:
user- a fully qualified xmpp JID. The address could be in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").- Returns:
- the agent's current presence, or
nullif the agent is unavailable or if no presence information is available.
-