public class Workgroup extends Object
This class only provides a users perspective into a workgroup and is not intended for use by agents.
Constructor and Description |
---|
Workgroup(EntityBareJid workgroupJID,
XMPPConnection connection)
Creates a new workgroup instance using the specified workgroup JID
(eg support@workgroup.example.com) and XMPP connection.
|
Modifier and Type | Method and Description |
---|---|
void |
addInvitationListener(WorkgroupInvitationListener invitationListener)
Adds an invitation listener that will be notified of groupchat invitations
from the workgroup for the the user that created this Workgroup instance.
|
void |
addQueueListener(QueueListener queueListener)
Adds a queue listener that will be notified of queue events for the user
that created this Workgroup instance.
|
void |
departQueue()
Departs the workgroup queue.
|
ChatSetting |
getChatSetting(String key)
Returns a single chat setting based on it's identified key.
|
ChatSettings |
getChatSettings()
Returns all ChatSettings.
|
ChatSettings |
getChatSettings(int type)
Returns ChatSettings based on type.
|
OfflineSettings |
getOfflineSettings()
Asks the workgroup for it's Offline Settings.
|
int |
getQueuePosition()
Returns the users current position in the workgroup queue.
|
int |
getQueueRemainingTime()
Returns the estimated time (in seconds) that the user has to left wait in
the workgroup queue before being routed.
|
SoundSettings |
getSoundSettings()
Asks the workgroup for it's Sound Settings.
|
Form |
getWorkgroupForm()
Returns the Form to use for all clients of a workgroup.
|
EntityBareJid |
getWorkgroupJID()
Returns the name of this workgroup (eg support@example.com).
|
WorkgroupProperties |
getWorkgroupProperties()
Asks the workgroup for it's Properties.
|
WorkgroupProperties |
getWorkgroupProperties(String jid)
Asks the workgroup for it's Properties.
|
boolean |
isAvailable()
Returns true if the workgroup is available for receiving new requests.
|
boolean |
isEmailAvailable()
The workgroup service may be configured to send email.
|
boolean |
isInQueue()
Returns true if the user is currently waiting in the workgroup queue.
|
void |
joinQueue()
Joins the workgroup queue to wait to be routed to an agent.
|
void |
joinQueue(Form answerForm)
Joins the workgroup queue to wait to be routed to an agent.
|
void |
joinQueue(Form answerForm,
Jid userID)
Joins the workgroup queue to wait to be routed to an agent.
|
void |
joinQueue(Map<String,Object> metadata,
Jid userID)
Joins the workgroup queue to wait to be routed to an agent.
|
void |
removeQueueListener(QueueListener queueListener)
Removes a queue listener.
|
void |
removeQueueListener(WorkgroupInvitationListener invitationListener)
Removes an invitation listener.
|
public Workgroup(EntityBareJid workgroupJID, XMPPConnection connection)
workgroupJID
- the JID of the workgroup.connection
- an XMPP connection which must have already undergone a
successful login.public EntityBareJid getWorkgroupJID()
public boolean isInQueue()
public boolean isAvailable() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public int getQueuePosition()
public int getQueueRemainingTime()
public void joinQueue() throws XMPPException, SmackException, InterruptedException
departQueue()
method.
Some servers may be configured to require certain meta-data in order to
join the queue. In that case, the joinQueue(Form)
method should be
used instead of this method so that meta-data may be passed in.
The server tracks the conversations that a user has with agents over time. By
default, that tracking is done using the user's JID. However, this is not always
possible. For example, when the user is logged in anonymously using a web client.
In that case the user ID might be a randomly generated value put into a persistent
cookie or a username obtained via the session. A userID can be explicitly
passed in by using the joinQueue(Form, Jid)
method. When specified,
that userID will be used instead of the user's JID to track conversations. The
server will ignore a manually specified userID if the user's connection to the server
is not anonymous.
XMPPException
- if an error occurred joining the queue. An error may indicate
that a connection failure occurred or that the server explicitly rejected the
request to join the queue.SmackException
InterruptedException
public void joinQueue(Form answerForm) throws XMPPException, SmackException, InterruptedException
departQueue()
method.
Some servers may be configured to require certain meta-data in order to join the queue.
The server tracks the conversations that a user has with agents over time. By
default, that tracking is done using the user's JID. However, this is not always
possible. For example, when the user is logged in anonymously using a web client.
In that case the user ID might be a randomly generated value put into a persistent
cookie or a username obtained via the session. A userID can be explicitly
passed in by using the joinQueue(Form, Jid)
method. When specified,
that userID will be used instead of the user's JID to track conversations. The
server will ignore a manually specified userID if the user's connection to the server
is not anonymous.
answerForm
- the completed form the send for the join request.XMPPException
- if an error occurred joining the queue. An error may indicate
that a connection failure occurred or that the server explicitly rejected the
request to join the queue.SmackException
InterruptedException
public void joinQueue(Form answerForm, Jid userID) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Joins the workgroup queue to wait to be routed to an agent. After joining the queue, queue status events will be sent to indicate the user's position and estimated time left in the queue. Once joining the queue, there are three ways the user can leave the queue:
departQueue()
method.
Some servers may be configured to require certain meta-data in order to join the queue.
The server tracks the conversations that a user has with agents over time. By default, that tracking is done using the user's JID. However, this is not always possible. For example, when the user is logged in anonymously using a web client. In that case the user ID might be a randomly generated value put into a persistent cookie or a username obtained via the session. When specified, that userID will be used instead of the user's JID to track conversations. The server will ignore a manually specified userID if the user's connection to the server is not anonymous.
answerForm
- the completed form associated with the join request.userID
- String that represents the ID of the user when using anonymous sessions
or null if a userID should not be used.XMPPException.XMPPErrorException
- if an error occurred joining the queue. An error may indicate
that a connection failure occurred or that the server explicitly rejected the
request to join the queue.SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public void joinQueue(Map<String,Object> metadata, Jid userID) throws XMPPException, SmackException, InterruptedException
Joins the workgroup queue to wait to be routed to an agent. After joining the queue, queue status events will be sent to indicate the user's position and estimated time left in the queue. Once joining the queue, there are three ways the user can leave the queue:
departQueue()
method.
Some servers may be configured to require certain meta-data in order to join the queue.
The server tracks the conversations that a user has with agents over time. By default, that tracking is done using the user's JID. However, this is not always possible. For example, when the user is logged in anonymously using a web client. In that case the user ID might be a randomly generated value put into a persistent cookie or a username obtained via the session. When specified, that userID will be used instead of the user's JID to track conversations. The server will ignore a manually specified userID if the user's connection to the server is not anonymous.
metadata
- metadata to create a dataform from.userID
- String that represents the ID of the user when using anonymous sessions
or null if a userID should not be used.XMPPException
- if an error occurred joining the queue. An error may indicate
that a connection failure occurred or that the server explicitly rejected the
request to join the queue.SmackException
InterruptedException
public void departQueue() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
Normally, the user would not manually leave the queue. However, they may wish to under certain circumstances -- for example, if they no longer wish to be routed to an agent because they've been waiting too long.
XMPPException.XMPPErrorException
- if an error occurred trying to send the depart queue
request to the server.SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public void addQueueListener(QueueListener queueListener)
queueListener
- the queue listener.public void removeQueueListener(QueueListener queueListener)
queueListener
- the queue listener.public void addInvitationListener(WorkgroupInvitationListener invitationListener)
invitationListener
- the invitation listener.public void removeQueueListener(WorkgroupInvitationListener invitationListener)
invitationListener
- the invitation listener.public ChatSetting getChatSetting(String key) throws XMPPException, SmackException, InterruptedException
key
- the key to find.XMPPException
- if an error occurs while getting information from the server.SmackException
InterruptedException
public ChatSettings getChatSettings(int type) throws XMPPException, SmackException, InterruptedException
type
- the type of ChatSettings to return.XMPPException
- if an error occurs while getting information from the server.SmackException
InterruptedException
public ChatSettings getChatSettings() throws XMPPException, SmackException, InterruptedException
XMPPException
- if an error occurs while getting information from the server.SmackException
InterruptedException
public boolean isEmailAvailable() throws SmackException, InterruptedException
SmackException
InterruptedException
public OfflineSettings getOfflineSettings() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public SoundSettings getSoundSettings() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public WorkgroupProperties getWorkgroupProperties() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public WorkgroupProperties getWorkgroupProperties(String jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
jid
- the jid of the user who's information you would like the workgroup to retreive.XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException
public Form getWorkgroupForm() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
XMPPException.XMPPErrorException
SmackException.NoResponseException
SmackException.NotConnectedException
InterruptedException