Java 类org.jivesoftware.smackx.workgroup.QueueUser 实例源码

项目:Smack    文件:AgentSession.java   
private void fireQueueUsersEvent(WorkgroupQueue queue, WorkgroupQueue.Status status,
                                 int averageWaitTime, Date oldestEntry, Set<QueueUser> users) {
    synchronized (queueUsersListeners) {
        for (QueueUsersListener listener : queueUsersListeners) {
            if (status != null) {
                listener.statusUpdated(queue, status);
            }
            if (averageWaitTime != -1) {
                listener.averageWaitTimeUpdated(queue, averageWaitTime);
            }
            if (oldestEntry != null) {
                listener.oldestEntryUpdated(queue, oldestEntry);
            }
            if (users != null) {
                listener.usersUpdated(queue, users);
            }
        }
    }
}
项目:androidPN-client.    文件:AgentSession.java   
private void fireQueueUsersEvent(WorkgroupQueue queue, WorkgroupQueue.Status status,
                                 int averageWaitTime, Date oldestEntry, Set<QueueUser> users) {
    synchronized (queueUsersListeners) {
        for (QueueUsersListener listener : queueUsersListeners) {
            if (status != null) {
                listener.statusUpdated(queue, status);
            }
            if (averageWaitTime != -1) {
                listener.averageWaitTimeUpdated(queue, averageWaitTime);
            }
            if (oldestEntry != null) {
                listener.oldestEntryUpdated(queue, oldestEntry);
            }
            if (users != null) {
                listener.usersUpdated(queue, users);
            }
        }
    }
}
项目:java-bells    文件:AgentSession.java   
private void fireQueueUsersEvent(WorkgroupQueue queue, WorkgroupQueue.Status status,
                                 int averageWaitTime, Date oldestEntry, Set<QueueUser> users) {
    synchronized (queueUsersListeners) {
        for (QueueUsersListener listener : queueUsersListeners) {
            if (status != null) {
                listener.statusUpdated(queue, status);
            }
            if (averageWaitTime != -1) {
                listener.averageWaitTimeUpdated(queue, averageWaitTime);
            }
            if (oldestEntry != null) {
                listener.oldestEntryUpdated(queue, oldestEntry);
            }
            if (users != null) {
                listener.usersUpdated(queue, users);
            }
        }
    }
}
项目:Smack    文件:WorkgroupQueue.java   
/**
 * Returns an Iterator for the users in the queue waiting to be routed to
 * an agent (QueueUser instances).
 *
 * @return an Iterator for the users waiting in the queue.
 */
