mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-11 18:19:38 +02:00
Temp
This commit is contained in:
parent
38f54b140c
commit
4728aa4452
13 changed files with 300 additions and 173 deletions
|
@ -16,20 +16,12 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.jivesoftware.smack.Manager;
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smackx.bytestreams.BytestreamListener;
|
||||
import org.jivesoftware.smackx.bytestreams.BytestreamSession;
|
||||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.jingle.element.Jingle;
|
||||
import org.jivesoftware.smackx.jingle.element.JingleContentDescription;
|
||||
import org.jivesoftware.smackx.jingle.element.JingleContentTransport;
|
||||
import org.jivesoftware.smackx.jingle.provider.JingleContentTransportProvider;
|
||||
import org.jxmpp.jid.FullJid;
|
||||
|
||||
/**
|
||||
* This class defines the shape that JingleTransportManager must be of.
|
||||
|
@ -46,18 +38,11 @@ public abstract class AbstractJingleTransportManager<D extends JingleContentTran
|
|||
|
||||
protected abstract JingleContentTransportProvider<D> createJingleContentTransportProvider();
|
||||
|
||||
public abstract JingleTransportHandler<D> createJingleTransportHandler(JingleSessionHandler sessionHandler);
|
||||
|
||||
public abstract D createJingleContentTransport(JingleManager.FullJidAndSessionId target) throws Exception;
|
||||
|
||||
public abstract D createJingleContentTransport(Jingle remotesRequest) throws Exception;
|
||||
|
||||
public abstract String getNamespace();
|
||||
|
||||
public Jingle createSessionInitiate(FullJid targetJID, JingleContentDescription application) throws XMPPException, IOException, InterruptedException, SmackException {
|
||||
return createSessionInitiate(targetJID, application, JingleTransportManager.generateRandomId());
|
||||
}
|
||||
|
||||
public abstract Jingle createSessionInitiate(FullJid targetJID, JingleContentDescription application, String sessionId) throws XMPPException, IOException, InterruptedException, SmackException;
|
||||
|
||||
public abstract Jingle createSessionAccept(Jingle request) throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException;
|
||||
|
||||
public abstract BytestreamSession outgoingInitiatedSession(Jingle jingle) throws Exception;
|
||||
|
||||
public abstract void setIncomingRespondedSessionListener(Jingle jingle, BytestreamListener listener);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smackx.jingle.element.Jingle;
|
||||
|
||||
|
@ -23,4 +24,6 @@ public interface JingleSessionHandler {
|
|||
|
||||
IQ handleJingleSessionRequest(Jingle jingle, String sessionId);
|
||||
|
||||
XMPPConnection getConnection();
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import org.jivesoftware.smackx.bytestreams.BytestreamSession;
|
||||
import org.jivesoftware.smackx.jingle.exception.JingleTransportFailureException;
|
||||
|
||||
/**
|
||||
* Created by vanitas on 10.06.17.
|
||||
*/
|
||||
public interface JingleTransportEstablishedCallback {
|
||||
void onSessionEstablished(BytestreamSession bytestreamSession);
|
||||
|
||||
void onSessionFailure(JingleTransportFailureException reason);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smackx.jingle.element.JingleContentTransport;
|
||||
|
||||
/**
|
||||
* Handler for JingleTransports
|
||||
*/
|
||||
public interface JingleTransportHandler<D extends JingleContentTransport> {
|
||||
|
||||
void establishOutgoingSession(JingleManager.FullJidAndSessionId target, JingleContentTransport transport, JingleTransportEstablishedCallback callback);
|
||||
|
||||
void establishIncomingSession(JingleManager.FullJidAndSessionId target, JingleContentTransport transport, JingleTransportEstablishedCallback callback);
|
||||
|
||||
XMPPConnection getConnection();
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package org.jivesoftware.smackx.jingle.exception;
|
||||
|
||||
/**
|
||||
* Created by vanitas on 10.06.17.
|
||||
*/
|
||||
public class JingleTransportFailureException extends Exception {
|
||||
|
||||
public JingleTransportFailureException(Throwable wrapped) {
|
||||
super(wrapped);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue