• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JingleChannelIQ类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.xmpp.jnodes.smack.JingleChannelIQ的典型用法代码示例。如果您正苦于以下问题:Java JingleChannelIQ类的具体用法?Java JingleChannelIQ怎么用?Java JingleChannelIQ使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JingleChannelIQ类属于org.xmpp.jnodes.smack包,在下文中一共展示了JingleChannelIQ类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: discoInfoFeatureNamespaces

点赞 2

import org.xmpp.jnodes.smack.JingleChannelIQ; //导入依赖的package包/类
@Override
protected String[] discoInfoFeatureNamespaces() {
    return new String[]{JingleChannelIQ.NAMESPACE, JingleTrackerIQ.NAMESPACE};
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:5,
代码来源:JingleNodesComponent.java

示例2: handleIQGet

点赞 2

import org.xmpp.jnodes.smack.JingleChannelIQ; //导入依赖的package包/类
@Override
protected IQ handleIQGet(IQ iq) throws Exception {
    final IQ reply = IQ.createResultIQ(iq);

    final Element element = iq.getChildElement();
    final String namespace = element.getNamespaceURI();

    if (JingleChannelIQ.NAME.equals(element.getName()) && JingleChannelIQ.NAMESPACE.equals(namespace)
            && UDP.equals(element.attributeValue(PROTOCOL))) {
        final Element childElement = iq.getChildElement().createCopy();
        final RelayChannel channel = plugin.createRelayChannel();

        if (channel != null) {

            childElement.addAttribute(HOST, plugin.getPublicIP());
            childElement.addAttribute(LOCAL_PORT, Integer.toString(channel.getPortA()));
            childElement.addAttribute(REMOTE_PORT, Integer.toString(channel.getPortB()));

            reply.setChildElement(childElement);

            Log.debug("Created relay channel {}:{}, {}:{}, {}:{}", new Object[]{HOST,
                    plugin.getPublicIP(), LOCAL_PORT, Integer.toString(channel.getPortA()), REMOTE_PORT,
                    Integer.toString(channel.getPortB())});

        } else {
            reply.setError(PacketError.Condition.internal_server_error);
        }
        return reply;
    } else if (JingleTrackerIQ.NAME.equals(element.getName()) && JingleTrackerIQ.NAMESPACE.equals(namespace)) {

        final List<TrackerEntry> entries = new ArrayList<TrackerEntry>();
        entries.add(new TrackerEntry(TrackerEntry.Type.relay, TrackerEntry.Policy._roster, plugin.getServiceName() + "." + getDomain(), UDP));

        final String elements = getChildElementXML(entries);

        final Element e = DocumentHelper.parseText(elements).getRootElement();

        reply.setChildElement(e);

        return reply;
    }


    return null; // feature not implemented.
}
 

开发者ID:igniterealtime,
项目名称:Openfire,
代码行数:46,
代码来源:JingleNodesComponent.java

示例3: handleIQGet

点赞 2

import org.xmpp.jnodes.smack.JingleChannelIQ; //导入依赖的package包/类
@Override
protected IQ handleIQGet(IQ iq) throws Exception {
    final IQ reply = IQ.createResultIQ(iq);

    final Element element = iq.getChildElement();
    final String namespace = element.getNamespaceURI();

    if (JingleChannelIQ.NAME.equals(element.getName()) && JingleChannelIQ.NAMESPACE.equals(namespace)
            && UDP.equals(element.attributeValue(PROTOCOL))) {
        final Element childElement = iq.getChildElement().createCopy();
        final RelayChannel channel = plugin.createRelayChannel();

        if (channel != null) {

            childElement.addAttribute(HOST, LocalIPResolver.getLocalIP());
            childElement.addAttribute(LOCAL_PORT, Integer.toString(channel.getPortA()));
            childElement.addAttribute(REMOTE_PORT, Integer.toString(channel.getPortB()));

            reply.setChildElement(childElement);

            Log.debug("Created relay channel {}:{}, {}:{}, {}:{}", new Object[]{HOST,
                    LocalIPResolver.getLocalIP(), LOCAL_PORT, Integer.toString(channel.getPortA()), REMOTE_PORT,
                    Integer.toString(channel.getPortB())});

        } else {
            reply.setError(PacketError.Condition.internal_server_error);
        }
        return reply;
    } else if (JingleTrackerIQ.NAME.equals(element.getName()) && JingleTrackerIQ.NAMESPACE.equals(namespace)) {

        final List<TrackerEntry> entries = new ArrayList<TrackerEntry>();
        entries.add(new TrackerEntry(TrackerEntry.Type.relay, TrackerEntry.Policy._roster, plugin.getServiceName() + "." + getDomain(), UDP));

        final String elements = getChildElementXML(entries);

        final Element e = DocumentHelper.parseText(elements).getRootElement();

        reply.setChildElement(e);

        return reply;
    }


    return null; // feature not implemented.
}
 

开发者ID:coodeer,
项目名称:g3server,
代码行数:46,
代码来源:JingleNodesComponent.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)