Java 类org.jivesoftware.smackx.workgroup.agent.WorkgroupQueue 实例源码

项目:spark-svn-mirror    文件:QueueActivity.java   
public void statusUpdated(final WorkgroupQueue queue, WorkgroupQueue.Status status) {

     EventQueue.invokeLater(new Runnable() {

public void run()
{
    String oldestEntry = queue.getOldestEntry() != null ? queue.getOldestEntry().toString() : "";

    QueueItem item = queues.get(queue);
    if (item != null) {
        item.setNumberOfUsersInQueue(queue.getUserCount());
        item.setAverageWaitTime(queue.getAverageWaitTime());
        update(item);
        return;
    }
    item = new QueueItem(queue.getName(), queue.getUserCount(), queue.getAverageWaitTime(), oldestEntry);
    queues.put(queue, item);
    model.addElement(item);
}           
     });
 }
项目:EIM    文件:QueueOverview.java   
public PacketExtension parseExtension (XmlPullParser parser) throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((DATE_FORMATTER.parse(parser.nextText())));
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:androidPN-client.    文件:QueueOverview.java   
public PacketExtension parseExtension (XmlPullParser parser) throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();            
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((dateFormat.parse(parser.nextText())));                    
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:xmppsupport_v2    文件:QueueOverview.java   
public PacketExtension parseExtension(XmlPullParser parser)
        throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
            || (!ELEMENT_NAME.equals(parser.getName()))) {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser
                    .nextText()));
        } else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser
                    .nextText()));
        } else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((dateFormat.parse(parser
                    .nextText())));
        } else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status
                    .fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:java-bells    文件:QueueOverview.java   
public PacketExtension parseExtension (XmlPullParser parser) throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();            
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((dateFormat.parse(parser.nextText())));                    
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:telegraph    文件:QueueOverview.java   
public PacketExtension parseExtension (XmlPullParser parser) throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();            
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((dateFormat.parse(parser.nextText())));                    
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:NewCommunication-Android    文件:QueueOverview.java   
public PacketExtension parseExtension (XmlPullParser parser) throws Exception {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();

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

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            queueOverview.setOldestEntry((DATE_FORMATTER.parse(parser.nextText())));
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:spark-svn-mirror    文件:QueueActivity.java   
public void usersUpdated(WorkgroupQueue queue, Set users) {
    QueueItem item = queues.get(queue);
    if (item == null) {
        statusUpdated(queue, queue.getStatus());
    }
    else {
        item.setNumberOfUsersInQueue(users.size());
    }

    update(item);
}
项目:spark-svn-mirror    文件:QueueActivity.java   
public void oldestEntryUpdated(WorkgroupQueue queue, Date date) {
    QueueItem item = queues.get(queue);
    if (item != null) {
        item.setOldestEntryDate(date);
    }
    update(item);
}
项目:spark-svn-mirror    文件:QueueActivity.java   
public void averageWaitTimeUpdated(WorkgroupQueue queue, int waitTime) {
    QueueItem item = queues.get(queue);
    if (item == null) {
        return;
    }
    item.setAverageWaitTime(waitTime);
    update(item);
}
项目:Smack    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:Smack    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:Smack    文件:QueueOverview.java   
@Override
public QueueOverview parse(XmlPullParser parser,
                int initialDepth) throws XmlPullParserException,
                IOException, SmackException {
    int eventType = parser.getEventType();
    QueueOverview queueOverview = new QueueOverview();            
    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);

    eventType = parser.next();
    while ((eventType != XmlPullParser.END_TAG)
                 || (!ELEMENT_NAME.equals(parser.getName())))
    {
        if ("count".equals(parser.getName())) {
            queueOverview.setUserCount(Integer.parseInt(parser.nextText()));
        }
        else if ("time".equals(parser.getName())) {
            queueOverview.setAverageWaitTime(Integer.parseInt(parser.nextText()));
        }
        else if ("oldest".equals(parser.getName())) {
            try {
                queueOverview.setOldestEntry((dateFormat.parse(parser.nextText())));
            } catch (ParseException e) {
                throw new SmackException(e);
            }
        }
        else if ("status".equals(parser.getName())) {
            queueOverview.setStatus(WorkgroupQueue.Status.fromString(parser.nextText()));
        }

        eventType = parser.next();

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

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

    return queueOverview;
}
项目:EIM    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:EIM    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:androidPN-client.    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:androidPN-client.    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:xmppsupport_v2    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:xmppsupport_v2    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:java-bells    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:java-bells    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:telegraph    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:telegraph    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}
项目:NewCommunication-Android    文件:QueueOverview.java   
public WorkgroupQueue.Status getStatus() {
    return status;
}
项目:NewCommunication-Android    文件:QueueOverview.java   
void setStatus(WorkgroupQueue.Status status) {
    this.status = status;
}