summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-03-11 11:14:25 (GMT)
committerSwift Review <review@swift.im>2014-05-26 17:16:33 (GMT)
commitdb8568aa6a9bbfa8dca9cdae696e8428a0068d89 (patch)
tree38ab6981542192128711049cb551dc03cf6f97a7 /src/com/isode/stroke/elements
parentcafd510a0efc9df985999ceded57efa1d411de2e (diff)
downloadstroke-db8568aa6a9bbfa8dca9cdae696e8428a0068d89.zip
stroke-db8568aa6a9bbfa8dca9cdae696e8428a0068d89.tar.bz2
Added MAM parsers, serializers and tests.
Change-Id: I4e5368f9ac86446b7ebf976e2cb63d64ebefe7b2
Diffstat (limited to 'src/com/isode/stroke/elements')
-rw-r--r--src/com/isode/stroke/elements/Delay.java43
-rw-r--r--src/com/isode/stroke/elements/Forwarded.java32
-rw-r--r--src/com/isode/stroke/elements/MAMArchived.java34
-rw-r--r--src/com/isode/stroke/elements/MAMQuery.java41
-rw-r--r--src/com/isode/stroke/elements/MAMResult.java32
-rw-r--r--src/com/isode/stroke/elements/ResultSet.java80
6 files changed, 262 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/Delay.java b/src/com/isode/stroke/elements/Delay.java
new file mode 100644
index 0000000..9827a82
--- /dev/null
+++ b/src/com/isode/stroke/elements/Delay.java
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2014 Kevin Smith and Remko Tronçon
+* All rights reserved.
+*/
+
+/*
+* Copyright (c) 2014, Isode Limited, London, England.
+* All rights reserved.
+*/
+
+package com.isode.stroke.elements;
+
+import java.util.Date;
+import com.isode.stroke.jid.JID;
+
+public class Delay extends Payload {
+ public Delay() {
+ }
+
+ public Delay(Date time, JID from) {
+ time_ = time;
+ from_ = from;
+ }
+
+ public Date getStamp() {
+ return time_;
+ }
+
+ public void setStamp(Date time) {
+ time_ = time;
+ }
+
+ public JID getFrom() {
+ return from_;
+ }
+
+ public void setFrom(JID from) {
+ from_ = from;
+ }
+
+ private Date time_;
+ private JID from_;
+}
diff --git a/src/com/isode/stroke/elements/Forwarded.java b/src/com/isode/stroke/elements/Forwarded.java
new file mode 100644
index 0000000..fbfabce
--- /dev/null
+++ b/src/com/isode/stroke/elements/Forwarded.java
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2014 Kevin Smith and Remko Tronçon
+* All rights reserved.
+*/
+
+/*
+* Copyright (c) 2014, Isode Limited, London, England.
+* All rights reserved.
+*/
+
+package com.isode.stroke.elements;
+
+public class Forwarded extends Payload {
+ public void setDelay(Delay delay) {
+ delay_ = delay;
+ }
+
+ public Delay getDelay() {
+ return delay_;
+ }
+
+ public void setStanza(Stanza stanza) {
+ stanza_ = stanza;
+ }
+
+ public Stanza getStanza() {
+ return stanza_;
+ }
+
+ private Delay delay_;
+ private Stanza stanza_;
+}
diff --git a/src/com/isode/stroke/elements/MAMArchived.java b/src/com/isode/stroke/elements/MAMArchived.java
new file mode 100644
index 0000000..c8ab2d9
--- /dev/null
+++ b/src/com/isode/stroke/elements/MAMArchived.java
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2014 Kevin Smith and Remko Tronçon
+* All rights reserved.
+*/
+
+/*
+* Copyright (c) 2014, Isode Limited, London, England.
+* All rights reserved.
+*/
+
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+
+public class MAMArchived extends Payload {
+ public void setBy(JID by) {
+ by_ = by;
+ }
+
+ public JID getBy() {
+ return by_;
+ }
+
+ public void setID(String id) {
+ id_ = id;
+ }
+
+ public String getID() {
+ return id_;
+ }
+
+ private JID by_;
+ private String id_;
+}
diff --git a/src/com/isode/stroke/elements/MAMQuery.java b/src/com/isode/stroke/elements/MAMQuery.java
new file mode 100644
index 0000000..6da30b5
--- /dev/null
+++ b/src/com/isode/stroke/elements/MAMQuery.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2014 Kevin Smith and Remko Tronçon
+ * All rights reserved.
+ */
+
+/*
+ * Copyright (c) 2014, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class MAMQuery extends Payload {
+ public void setQueryID(String queryID) {
+ queryID_ = queryID;
+ }
+
+ public String getQueryID() {
+ return queryID_;
+ }
+
+ public void setForm(Form form) {
+ form_ = form;
+ }
+
+ public Form getForm() {
+ return form_;
+ }
+
+ public void setResultSet(ResultSet resultSet) {
+ resultSet_ = resultSet;
+ }
+
+ public ResultSet getResultSet() {
+ return resultSet_;
+ }
+
+ private String queryID_;
+ private Form form_;
+ private ResultSet resultSet_;
+}
diff --git a/src/com/isode/stroke/elements/MAMResult.java b/src/com/isode/stroke/elements/MAMResult.java
new file mode 100644
index 0000000..aa83c88
--- /dev/null
+++ b/src/com/isode/stroke/elements/MAMResult.java
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2014 Kevin Smith and Remko Tronçon
+* All rights reserved.
+*/
+
+/*
+* Copyright (c) 2014, Isode Limited, London, England.
+* All rights reserved.
+*/
+
+package com.isode.stroke.elements;
+
+public class MAMResult extends ContainerPayload<Forwarded> {
+ public void setID(String id) {
+ id_ = id;
+ }
+
+ public String getID() {
+ return id_;
+ }
+
+ public void setQueryID(String queryID) {
+ queryID_ = queryID;
+ }
+
+ public String getQueryID() {
+ return queryID_;
+ }
+
+ private String id_;
+ private String queryID_;
+}
diff --git a/src/com/isode/stroke/elements/ResultSet.java b/src/com/isode/stroke/elements/ResultSet.java
new file mode 100644
index 0000000..706d37c
--- /dev/null
+++ b/src/com/isode/stroke/elements/ResultSet.java
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2014 Kevin Smith and Remko Tronçon
+* All rights reserved.
+*/
+
+/*
+* Copyright (c) 2014, Isode Limited, London, England.
+* All rights reserved.
+*/
+
+package com.isode.stroke.elements;
+
+/**
+ * ResultSet
+ */
+public class ResultSet extends Payload {
+ public void setMaxItems(Long maxItems) {
+ maxItems_ = maxItems;
+ }
+
+ public Long getMaxItems() {
+ return maxItems_;
+ }
+
+ public void setCount(Long count) {
+ count_ = count;
+ }
+
+ public Long getCount() {
+ return count_;
+ }
+
+ public void setFirstIDIndex(Long firstIndex) {
+ firstIndex_ = firstIndex;
+ }
+
+ public Long getFirstIDIndex() {
+ return firstIndex_;
+ }
+
+ public void setFirstID(String firstID) {
+ firstID_ = firstID;
+ }
+
+ public String getFirstID() {
+ return firstID_;
+ }
+
+ public void setLastID(String lastID) {
+ lastID_ = lastID;
+ }
+
+ public String getLastID() {
+ return lastID_;
+ }
+
+ public void setAfter(String after) {
+ after_ = after;
+ }
+
+ public String getAfter() {
+ return after_;
+ }
+
+ public void setBefore(String before) {
+ before_ = before;
+ }
+
+ public String getBefore() {
+ return before_;
+ }
+
+ private Long maxItems_;
+ private Long count_;
+ private Long firstIndex_;
+ private String firstID_;
+ private String lastID_;
+ private String after_;
+ private String before_;
+}