Lines Matching refs:Presence
45 * This class embodies the agent's active presence within a given workgroup. The application
62 private Presence.Mode presenceMode;
112 filter.addFilter(new PacketTypeFilter(Presence.class));
167 * Returns the agent's current presence mode.
169 * @return the agent's current presence mode.
171 public Presence.Mode getPresenceMode() {
195 * new data, the revised meta data will be rebroadcast in an agent's presence broadcast.
215 * the revised meta data will be rebroadcast in an agent's presence broadcast.
255 Presence presence;
259 presence = new Presence(Presence.Type.available);
260 presence.setTo(workgroupJID);
261 presence.addExtension(new DefaultPacketExtension(AgentStatus.ELEMENT_NAME,
264 PacketCollector collector = this.connection.createPacketCollector(new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(workgroupJID)));
266 connection.sendPacket(presence);
268 presence = (Presence)collector.nextResult(5000);
270 if (!presence.isAvailable()) {
274 if (presence.getError() != null) {
275 throw new XMPPException(presence.getError());
286 presence = new Presence(Presence.Type.unavailable);
287 presence.setTo(workgroupJID);
288 presence.addExtension(new DefaultPacketExtension(AgentStatus.ELEMENT_NAME,
290 connection.sendPacket(presence);
295 * Sets the agent's current status with the workgroup. The presence mode affects
296 * how offers are routed to the agent. The possible presence modes with their
299 * <li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
300 * (equivalent to Presence.Mode.CHAT).
301 * <li>Presence.Mode.DO_NOT_DISTURB -- the agent is busy and should not be disturbed.
303 * <li>Presence.Mode.AWAY -- the agent is not available and should not
304 * have a chat routed to them (equivalent to Presence.Mode.EXTENDED_AWAY).</ul>
312 * @param presenceMode the presence mode of the agent.
317 public void setStatus(Presence.Mode presenceMode, int maxChats) throws XMPPException {
322 * Sets the agent's current status with the workgroup. The presence mode affects how offers
323 * are routed to the agent. The possible presence modes with their meanings are as follows:<ul>
325 * <li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
326 * (equivalent to Presence.Mode.CHAT).
327 * <li>Presence.Mode.DO_NOT_DISTURB -- the agent is busy and should not be disturbed.
329 * <li>Presence.Mode.AWAY -- the agent is not available and should not
330 * have a chat routed to them (equivalent to Presence.Mode.EXTENDED_AWAY).</ul>
337 * @param presenceMode the presence mode of the agent.
339 * @param status sets the status message of the presence update.
343 public void setStatus(Presence.Mode presenceMode, int maxChats, String status)
350 presenceMode = Presence.Mode.available;
355 Presence presence = new Presence(Presence.Type.available);
356 presence.setMode(presenceMode);
357 presence.setTo(this.getWorkgroupJID());
360 presence.setStatus(status);
366 presence.addExtension(agentStatus);
367 presence.addExtension(new MetaData(this.metaData));
369 PacketCollector collector = this.connection.createPacketCollector(new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(workgroupJID)));
371 this.connection.sendPacket(presence);
373 presence = (Presence)collector.nextResult(5000);
375 if (!presence.isAvailable()) {
379 if (presence.getError() != null) {
380 throw new XMPPException(presence.getError());
385 * Sets the agent's current status with the workgroup. The presence mode affects how offers
386 * are routed to the agent. The possible presence modes with their meanings are as follows:<ul>
388 * <li>Presence.Mode.AVAILABLE -- (Default) the agent is available for more chats
389 * (equivalent to Presence.Mode.CHAT).
390 * <li>Presence.Mode.DO_NOT_DISTURB -- the agent is busy and should not be disturbed.
392 * <li>Presence
393 * have a chat routed to them (equivalent to Presence.Mode.EXTENDED_AWAY).</ul>
395 * @param presenceMode the presence mode of the agent.
396 * @param status sets the status message of the presence update.
400 public void setStatus(Presence.Mode presenceMode, String status) throws XMPPException {
406 presenceMode = Presence.Mode.available;
410 Presence presence = new Presence(Presence.Type.available);
411 presence.setMode(presenceMode);
412 presence.setTo(this.getWorkgroupJID());
415 presence.setStatus(status);
417 presence.addExtension(new MetaData(this.metaData));
419 PacketCollector collector = this.connection.createPacketCollector(new AndFilter(new PacketTypeFilter(Presence.class),
422 this.connection.sendPacket(presence);
424 presence = (Presence)collector.nextResult(5000);
426 if (!presence.isAvailable()) {
430 if (presence.getError() != null) {
431 throw new XMPPException(presence.getError());
694 else if (packet instanceof Presence) {
695 Presence presence = (Presence)packet;
697 // The workgroup can send us a number of different presence packets. We
698 // check for different packet extensions to see what type of presence
701 String queueName = StringUtils.parseResource(presence.getFrom());
710 QueueOverview queueOverview = (QueueOverview)presence.getExtension(QueueOverview.ELEMENT_NAME, QueueOverview.NAMESPACE);
738 DefaultPacketExtension notifyAgents = (DefaultPacketExtension)presence.getExtension("notify-agents", "http://jabber.org/protocol/workgroup");