|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.workgroup.agent.WorkgroupSession
public class WorkgroupSession
This class embodies the agent's active presence within a given workgroup. The application should have N instances of this class, where N is the number of workgroups to which the owning agent of the application belongs. This class provides all functionality that a session within a given workgroup is expected to have from an agent's perspective -- setting the status, tracking the status of queues to which the agent belongs within the workgroup, and dequeuing customers.
Constructor Summary | |
---|---|
WorkgroupSession(String workgroupName,
XMPPConnection connection)
Creates a new agent session instance. |
Method Summary | |
---|---|
void |
addInvitationListener(PacketListener invitationListener)
Adds an invitation listener. |
void |
addOfferListener(OfferListener offerListener)
Adds an offer listener. |
void |
addQueueAgentsListener(QueueAgentsListener listener)
|
void |
addQueueUsersListener(QueueUsersListener listener)
|
void |
dequeueUser(String userID)
Removes a user from the workgroup queue. |
int |
getCurrentChats()
Returns the current number of chats the agent is in. |
int |
getMaxChats()
Returns the maximum number of chats the agent can participate in. |
String |
getMetaData(String key)
Allows the retrieval of meta data for a specified key. |
Presence.Mode |
getPresenceMode()
Returns the agent's current presence mode. |
WorkgroupQueue |
getQueue(String queueName)
|
Iterator |
getQueues()
|
String |
getWorkgroupName()
|
boolean |
isOnline()
Returns true if the agent is online with the workgroup. |
void |
removeMetaData(String key)
Allows the removal of data from the agent's meta data, if the key represents existing data, the revised meta data will be rebroadcast in an agent's presence broadcast. |
void |
removeOfferListener(OfferListener offerListener)
Removes an offer listener. |
void |
removeQueueAgentsListener(QueueAgentsListener listener)
|
void |
removeQueueUsersListener(QueueUsersListener listener)
|
void |
setMetaData(String key,
String val)
Allows the addition of a new key-value pair to the agent's meta data, if the value is new data, the revised meta data will be rebroadcast in an agent's presence broadcast. |
void |
setOnline(boolean online)
Sets whether the agent is online with the workgroup. |
void |
setStatus(Presence.Mode presenceMode,
int currentChats,
int maxChats)
Sets the agent's current status with the workgroup. |
void |
setStatus(Presence.Mode presenceMode,
int currentChats,
int maxChats,
String status)
Sets the agent's current status with the workgroup. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkgroupSession(String workgroupName, XMPPConnection connection)
connection
- a connection instance which must have already gone through authentication.workgroupName
- the fully qualified name of the workgroup.Method Detail |
---|
public Presence.Mode getPresenceMode()
public int getCurrentChats()
public int getMaxChats()
public boolean isOnline()
public void setMetaData(String key, String val) throws XMPPException
key
- the meta data keyval
- the non-null meta data value
XMPPException
public void removeMetaData(String key) throws XMPPException
key
- the meta data key
XMPPException
public String getMetaData(String key)
key
- the meta data key
public void setOnline(boolean online) throws XMPPException
online
- true to set the agent as online with the workgroup.
XMPPException
- if an error occurs setting the online status.public void setStatus(Presence.Mode presenceMode, int currentChats, int maxChats) throws XMPPException
The max chats value is the maximum number of chats the agent is willing to have routed to them at once. Some servers may be configured to only accept max chat values in a certain range; for example, between two and five. In that case, the maxChats value the agent sends may be adjusted by the server to a value within that range.
presenceMode
- the presence mode of the agent.currentChats
- the current number of chats the agent is in.maxChats
- the maximum number of chats the agent is willing to accept.
XMPPException
- if an error occurs setting the agent status.
IllegalStateException
- if the agent is not online with the workgroup.public void setStatus(Presence.Mode presenceMode, int currentChats, int maxChats, String status) throws XMPPException
The max chats value is the maximum number of chats the agent is willing to have routed to them at once. Some servers may be configured to only accept max chat values in a certain range; for example, between two and five. In that case, the maxChats value the agent sends may be adjusted by the server to a value within that range.
presenceMode
- the presence mode of the agent.currentChats
- the current number of chats the agent is in.maxChats
- the maximum number of chats the agent is willing to accept.status
- sets the status message of the presence update.
XMPPException
- if an error occurs setting the agent status.
IllegalStateException
- if the agent is not online with the workgroup.public void dequeueUser(String userID) throws XMPPException
XMPPException
public String getWorkgroupName()
public WorkgroupQueue getQueue(String queueName)
queueName
- the name of the queue
public Iterator getQueues()
public void addQueueUsersListener(QueueUsersListener listener)
public void removeQueueUsersListener(QueueUsersListener listener)
public void addQueueAgentsListener(QueueAgentsListener listener)
public void removeQueueAgentsListener(QueueAgentsListener listener)
public void addOfferListener(OfferListener offerListener)
offerListener
- the offer listener.public void removeOfferListener(OfferListener offerListener)
offerListener
- the offer listener.public void addInvitationListener(PacketListener invitationListener)
invitationListener
- the invitation listener.
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |