aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp/stanzas
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-08 23:15:55 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-08 23:15:55 +0200
commit298c7adcd1fabccb06d14905041cb7e008f109ad (patch)
treec4378136a4130854c94f1c55ffe3aab0aab6e0e0 /src/eu/siacs/conversations/xmpp/stanzas
parent92dcf857014bfec919d62a7c0457093bd9056d94 (diff)
disocover stream hosts (xep-0065) cleaned up disco
Diffstat (limited to 'src/eu/siacs/conversations/xmpp/stanzas')
-rw-r--r--src/eu/siacs/conversations/xmpp/stanzas/jingle/Content.java35
-rw-r--r--src/eu/siacs/conversations/xmpp/stanzas/jingle/JinglePacket.java76
-rw-r--r--src/eu/siacs/conversations/xmpp/stanzas/jingle/Reason.java13
3 files changed, 0 insertions, 124 deletions
diff --git a/src/eu/siacs/conversations/xmpp/stanzas/jingle/Content.java b/src/eu/siacs/conversations/xmpp/stanzas/jingle/Content.java
deleted file mode 100644
index ed51a2a5..00000000
--- a/src/eu/siacs/conversations/xmpp/stanzas/jingle/Content.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package eu.siacs.conversations.xmpp.stanzas.jingle;
-
-import java.io.File;
-import java.util.List;
-
-import eu.siacs.conversations.xml.Element;
-
-public class Content extends Element {
- private Content(String name) {
- super(name);
- }
-
- public Content() {
- super("content");
- }
-
- public void offerFile(File actualFile) {
- Element description = this.addChild("description", "urn:xmpp:jingle:apps:file-transfer:3");
- Element offer = description.addChild("offer");
- Element file = offer.addChild("file");
- file.addChild("size").setContent(""+actualFile.length());
- file.addChild("name").setContent(actualFile.getName());
- }
-
- public void setCanditates(List<Element> canditates) {
- Element transport = this.findChild("transport", "urn:xmpp:jingle:transports:s5b:1");
- if (transport==null) {
- transport = this.addChild("transport", "urn:xmpp:jingle:transports:s5b:1");
- }
- transport.clearChildren();
- for(Element canditate : canditates) {
- transport.addChild(canditate);
- }
- }
-}
diff --git a/src/eu/siacs/conversations/xmpp/stanzas/jingle/JinglePacket.java b/src/eu/siacs/conversations/xmpp/stanzas/jingle/JinglePacket.java
deleted file mode 100644
index 4c444a74..00000000
--- a/src/eu/siacs/conversations/xmpp/stanzas/jingle/JinglePacket.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package eu.siacs.conversations.xmpp.stanzas.jingle;
-
-import eu.siacs.conversations.xml.Element;
-import eu.siacs.conversations.xmpp.stanzas.IqPacket;
-
-public class JinglePacket extends IqPacket {
- Content content = null;
- Reason reason = null;
- Element jingle = new Element("jingle");
-
- @Override
- public Element addChild(Element child) {
- if ("jingle".equals(child.getName())) {
- Element contentElement = child.findChild("content");
- if (contentElement!=null) {
- this.content = new Content();
- this.content.setChildren(contentElement.getChildren());
- this.content.setAttributes(contentElement.getAttributes());
- }
- Element reasonElement = child.findChild("reason");
- if (reasonElement!=null) {
- this.reason = new Reason();
- this.reason.setChildren(reasonElement.getChildren());
- this.reason.setAttributes(reasonElement.getAttributes());
- }
- this.jingle.setAttributes(child.getAttributes());
- }
- return child;
- }
-
- public JinglePacket setContent(Content content) {
- this.content = content;
- return this;
- }
-
- public JinglePacket setReason(Reason reason) {
- this.reason = reason;
- return this;
- }
-
- private void build() {
- this.children.clear();
- this.jingle.clearChildren();
- this.jingle.setAttribute("xmlns", "urn:xmpp:jingle:1");
- if (this.content!=null) {
- jingle.addChild(this.content);
- }
- if (this.reason != null) {
- jingle.addChild(this.reason);
- }
- this.children.add(jingle);
- this.setAttribute("type", "set");
- }
-
- public String getSessionId() {
- return this.jingle.getAttribute("sid");
- }
-
- public void setSessionId(String sid) {
- this.jingle.setAttribute("sid", sid);
- }
-
- @Override
- public String toString() {
- this.build();
- return super.toString();
- }
-
- public void setAction(String action) {
- this.jingle.setAttribute("action", action);
- }
-
- public void setInitiator(String initiator) {
- this.jingle.setAttribute("initiator", initiator);
- }
-}
diff --git a/src/eu/siacs/conversations/xmpp/stanzas/jingle/Reason.java b/src/eu/siacs/conversations/xmpp/stanzas/jingle/Reason.java
deleted file mode 100644
index 35b81655..00000000
--- a/src/eu/siacs/conversations/xmpp/stanzas/jingle/Reason.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package eu.siacs.conversations.xmpp.stanzas.jingle;
-
-import eu.siacs.conversations.xml.Element;
-
-public class Reason extends Element {
- private Reason(String name) {
- super(name);
- }
-
- public Reason() {
- super("reason");
- }
-}