Java 类org.jivesoftware.smackx.pubsub.EventElementType 实例源码

项目:xmppsupport_v2    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement,
        String currentNamespace, Map<String, String> attMap,
        List<? extends PacketExtension> content) {
    return new EventElement(EventElementType.valueOf(content.get(0)
            .getElementName()), (NodeExtension) content.get(0));
}
项目:mangosta-android    文件:XMPPSession.java   
private void receiveBlogPosts() {
    PEPManager pepManager = PEPManager.getInstanceFor(mXMPPConnection);
    pepManager.addPEPListener(new PEPListener() {
        @Override
        public void eventReceived(EntityBareJid entityBareJid, EventElement eventElement, Message message) {
            if (EventElementType.items == eventElement.getEventType()) {
                ItemsExtension itemsExtension = (ItemsExtension) eventElement.getExtensions().get(0);
                PayloadItem payloadItem = (PayloadItem) itemsExtension.getItems().get(0);
                PostEntryExtension postEntryExtension = (PostEntryExtension) payloadItem.getPayload();

                String id = postEntryExtension.getId();
                String jid = entityBareJid.toString();
                String title = postEntryExtension.getTitle();
                Date published = postEntryExtension.getPublished();
                Date updated = postEntryExtension.getUpdated();

                BlogPost blogPost = new BlogPost(id, jid, null, title, published, updated);
                RealmManager.getInstance().saveBlogPost(blogPost);

                String commentsNode = PublishCommentExtension.NODE + "/" + id;
                ServiceDiscoveryManager.getInstanceFor(mXMPPConnection).addFeature(commentsNode + "+notify");

                notifyNewBlogPost();
            }
        }

        private void notifyNewBlogPost() {
            MangostaApplication mangostaApplication = MangostaApplication.getInstance();
            if (mangostaApplication.isClosed()) {
                BlogPostNotifications.newBlogPostNotification();
            } else {
                mangostaApplication.getCurrentActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        new Event(Event.Type.BLOG_POST_CREATED).post();
                    }
                });
            }
        }
    });
}
项目:Smack    文件:EventProvider.java   
@Override
protected EventElement createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends ExtensionElement> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}
项目:EIM    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}
项目:androidPN-client.    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}
项目:java-bells    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}
项目:telegraph    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}
项目:NewCommunication-Android    文件:EventProvider.java   
@Override
protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
{
    return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
}