public Iterator<QueueUser> getUsers() {
    if (users == null) {
        return new HashSet<QueueUser>().iterator();
    }
    return Collections.unmodifiableSet(users).iterator();
}
项目:Smack    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(dateFormat.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:EIM    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(DATE_FORMATTER.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:androidPN-client.    文件:WorkgroupQueue.java   
/**
 * Returns an Iterator for the users in the queue waiting to be routed to
 * an agent (QueueUser instances).
 *
 * @return an Iterator for the users waiting in the queue.
 */
public Iterator<QueueUser> getUsers() {
    if (users == null) {
        return new HashSet<QueueUser>().iterator();
    }
    return Collections.unmodifiableSet(users).iterator();
}
项目:androidPN-client.    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(dateFormat.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:xmppsupport_v2    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"")
            .append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i = users.iterator(); i.hasNext();) {
            QueueUser user = (QueueUser) i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID())
                    .append("\">");

            if (position != -1) {
                buf.append("<position>").append(position)
                        .append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining)
                        .append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(dateFormat.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:java-bells    文件:WorkgroupQueue.java   
/**
 * Returns an Iterator for the users in the queue waiting to be routed to
 * an agent (QueueUser instances).
 *
 * @return an Iterator for the users waiting in the queue.
 */
public Iterator<QueueUser> getUsers() {
    if (users == null) {
        return new HashSet<QueueUser>().iterator();
    }
    return Collections.unmodifiableSet(users).iterator();
}
项目:java-bells    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(dateFormat.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:telegraph    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(dateFormat.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:NewCommunication-Android    文件:QueueDetails.java   
public String toXML() {
    StringBuilder buf = new StringBuilder();
    buf.append("<").append(ELEMENT_NAME).append(" xmlns=\"").append(NAMESPACE).append("\">");

    synchronized (users) {
        for (Iterator<QueueUser> i=users.iterator(); i.hasNext(); ) {
            QueueUser user = (QueueUser)i.next();
            int position = user.getQueuePosition();
            int timeRemaining = user.getEstimatedRemainingTime();
            Date timestamp = user.getQueueJoinTimestamp();

            buf.append("<user jid=\"").append(user.getUserID()).append("\">");

            if (position != -1) {
                buf.append("<position>").append(position).append("</position>");
            }

            if (timeRemaining != -1) {
                buf.append("<time>").append(timeRemaining).append("</time>");
            }

            if (timestamp != null) {
                buf.append("<join-time>");
                buf.append(DATE_FORMATTER.format(timestamp));
                buf.append("</join-time>");
            }

            buf.append("</user>");
        }
    }
    buf.append("</").append(ELEMENT_NAME).append(">");
    return buf.toString();
}
项目:Smack    文件:WorkgroupQueue.java   
void setUsers(Set<QueueUser> users) {
    this.users = users;
}
项目:Smack    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:Smack    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:EIM    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:EIM    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:EIM    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser) throws Exception {
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG &&
            "notify-queue-details".equals(parser.getName()))
    {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG) && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                        || (! "user".equals(parser.getName())))
            {
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                }
                else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                }
                else if ("join-time".equals(parser.getName())) {
                    joinTime = DATE_FORMATTER.parse(parser.nextText());
                }
                else if( parser.getName().equals( "waitTime" ) ) {
                  Date wait = DATE_FORMATTER.parse( parser.nextText() );
                  System.out.println( wait );
                }



                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }



            queueDetails.addUser(new QueueUser(uid, position, time, joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:androidPN-client.    文件:WorkgroupQueue.java   
void setUsers(Set<QueueUser> users) {
    this.users = users;
}
项目:androidPN-client.    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:androidPN-client.    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:androidPN-client.    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser) throws Exception {

    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG &&
            "notify-queue-details".equals(parser.getName()))
    {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG) && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                        || (! "user".equals(parser.getName())))
            {                        
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                }
                else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                }
                else if ("join-time".equals(parser.getName())) {
                    joinTime = dateFormat.parse(parser.nextText());                            
                }
                else if( parser.getName().equals( "waitTime" ) ) {
                    Date wait = dateFormat.parse(parser.nextText());
                    System.out.println( wait );
                }

                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }                   

            queueDetails.addUser(new QueueUser(uid, position, time, joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:xmppsupport_v2    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:xmppsupport_v2    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser)
        throws Exception {

    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG
            && "notify-queue-details".equals(parser.getName())) {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG)
                && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                    || (!"user".equals(parser.getName()))) {
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                } else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                } else if ("join-time".equals(parser.getName())) {
                    joinTime = dateFormat.parse(parser.nextText());
                } else if (parser.getName().equals("waitTime")) {
                    Date wait = dateFormat.parse(parser.nextText());
                    System.out.println(wait);
                }

                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }

            queueDetails.addUser(new QueueUser(uid, position, time,
                    joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:java-bells    文件:WorkgroupQueue.java   
void setUsers(Set<QueueUser> users) {
    this.users = users;
}
项目:java-bells    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:java-bells    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:java-bells    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser) throws Exception {

    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG &&
            "notify-queue-details".equals(parser.getName()))
    {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG) && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                        || (! "user".equals(parser.getName())))
            {                        
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                }
                else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                }
                else if ("join-time".equals(parser.getName())) {
                    joinTime = dateFormat.parse(parser.nextText());                            
                }
                else if( parser.getName().equals( "waitTime" ) ) {
                    Date wait = dateFormat.parse(parser.nextText());
                    System.out.println( wait );
                }

                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }

            queueDetails.addUser(new QueueUser(uid, position, time, joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:telegraph    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:telegraph    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:telegraph    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser) throws Exception {

    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG &&
            "notify-queue-details".equals(parser.getName()))
    {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG) && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                        || (! "user".equals(parser.getName())))
            {                        
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                }
                else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                }
                else if ("join-time".equals(parser.getName())) {
                    joinTime = dateFormat.parse(parser.nextText());                            
                }
                else if( parser.getName().equals( "waitTime" ) ) {
                    Date wait = dateFormat.parse(parser.nextText());
                    System.out.println( wait );
                }

                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }                   

            queueDetails.addUser(new QueueUser(uid, position, time, joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:NewCommunication-Android    文件:QueueDetails.java   
/**
 * Creates a new QueueDetails packet
 */
private QueueDetails() {
    users = new HashSet<QueueUser>();
}
项目:NewCommunication-Android    文件:QueueDetails.java   
/**
 * Adds a user to the packet.
 *
 * @param user the user.
 */
private void addUser(QueueUser user) {
    synchronized (users) {
        users.add(user);
    }
}
项目:NewCommunication-Android    文件:QueueDetails.java   
public PacketExtension parseExtension(XmlPullParser parser) throws Exception {
    QueueDetails queueDetails = new QueueDetails();

    int eventType = parser.getEventType();
    while (eventType != XmlPullParser.END_TAG &&
            "notify-queue-details".equals(parser.getName()))
    {
        eventType = parser.next();
        while ((eventType == XmlPullParser.START_TAG) && "user".equals(parser.getName())) {
            String uid = null;
            int position = -1;
            int time = -1;
            Date joinTime = null;

            uid = parser.getAttributeValue("", "jid");

            if (uid == null) {
                // throw exception
            }

            eventType = parser.next();
            while ((eventType != XmlPullParser.END_TAG)
                        || (! "user".equals(parser.getName())))
            {
                if ("position".equals(parser.getName())) {
                    position = Integer.parseInt(parser.nextText());
                }
                else if ("time".equals(parser.getName())) {
                    time = Integer.parseInt(parser.nextText());
                }
                else if ("join-time".equals(parser.getName())) {
                    joinTime = DATE_FORMATTER.parse(parser.nextText());
                }
                else if( parser.getName().equals( "waitTime" ) ) {
                  Date wait = DATE_FORMATTER.parse( parser.nextText() );
                  System.out.println( wait );
                }



                eventType = parser.next();

                if (eventType != XmlPullParser.END_TAG) {
                    // throw exception
                }
            }



            queueDetails.addUser(new QueueUser(uid, position, time, joinTime));

            eventType = parser.next();
        }
    }
    return queueDetails;
}
项目:Smack    文件:QueueUsersListener.java   
/**
 * The list of users waiting in the queue was updated.
 *
 * @param queue the workgroup queue.
 * @param users the list of users waiting in the queue.
 */
public void usersUpdated(WorkgroupQueue queue, Set<QueueUser> users);
项目:Smack    文件:QueueDetails.java   
/**
 * Returns the set of users in the queue that are waiting to
 * be routed to an agent (as QueueUser objects).
 *
 * @return a Set for the users waiting in a queue.
 */
public Set<QueueUser> getUsers() {
    synchronized (users) {
        return users;
    }
}
项目:EIM    文件:QueueDetails.java   
/**
 * Returns the set of users in the queue that are waiting to
 * be routed to an agent (as QueueUser objects).
 *
 * @return a Set for the users waiting in a queue.
 */
public Set<QueueUser> getUsers() {
    synchronized (users) {
        return users;
    }
}
项目:androidPN-client.    文件:QueueUsersListener.java   
/**
 * The list of users waiting in the queue was updated.
 *
 * @param queue the workgroup queue.
 * @param users the list of users waiting in the queue.
 */
public void usersUpdated(WorkgroupQueue queue, Set<QueueUser> users);
项目:androidPN-client.    文件:QueueDetails.java   
/**
 * Returns the set of users in the queue that are waiting to
 * be routed to an agent (as QueueUser objects).
 *
 * @return a Set for the users waiting in a queue.
 */
public Set<QueueUser> getUsers() {
    synchronized (users) {
        return users;
    }
}