Package org.apache.vysper.xmpp.server.response

Examples of org.apache.vysper.xmpp.server.response.ServerResponses


        }
        return body.build();
    }
   
    private Stanza getRestartResponse() {
        Stanza features = new ServerResponses().getFeaturesForSession();
        return wrapStanza(features);
    }
View Full Code Here


        }
        if (sessionStateHolder.getState() != SessionState.STARTED) {
            return respondTLSFailure();
        }

        Stanza responseStanza = new ServerResponses().getTLSProceed();

        // if all is correct, go to next phase
        sessionStateHolder.setState(SessionState.ENCRYPTION_STARTED);

        sessionContext.switchToTLS(true, false);
View Full Code Here

                // if (!server.doesServe(toEntity)) throw WhateverException();

                // TODO RFC3920: 'from' attribute SHOULD be silently ignored by the receiving entity
                // TODO RFC3920bis: 'from' attribute SHOULD be not ignored by the receiving entity and used as 'to' in responses
            }
            responseStanza = new ServerResponses().getStreamOpenerForClient(sessionContext.getServerJID(),
                    responseVersion, sessionContext);
        } else if (serverCall) {
            // RFC3920: 'from' attribute SHOULD be used by the receiving entity
            String fromValue = stanza.getAttributeValue("from");
            if (fromValue != null) {
                try {
                    EntityImpl.parse(fromValue);
                } catch (EntityFormatException e) {
                    return new ResponseStanzaContainerImpl(ServerErrorResponses.getStreamError(
                            StreamErrorCondition.INVALID_FROM, sessionContext.getXMLLang(),
                            "could not parse incoming stanza's FROM attribute", null));
                }
            }

            responseStanza = new ServerResponses().getStreamOpenerForServerAcceptor(sessionContext.getServerJID(),
                    responseVersion, sessionContext, serverRuntimeContext.getSslContext() != null);
        } else {
            String descriptiveText = "one of the two namespaces must be present: " + NamespaceURIs.JABBER_CLIENT
                    + " or " + NamespaceURIs.JABBER_SERVER;
            return respondIllegalNamespaceError(descriptiveText);
View Full Code Here

        checkLanguage("en_US");
    }

    protected void openClientSession() {
        sessionContext.setSessionState(getDefaultState());
        Stanza stanza = new ServerResponses().getStreamOpener(true, testFrom, sessionContext.getXMLLang(),
                XMPPVersion.VERSION_1_0, null).build();
        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza,
                sessionStateHolder);
    }
View Full Code Here

        assertTrue(responseVerifier.nameEquals("error"));
        assertTrue("error", responseVerifier.subElementPresent(StreamErrorCondition.UNSUPPORTED_VERSION.value()));
    }

    protected Stanza getVersionResponse(XMPPVersion versionSent) {
        Stanza stanza = new ServerResponses().getStreamOpener(true, testFrom, null, versionSent, null).build();
        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza,
                sessionStateHolder);

        return sessionContext.getNextRecordedResponse();
    }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.server.response.ServerResponses

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.