Examples of StanzaHandler


Examples of org.apache.vysper.xmpp.protocol.StanzaHandler

                if (sessionContext.getState() != SessionState.AUTHENTICATED) {
                    relayResult.addProcessingError(new DeliveryException("no relay to non-authenticated sessions"));
                    continue;
                }
                try {
                    StanzaHandler stanzaHandler = sessionContext.getServerRuntimeContext().getHandler(stanza);
                    INBOUND_STANZA_PROTOCOL_WORKER.processStanza(sessionContext, sessionStateHolder, stanza,
                            stanzaHandler);
                } catch (Exception e) {
                    relayResult.addProcessingError(new DeliveryException(e));
                }
View Full Code Here

Examples of org.apache.vysper.xmpp.protocol.StanzaHandler

                close();
            } else if(message instanceof Stanza) {
                Stanza stanza = (Stanza) message;
               
                // check for basic stanza handlers
                StanzaHandler handler = lookupHandler(stanza);
               
                if(handler != null) {
                    ResponseStanzaContainer container = handler.execute(stanza, serverRuntimeContext, false, sessionContext, sessionStateHolder);
                    if(container != null && container.hasResponse()) {
                        sessionContext.write(container.getResponseStanza());
                    }
                   
                    if(sessionStateHolder.getState() == SessionState.AUTHENTICATED) {
View Full Code Here

Examples of org.apache.vysper.xmpp.protocol.StanzaHandler

        XMLElement firstInnerElement = stanza;
        if (stanza.getVerifier().subElementsPresentExact(1)) {
            firstInnerElement = stanza.getFirstInnerElement();
        }

        StanzaHandler stanzaHandler = getHandlerForElement(stanza, firstInnerElement);

        if (stanzaHandler == null)
            stanzaHandler = defaultHandlers.get(stanza);

        return stanzaHandler;
View Full Code Here

Examples of org.apache.vysper.xmpp.protocol.StanzaHandler

        if (terminationCause == SessionTerminationCause.CLIENT_BYEBYE
                || terminationCause == SessionTerminationCause.CONNECTION_ABORT) {
            if(getState().equals(SessionState.AUTHENTICATED)) {
                Stanza unavailableStanza = StanzaBuilder.createUnavailablePresenceStanza(null, terminationCause);
                StanzaHandler handler = serverRuntimeContext.getHandler(unavailableStanza);
                try {
                    handler.execute(unavailableStanza, serverRuntimeContext, true, this, sessionStateHolder);
                } catch (ProtocolException e) {
                    logger.error("Failed to send unavailable stanza on connection close", e);
                }
            }
        } else if (terminationCause == SessionTerminationCause.SERVER_SHUTDOWN) {
View Full Code Here

Examples of org.jivesoftware.openfire.net.StanzaHandler

    }

    @Override
  public void messageReceived(IoSession session, Object message) throws Exception {
        // Get the stanza handler for this session
        StanzaHandler handler = (StanzaHandler) session.getAttribute(HANDLER);
        // Get the parser to use to process stanza. For optimization there is going
        // to be a parser for each running thread. Each Filter will be executed
        // by the Executor placed as the first Filter. So we can have a parser associated
        // to each Thread
        int hashCode = Thread.currentThread().hashCode();
        XMPPPacketReader parser = parsers.get(hashCode);
        if (parser == null) {
            parser = new XMPPPacketReader();
            parser.setXPPFactory(factory);
            parsers.put(hashCode, parser);
        }
        // Update counter of read btyes
        updateReadBytesCounter(session);
        //System.out.println("RCVD: " + message);
        // Let the stanza handler process the received stanza
        try {
            handler.process((String) message, parser);
        } catch (Exception e) {
            Log.error("Closing connection due to error while processing message: " + message, e);
            Connection connection = (Connection) session.getAttribute(CONNECTION);
            connection.close();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.