|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.workgroup.user.Workgroup
public class Workgroup
Provides workgroup services for users. Users can join the workgroup queue, depart the queue, find status information about their placement in the queue, and register to be notified when they are routed to an agent.
This class only provides a user's perspective into a workgroup and is not intended for use by agents.
Constructor Summary | |
---|---|
Workgroup(String workgroupName,
XMPPConnection connection)
Creates a new workgroup instance using the specified workgroup name (eg support@example.com) and XMPP connection. |
Method Summary | |
---|---|
void |
addInvitationListener(PacketListener packetListener)
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. |
protected void |
finalize()
|
int |
getQueuePosition()
Returns the user's 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. |
String |
getWorkgroupName()
Returns the name of this workgroup (eg support@example.com). |
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(Map metaData)
Joins the workgroup queue to wait to be routed to an agent. |
void |
removeQueueListener(QueueListener queueListener)
Removes a queue listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Workgroup(String workgroupName, XMPPConnection connection)
workgroupName
- the fully qualified name of the workgroup.connection
- an XMPP connection which must have already undergone a
successful login.Method Detail |
---|
public String getWorkgroupName()
public boolean isInQueue()
public int getQueuePosition()
public int getQueueRemainingTime()
public void joinQueue() throws XMPPException
departQueue()
method.
Some servers may be configured to require certain meta-data in
order to join the queue. In that case, the joinQueue(Map)
method
should be used instead of this method so that meta-data may be passed in.
XMPPException
- if an error occured joining the queue. An error may indicate
that a connection failure occured or that the server explicitly rejected the
request to join the queue.public void joinQueue(Map metaData) throws XMPPException
departQueue()
method.
Arbitrary meta-data can be passed in with the queue join request in order to assist the server in routing the user to an agent and to provide information about the user to the agent. Some servers may be configured to require certain meta-data in order to join the queue.
The server may reject the join queue request, which will cause an XMPPException to be thrown. The error codes for specific cases are as follows:
metaData
- the metaData for the join request.
XMPPException
- if an error occured joining the queue. An error may indicate
that a connection failure occured or that the server explicitly rejected the
request to join the queue (error code 503). The error code should be checked
to determine the specific error.public void departQueue() throws XMPPException
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
- if an error occured trying to send the depart queue
request to the server.public void addQueueListener(QueueListener queueListener)
queueListener
- the queue listener.public void removeQueueListener(QueueListener queueListener)
queueListener
- the queue listener.public void addInvitationListener(PacketListener packetListener)
packetListener
- the invitation listener.protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |