Package rocks.xmpp.extensions.jingle.transports.s5b.model

Examples of rocks.xmpp.extensions.jingle.transports.s5b.model.S5bTransportMethod


                "  </jingle>\n";

        Jingle jingle = unmarshal(xml, Jingle.class);
        Assert.assertNotNull(jingle);
        Assert.assertTrue(jingle.getContents().get(0).getTransportMethod() instanceof S5bTransportMethod);
        S5bTransportMethod s5bTransportMethod = (S5bTransportMethod) jingle.getContents().get(0).getTransportMethod();
        Assert.assertNotNull(s5bTransportMethod);
        Assert.assertNull(jingle.getContents().get(0).getApplicationFormat());
        Assert.assertEquals(s5bTransportMethod.getDstAddr(), "1a12fb7bc625e55f3ed5b29a53dbe0e4aa7d80ba");
        Assert.assertEquals(s5bTransportMethod.getSessionId(), "vj3hs98y");
        Assert.assertEquals(s5bTransportMethod.getMode(), S5bTransportMethod.Mode.TCP);
        Assert.assertEquals(s5bTransportMethod.getCandidates().size(), 4);
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getCid(), "ht567dq");
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getHost(), "192.169.1.10");
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getJid(), Jid.valueOf("juliet@capulet.lit/balcony"));
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getPort(), 6539);
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getPriority(), 8257636);
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(0).getType(), S5bTransportMethod.Candidate.Type.DIRECT);

        Assert.assertEquals(s5bTransportMethod.getCandidates().get(1).getType(), S5bTransportMethod.Candidate.Type.TUNNEL);

        Assert.assertEquals(s5bTransportMethod.getCandidates().get(2).getType(), S5bTransportMethod.Candidate.Type.ASSISTED);

        Assert.assertEquals(s5bTransportMethod.getCandidates().get(3).getJid(), Jid.valueOf("proxy.marlowe.lit"));
        Assert.assertEquals(s5bTransportMethod.getCandidates().get(3).getType(), S5bTransportMethod.Candidate.Type.PROXY);
    }
View Full Code Here


        this.socks5ByteStreamManager = xmppSession.getExtensionManager(Socks5ByteStreamManager.class);
    }


    private S5bTransportMethod createTransport() throws IOException {
        S5bTransportMethod s5bTransportMethod = new S5bTransportMethod();
        List<StreamHost> streamHosts = socks5ByteStreamManager.getAvailableStreamHosts();

        for (StreamHost streamHost : streamHosts) {
            s5bTransportMethod.getCandidates().add(new S5bTransportMethod.Candidate(UUID.randomUUID().toString(), streamHost.getHost(), streamHost.getJid(), 0, streamHost.getJid().equals(xmppSession.getConnectedResource()) ? S5bTransportMethod.Candidate.Type.DIRECT : S5bTransportMethod.Candidate.Type.PROXY, streamHost.getPort()));
        }
        return s5bTransportMethod;
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.jingle.transports.s5b.model.S5bTransportMethod

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.