Search in sources :

Example 16 with Jingle

use of org.jivesoftware.smackx.jingle.element.Jingle in project Smack by igniterealtime.

the class JingleS5BTransportManager method createCandidateUsed.

public Jingle createCandidateUsed(FullJid recipient, FullJid initiator, String sessionId, JingleContent.Senders contentSenders, JingleContent.Creator contentCreator, String contentName, String streamId, String candidateId) {
    Jingle.Builder jb = Jingle.builder(connection());
    jb.setSessionId(sessionId).setInitiator(initiator).setAction(JingleAction.transport_info);
    JingleContent.Builder cb = JingleContent.getBuilder();
    cb.setName(contentName).setCreator(contentCreator).setSenders(contentSenders);
    JingleS5BTransport.Builder tb = JingleS5BTransport.getBuilder();
    tb.setCandidateUsed(candidateId).setStreamId(streamId);
    Jingle jingle = jb.addJingleContent(cb.setTransport(tb.build()).build()).build();
    jingle.setFrom(getConnection().getUser().asFullJidOrThrow());
    jingle.setTo(recipient);
    return jingle;
}
Also used : Jingle(org.jivesoftware.smackx.jingle.element.Jingle) JingleContent(org.jivesoftware.smackx.jingle.element.JingleContent) JingleS5BTransport(org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransport)

Example 17 with Jingle

use of org.jivesoftware.smackx.jingle.element.Jingle in project Smack by igniterealtime.

the class JingleUtil method createSessionTerminateContentCancel.

public Jingle createSessionTerminateContentCancel(FullJid recipient, String sessionId, JingleContent.Creator contentCreator, String contentName) {
    Jingle.Builder jb = Jingle.builder(connection);
    jb.setAction(JingleAction.session_terminate).setSessionId(sessionId);
    JingleContent.Builder cb = JingleContent.getBuilder();
    cb.setCreator(contentCreator).setName(contentName);
    Jingle jingle = jb.addJingleContent(cb.build()).build();
    jingle.setFrom(connection.getUser());
    jingle.setTo(recipient);
    return jingle;
}
Also used : Jingle(org.jivesoftware.smackx.jingle.element.Jingle) JingleContent(org.jivesoftware.smackx.jingle.element.JingleContent)

Example 18 with Jingle

use of org.jivesoftware.smackx.jingle.element.Jingle in project Smack by igniterealtime.

the class JingleUtil method createSessionTerminate.

public Jingle createSessionTerminate(FullJid recipient, String sessionId, JingleReason reason) {
    Jingle.Builder jb = Jingle.builder(connection);
    jb.setAction(JingleAction.session_terminate).setSessionId(sessionId).setReason(reason);
    Jingle jingle = jb.build();
    jingle.setFrom(connection.getUser());
    jingle.setTo(recipient);
    return jingle;
}
Also used : Jingle(org.jivesoftware.smackx.jingle.element.Jingle)

Example 19 with Jingle

use of org.jivesoftware.smackx.jingle.element.Jingle in project Smack by igniterealtime.

the class JingleUtil method createSessionPing.

public Jingle createSessionPing(FullJid recipient, String sessionId) {
    Jingle.Builder jb = Jingle.builder(connection);
    jb.setSessionId(sessionId).setAction(JingleAction.session_info);
    Jingle jingle = jb.build();
    jingle.setFrom(connection.getUser());
    jingle.setTo(recipient);
    return jingle;
}
Also used : Jingle(org.jivesoftware.smackx.jingle.element.Jingle)

Aggregations

Jingle (org.jivesoftware.smackx.jingle.element.Jingle)19 JingleContent (org.jivesoftware.smackx.jingle.element.JingleContent)13 JingleS5BTransport (org.jivesoftware.smackx.jingle.transports.jingle_s5b.elements.JingleS5BTransport)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 EnumSource (org.junit.jupiter.params.provider.EnumSource)3 JingleReason (org.jivesoftware.smackx.jingle.element.JingleReason)2 FullJid (org.jxmpp.jid.FullJid)2 IOException (java.io.IOException)1 TimeoutException (java.util.concurrent.TimeoutException)1 SmackException (org.jivesoftware.smack.SmackException)1 XMPPException (org.jivesoftware.smack.XMPPException)1 StandardExtensionElement (org.jivesoftware.smack.packet.StandardExtensionElement)1 XmlElement (org.jivesoftware.smack.packet.XmlElement)1 Socks5BytestreamSession (org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamSession)1 Bytestream (org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)1 JingleAction (org.jivesoftware.smackx.jingle.element.JingleAction)1 JingleContentDescription (org.jivesoftware.smackx.jingle.element.JingleContentDescription)1 JingleContentTransport (org.jivesoftware.smackx.jingle.element.JingleContentTransport)1 Test (org.junit.jupiter.api.Test)1