Package rocks.xmpp.extensions.disco.model.info

Examples of rocks.xmpp.extensions.disco.model.info.InfoNode


     * @return The capabilities in form of a info node, which contains the identities, the features and service discovery extensions.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public InfoNode getCapabilities(Jid jid) throws XmppException {
        InfoNode infoNode = jidInfos.get(jid);
        if (infoNode == null) {
            synchronized (jidInfos) {
                infoNode = serviceDiscoveryManager.discoverInformation(jid);
                jidInfos.put(jid, infoNode);
            }
View Full Code Here


     * @return True, if this entity supports the feature.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public boolean isSupported(String feature, Jid jid) throws XmppException {
        InfoNode infoNode = getCapabilities(jid);
        return infoNode.getFeatures().contains(new Feature(feature));
    }
View Full Code Here

        boolean isSupported = xmppSession.getStreamFeaturesManager().getFeatures().containsKey(RegisterFeature.class);

        // Since the stream feature is only optional, discover the server features, too.
        if (!isSupported) {
            ServiceDiscoveryManager serviceDiscoveryManager = xmppSession.getExtensionManager(ServiceDiscoveryManager.class);
            InfoNode infoNode = serviceDiscoveryManager.discoverInformation(null);
            isSupported = infoNode.getFeatures().contains(new Feature("jabber:iq:register"));
        }
        return isSupported;
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.disco.model.info.InfoNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.