diff options
author | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-07-29 15:54:09 (GMT) |
---|---|---|
committer | Alex Clayton <alex.clayton@isode.com> | 2016-01-14 15:38:31 (GMT) |
commit | 72249383639858b1a7947b1afc6b9491ebd82bf8 (patch) | |
tree | 03af3e75006a133ee365116384bcc659543e183e /src/com/isode/stroke/jingle/JingleSession.java | |
parent | 701abcb162dfb3e7cc8c6a9ada81a16d1fc8d4ee (diff) | |
download | stroke-72249383639858b1a7947b1afc6b9491ebd82bf8.zip stroke-72249383639858b1a7947b1afc6b9491ebd82bf8.tar.bz2 |
Completes Jingle.
Adds Listenable, JingleSession, JingleContentID, FakeJingleSession, JingleSessionListener,
JingleSessionManager, JingleResponder.
NotifyListeners are not in line with Swiften and have to be corrected.
License:
This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Test-Information:
None.
Change-Id: I6533b2be02a0843277a63ca115348ff6138a0fc0
Diffstat (limited to 'src/com/isode/stroke/jingle/JingleSession.java')
-rw-r--r-- | src/com/isode/stroke/jingle/JingleSession.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/com/isode/stroke/jingle/JingleSession.java b/src/com/isode/stroke/jingle/JingleSession.java new file mode 100644 index 0000000..38ee9cd --- /dev/null +++ b/src/com/isode/stroke/jingle/JingleSession.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2011-2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ +/* + * Copyright (c) 2015 Tarun Gupta. + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +package com.isode.stroke.jingle; + +import com.isode.stroke.elements.JinglePayload; +import com.isode.stroke.elements.JingleDescription; +import com.isode.stroke.elements.JingleTransportPayload; +import com.isode.stroke.elements.Payload; +import com.isode.stroke.jid.JID; +import com.isode.stroke.base.Listenable; +import java.util.Vector; + +public abstract class JingleSession extends Listenable<JingleSessionListener> { + + private JID initiator = new JID(); + private String id = ""; + private Vector<JingleSessionListener> listeners = new Vector<JingleSessionListener>(); + + public JingleSession(final JID initiator, final String id) { + this.initiator = initiator; + this.id = id; + // initiator must always be a full JID; session lookup based on it wouldn't work otherwise + // this is checked on an upper level so that the assert never fails + assert(!initiator.isBare()); + } + + public JID getInitiator() { + return initiator; + } + + public String getID() { + return id; + } + + public abstract void sendInitiate(final JingleContentID id, JingleDescription description, JingleTransportPayload transport); + public abstract void sendTerminate(JinglePayload.Reason.Type reason); + public abstract void sendInfo(Payload payload); + public abstract void sendAccept(final JingleContentID id, JingleDescription description); + public abstract void sendAccept(final JingleContentID id, JingleDescription description, JingleTransportPayload transport); + public abstract String sendTransportInfo(final JingleContentID id, JingleTransportPayload transport); + public abstract void sendTransportAccept(final JingleContentID id, JingleTransportPayload transport); + public abstract void sendTransportReject(final JingleContentID id, JingleTransportPayload transport); + public abstract void sendTransportReplace(final JingleContentID id, JingleTransportPayload transport); +}
\ No newline at end of file |