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

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


       
        // adding the ack attribute here is needed because when responding to o request with the same RID (as is the case here)
        // the ack would not be included on BoshBackedSessionContext#write0, but this first ack is required.
        body.addAttribute("ack", Long.toString(session.getHighestReadRid()));

        Stanza features = new ServerResponses().getFeaturesForAuthentication(serverRuntimeContext.getServerFeatures()
                .getAuthenticationMethods());
        body.addPreparedElement(features);
        return body.build();
    }
View Full Code Here


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

        Stanza errorStanza = ServerErrorResponses.getInstance().getStreamError(StreamErrorCondition.UNSUPPORTED_STANZA_TYPE,
                sessionContext.getXMLLang(),
                "service unavailable at this session state",
                null);
        Stanza streamOpener = new ServerResponses().getStreamOpenerForError(false, sessionContext.getServerJID(), XMPPVersion.VERSION_1_0, errorStanza);

        writeErrorAndClose(sessionContext, streamOpener);
    }
View Full Code Here

        AuthorizationRetriesCounter counter = AuthorizationRetriesCounter.getFromSession(sessionContext);
        boolean moreTriesLeft = counter.countFailedTry(); // record that client aborted

        // TODO do more clean-ups as mechanism requires.

        return new ResponseStanzaContainerImpl(new ServerResponses().getAuthAborted());
    }
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().getStreamOpener(clientCall,
                    sessionContext.getServerJID(),
                    responseVersion,
                    sessionContext);
        } else if (serverCall) {
            // RFC3920: 'from' attribute SHOULD be used by the receiving entity
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();
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

    protected void checkLanguage(String xmlLang) {
        Stanza stanza;
        Stanza recordedResponse;
        XMLElementVerifier responseVerifier;
        stanza = new ServerResponses().getStreamOpener(true, testFrom, xmlLang, XMPPVersion.VERSION_1_0, null).build();
        protocolWorker.processStanza(sessionContext.getServerRuntimeContext(), sessionContext, stanza, sessionStateHolder);

        recordedResponse = sessionContext.getNextRecordedResponse();
        responseVerifier = recordedResponse.getVerifier();
        if (xmlLang == null) {
View Full Code Here

    public static void writeUnsupportedStanzaError(SessionContext sessionContext) {

        Stanza errorStanza = ServerErrorResponses.getInstance().getStreamError(
                StreamErrorCondition.UNSUPPORTED_STANZA_TYPE, sessionContext.getXMLLang(),
                "service unavailable at this session state", null);
        Stanza streamOpener = new ServerResponses().getStreamOpenerForError(false, sessionContext.getServerJID(),
                XMPPVersion.VERSION_1_0, errorStanza);

        writeErrorAndClose(sessionContext, streamOpener);
    }
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.