Package org.apache.vysper.xmpp.stanza

Examples of org.apache.vysper.xmpp.stanza.MessageStanzaType


        logger.debug("Received message for MUC");
        Entity from = stanza.getFrom();
        Entity roomWithNickJid = stanza.getTo();
        Entity roomJid = roomWithNickJid.getBareJID();

        MessageStanzaType type = stanza.getMessageType();
        if(type != null && type == MessageStanzaType.GROUPCHAT) {
            // groupchat, message to a room

            // must not have a nick
            if(roomWithNickJid.getResource() != null) {
View Full Code Here


            if (PresenceStanza.isOfType(stanza)) {
                return relayToAllSessions();
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza)xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                switch (messageStanzaType) {
                    case CHAT:
                    case NORMAL:
                        return serverRuntimeContext.getServerFeatures().isDeliveringMessageToHighestPriorityResourcesOnly() ?
                                relayToBestSessions(false) : relayToAllSessions(0);
                   
                    case ERROR:
                        // silently ignore
                        return null;
                   
                    case GROUPCHAT:
                        return new RelayResult(new ServiceNotAvailableException());
                       
                    case HEADLINE:
                        return relayToAllSessions();
                   
                    default:
                        throw new RuntimeException("unhandled message type " + messageStanzaType.value());
                }
            } else if (IQStanza.isOfType(stanza)) {
                // TODO handle on behalf of the user/client
                throw new RuntimeException("inbound IQ not yet handled");
            }
View Full Code Here

                // TODO cannot deliver presence with type  SUBSCRIBE: see 3921bis section 3.1.3
                // TODO cannot deliver presence with type  (UN)SUBSCRIBED, UNSUBSCRIBE: silently ignore
                return relayToBestSessions(false);
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza)xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                boolean fallbackToBareJIDAllowed = messageStanzaType == MessageStanzaType.CHAT ||
                                                   messageStanzaType == MessageStanzaType.HEADLINE ||
                                                   messageStanzaType == MessageStanzaType.NORMAL;
                // TODO cannot deliver ERROR: silently ignore
                // TODO cannot deliver GROUPCHAT: service n/a
View Full Code Here

            if (PresenceStanza.isOfType(stanza)) {
                return relayToAllSessions();
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza) xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                switch (messageStanzaType) {
                case CHAT:
                case NORMAL:
                    return serverRuntimeContext.getServerFeatures().isDeliveringMessageToHighestPriorityResourcesOnly() ? relayToBestSessions(false)
                            : relayToAllSessions(0);

                case ERROR:
                    // silently ignore
                    return null;

                case GROUPCHAT:
                    return new RelayResult(new ServiceNotAvailableException());

                case HEADLINE:
                    return relayToAllSessions();

                default:
                    throw new RuntimeException("unhandled message type " + messageStanzaType.value());
                }
            } else if (IQStanza.isOfType(stanza)) {
                // TODO handle on behalf of the user/client
                throw new RuntimeException("inbound IQ not yet handled");
            }
View Full Code Here

                // TODO cannot deliver presence with type  SUBSCRIBE: see 3921bis section 3.1.3
                // TODO cannot deliver presence with type  (UN)SUBSCRIBED, UNSUBSCRIBE: silently ignore
                return relayToBestSessions(false);
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza) xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                boolean fallbackToBareJIDAllowed = messageStanzaType == MessageStanzaType.CHAT
                        || messageStanzaType == MessageStanzaType.HEADLINE
                        || messageStanzaType == MessageStanzaType.NORMAL;
                // TODO cannot deliver ERROR: silently ignore
                // TODO cannot deliver GROUPCHAT: service n/a
View Full Code Here

        logger.debug("Received message for MUC");
        Entity from = stanza.getFrom();
        Entity roomWithNickJid = stanza.getTo();
        Entity roomJid = roomWithNickJid.getBareJID();

        MessageStanzaType type = stanza.getMessageType();
        if (type != null && type == MessageStanzaType.GROUPCHAT) {
            // groupchat, message to a room

            // must not have a nick
            if (roomWithNickJid.getResource() != null) {
View Full Code Here

            if (PresenceStanza.isOfType(stanza)) {
                return relayToAllSessions();
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza) xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                switch (messageStanzaType) {
                case CHAT:
                case NORMAL:
                    return serverRuntimeContext.getServerFeatures().isDeliveringMessageToHighestPriorityResourcesOnly() ? relayToBestSessions(false)
                            : relayToAllSessions(0);

                case ERROR:
                    // silently ignore
                    return null;

                case GROUPCHAT:
                    return new RelayResult(new ServiceNotAvailableException());

                case HEADLINE:
                    return relayToAllSessions();

                default:
                    throw new RuntimeException("unhandled message type " + messageStanzaType.value());
                }
            } else if (IQStanza.isOfType(stanza)) {
                // TODO handle on behalf of the user/client
                throw new RuntimeException("inbound IQ not yet handled");
            }
View Full Code Here

                // TODO cannot deliver presence with type  SUBSCRIBE: see 3921bis section 3.1.3
                // TODO cannot deliver presence with type  (UN)SUBSCRIBED, UNSUBSCRIBE: silently ignore
                return relayToBestSessions(false);
            } else if (MessageStanza.isOfType(stanza)) {
                MessageStanza messageStanza = (MessageStanza) xmppStanza;
                MessageStanzaType messageStanzaType = messageStanza.getMessageType();
                boolean fallbackToBareJIDAllowed = messageStanzaType == MessageStanzaType.CHAT
                        || messageStanzaType == MessageStanzaType.HEADLINE
                        || messageStanzaType == MessageStanzaType.NORMAL;
                // TODO cannot deliver ERROR: silently ignore
                // TODO cannot deliver GROUPCHAT: service n/a
View Full Code Here

        logger.debug("Received message for MUC");
        Entity from = stanza.getFrom();
        Entity roomWithNickJid = stanza.getTo();
        Entity roomJid = roomWithNickJid.getBareJID();

        MessageStanzaType type = stanza.getMessageType();
        if (type != null && type == MessageStanzaType.GROUPCHAT) {
            // groupchat, message to a room

            // must not have a nick
            if (roomWithNickJid.getResource() != null) {
View Full Code Here

    // according to XEP-0160 only certain stanzas should be stored
    boolean store = false;
    logger.debug("Received Stanza for offline storage:" +stanza.getClass().getSimpleName());
    if (stanza instanceof MessageStanza) {
      MessageStanza messageStanza = (MessageStanza) stanza;
      MessageStanzaType type = messageStanza.getMessageType();
      switch (type) {
                case NORMAL:
                case CHAT:
                    store = true;
                    break;
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.stanza.MessageStanzaType

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.