Package org.apache.vysper.xmpp.server.s2s

Examples of org.apache.vysper.xmpp.server.s2s.XMPPServerConnector


         */
        @SpecCompliant(spec = "draft-ietf-xmpp-3920bis-22", section = "10.4", status = SpecCompliant.ComplianceStatus.IN_PROGRESS, coverage = SpecCompliant.ComplianceCoverage.COMPLETE)
        protected RelayResult deliver() {
            try {
                RelayResult relayResult = new RelayResult();
                XMPPServerConnector connector = serverRuntimeContext.getServerConnectorRegistry().connect(EntityImpl.parseUnchecked(stanza.getTo().getDomain()));
               
                connector.write(stanza);
                return relayResult;
            } catch (DeliveryException e) {
                return new RelayResult(e);
            }
        }
View Full Code Here


            String dailbackId = stanza.getInnerText().getText();
            Entity receiving = EntityImpl.parseUnchecked(stanza.getAttributeValue("from"));
            Entity originating = serverRuntimeContext.getServerEnitity();
           
            try {
                XMPPServerConnector connector = serverRuntimeContext.getServerConnectorRegistry().connectForDialback(receiving, sessionContext, sessionStateHolder);
               
                /*
                     <db:verify
                      from='target.tld'
                      id='417GAF25'
                      to='sender.tld'>
                       38b501ec606752318f72ad53de17ac6d15f86257485b0d8f5d54e1f619e6b869
                     </db:verify>
                 */
               
                StanzaBuilder verifyBuilder = new StanzaBuilder("verify", NamespaceURIs.JABBER_SERVER_DIALBACK, "db");
                verifyBuilder.addAttribute("from", originating.getFullQualifiedName());
                verifyBuilder.addAttribute("to", receiving.getFullQualifiedName());
                verifyBuilder.addAttribute("id", sessionContext.getSessionId());
                verifyBuilder.addText(dailbackId);
                connector.write(verifyBuilder.build());
                return null;
            } catch (Exception e) {
                StanzaBuilder builder = new StanzaBuilder("result", NamespaceURIs.JABBER_SERVER_DIALBACK, "db");
                builder.addAttribute("from", originating.getDomain());
                builder.addAttribute("to", receiving.getDomain());
View Full Code Here

        Assert.assertEquals(FROM, failedStanza.getFrom());
        Assert.assertEquals(TO, failedStanza.getTo());
    }

    public void testSuccessfulRelay() throws Exception {
        XMPPServerConnector connector = Mockito.mock(XMPPServerConnector.class);
       
        XMPPServerConnectorRegistry registry = Mockito.mock(XMPPServerConnectorRegistry.class);
        Mockito.when(registry.connect(SERVER)).thenReturn(connector);

        ServerRuntimeContext serverRuntimeContext = Mockito.mock(ServerRuntimeContext.class);
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.server.s2s.XMPPServerConnector

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.