summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/isode/stroke/elements')
-rw-r--r--src/com/isode/stroke/elements/AuthChallenge.java32
-rw-r--r--src/com/isode/stroke/elements/AuthFailure.java16
-rw-r--r--src/com/isode/stroke/elements/AuthRequest.java46
-rw-r--r--src/com/isode/stroke/elements/AuthResponse.java33
-rw-r--r--src/com/isode/stroke/elements/AuthSuccess.java26
-rw-r--r--src/com/isode/stroke/elements/Body.java28
-rw-r--r--src/com/isode/stroke/elements/CompressFailure.java13
-rw-r--r--src/com/isode/stroke/elements/CompressRequest.java29
-rw-r--r--src/com/isode/stroke/elements/Compressed.java13
-rw-r--r--src/com/isode/stroke/elements/Element.java14
-rw-r--r--src/com/isode/stroke/elements/EnableStreamManagement.java14
-rw-r--r--src/com/isode/stroke/elements/ErrorPayload.java88
-rw-r--r--src/com/isode/stroke/elements/IQ.java58
-rw-r--r--src/com/isode/stroke/elements/Last.java28
-rw-r--r--src/com/isode/stroke/elements/Message.java56
-rw-r--r--src/com/isode/stroke/elements/Payload.java14
-rw-r--r--src/com/isode/stroke/elements/Presence.java69
-rw-r--r--src/com/isode/stroke/elements/Priority.java33
-rw-r--r--src/com/isode/stroke/elements/ProtocolHeader.java52
-rw-r--r--src/com/isode/stroke/elements/RawXMLPayload.java25
-rw-r--r--src/com/isode/stroke/elements/ResourceBind.java32
-rw-r--r--src/com/isode/stroke/elements/RosterItemPayload.java86
-rw-r--r--src/com/isode/stroke/elements/RosterPayload.java41
-rw-r--r--src/com/isode/stroke/elements/SearchPayload.java124
-rw-r--r--src/com/isode/stroke/elements/Stanza.java86
-rw-r--r--src/com/isode/stroke/elements/StanzaAck.java35
-rw-r--r--src/com/isode/stroke/elements/StanzaAckRequest.java14
-rw-r--r--src/com/isode/stroke/elements/StartSession.java14
-rw-r--r--src/com/isode/stroke/elements/StartTLSFailure.java17
-rw-r--r--src/com/isode/stroke/elements/StartTLSRequest.java15
-rw-r--r--src/com/isode/stroke/elements/Status.java29
-rw-r--r--src/com/isode/stroke/elements/StatusShow.java53
-rw-r--r--src/com/isode/stroke/elements/StreamError.java75
-rw-r--r--src/com/isode/stroke/elements/StreamFeatures.java99
-rw-r--r--src/com/isode/stroke/elements/StreamManagementEnabled.java30
-rw-r--r--src/com/isode/stroke/elements/StreamManagementFailed.java14
-rw-r--r--src/com/isode/stroke/elements/StreamResume.java30
-rw-r--r--src/com/isode/stroke/elements/StreamResumed.java30
-rw-r--r--src/com/isode/stroke/elements/StreamType.java18
-rw-r--r--src/com/isode/stroke/elements/Subject.java28
-rw-r--r--src/com/isode/stroke/elements/TLSProceed.java16
-rw-r--r--src/com/isode/stroke/elements/UnknownElement.java14
-rw-r--r--src/com/isode/stroke/elements/Version.java51
43 files changed, 1638 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/AuthChallenge.java b/src/com/isode/stroke/elements/AuthChallenge.java
new file mode 100644
index 0000000..ac87a3d
--- /dev/null
+++ b/src/com/isode/stroke/elements/AuthChallenge.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.base.ByteArray;
+
+public class AuthChallenge implements Element {
+ //FIXME: parser/serialiser
+ public AuthChallenge() {
+ value_ = new ByteArray();
+ }
+
+ public AuthChallenge(ByteArray value) {
+ value_ = new ByteArray(value);
+ }
+
+ public ByteArray getValue() {
+ return value_;
+ }
+
+ public void setValue(ByteArray value) {
+ value_ = new ByteArray(value);
+ }
+
+ private ByteArray value_;
+}
diff --git a/src/com/isode/stroke/elements/AuthFailure.java b/src/com/isode/stroke/elements/AuthFailure.java
new file mode 100644
index 0000000..ecd7639
--- /dev/null
+++ b/src/com/isode/stroke/elements/AuthFailure.java
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+
+public class AuthFailure implements Element {
+ //FIXME: parser/serialiser
+}
diff --git a/src/com/isode/stroke/elements/AuthRequest.java b/src/com/isode/stroke/elements/AuthRequest.java
new file mode 100644
index 0000000..21b1356
--- /dev/null
+++ b/src/com/isode/stroke/elements/AuthRequest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.base.ByteArray;
+
+public class AuthRequest implements Element {
+
+ public AuthRequest() {
+ this(null);
+ }
+
+ //FIXME: parser/serialiser
+ public AuthRequest(String mechanism) {
+ mechanism_ = mechanism;
+ }
+
+ public AuthRequest(String mechanism, ByteArray message) {
+ mechanism_ = mechanism;
+ message_ = message;
+ }
+
+ public ByteArray getMessage() {
+ return message_;
+ }
+
+ public void setMessage(ByteArray message) {
+ message_ = message;
+ }
+
+ public String getMechanism() {
+ return mechanism_;
+ }
+
+ public void setMechanism(String mechanism) {
+ mechanism_ = mechanism;
+ }
+ private String mechanism_;
+ private ByteArray message_ = new ByteArray();
+}
diff --git a/src/com/isode/stroke/elements/AuthResponse.java b/src/com/isode/stroke/elements/AuthResponse.java
new file mode 100644
index 0000000..357b72b
--- /dev/null
+++ b/src/com/isode/stroke/elements/AuthResponse.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.base.ByteArray;
+
+public class AuthResponse implements Element {
+ //FIXME: parser/serialiser
+
+ public AuthResponse() {
+ value = null;
+ }
+
+ public AuthResponse(ByteArray value) {
+ this.value = value;
+ }
+
+ public ByteArray getValue() {
+ return value;
+ }
+
+ public void setValue(ByteArray value) {
+ this.value = value;
+ }
+ private ByteArray value;
+}
diff --git a/src/com/isode/stroke/elements/AuthSuccess.java b/src/com/isode/stroke/elements/AuthSuccess.java
new file mode 100644
index 0000000..eba6b5a
--- /dev/null
+++ b/src/com/isode/stroke/elements/AuthSuccess.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+import com.isode.stroke.base.ByteArray;
+
+public class AuthSuccess implements Element {
+ //FIXME: parser/serialiser
+
+ public ByteArray getValue() {
+ return value;
+ }
+
+ public void setValue(ByteArray value) {
+ this.value = value;
+ }
+ private ByteArray value;
+}
diff --git a/src/com/isode/stroke/elements/Body.java b/src/com/isode/stroke/elements/Body.java
new file mode 100644
index 0000000..3cda307
--- /dev/null
+++ b/src/com/isode/stroke/elements/Body.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class Body extends Payload {
+ String text_ = "";
+
+ public Body() {}
+
+ public Body(String text) {
+ setText(text);
+ }
+
+ public void setText(String text) {
+ text_ = text;
+ }
+
+ public String getText() {
+ return text_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/CompressFailure.java b/src/com/isode/stroke/elements/CompressFailure.java
new file mode 100644
index 0000000..c3a19bd
--- /dev/null
+++ b/src/com/isode/stroke/elements/CompressFailure.java
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class CompressFailure implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/CompressRequest.java b/src/com/isode/stroke/elements/CompressRequest.java
new file mode 100644
index 0000000..8150f1d
--- /dev/null
+++ b/src/com/isode/stroke/elements/CompressRequest.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class CompressRequest implements Element {
+
+ public CompressRequest() {
+ this("");
+ }
+
+ public CompressRequest(String method) {
+ method_ = method;
+ }
+
+ public String getMethod() {
+ return method_;
+ }
+
+ public void setMethod(String method) {
+ method_ = method;
+ }
+ private String method_;
+}
diff --git a/src/com/isode/stroke/elements/Compressed.java b/src/com/isode/stroke/elements/Compressed.java
new file mode 100644
index 0000000..1309f5b
--- /dev/null
+++ b/src/com/isode/stroke/elements/Compressed.java
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class Compressed implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/Element.java b/src/com/isode/stroke/elements/Element.java
new file mode 100644
index 0000000..1b931e4
--- /dev/null
+++ b/src/com/isode/stroke/elements/Element.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public interface Element {
+
+}
diff --git a/src/com/isode/stroke/elements/EnableStreamManagement.java b/src/com/isode/stroke/elements/EnableStreamManagement.java
new file mode 100644
index 0000000..e551551
--- /dev/null
+++ b/src/com/isode/stroke/elements/EnableStreamManagement.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class EnableStreamManagement implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/ErrorPayload.java b/src/com/isode/stroke/elements/ErrorPayload.java
new file mode 100644
index 0000000..913296d
--- /dev/null
+++ b/src/com/isode/stroke/elements/ErrorPayload.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+/**
+ * Error.
+ */
+public class ErrorPayload extends Payload {
+ private Condition condition_;
+ private Type type_;
+ private String text_;
+
+ public enum Type { Cancel, Continue, Modify, Auth, Wait };
+
+ public enum Condition {
+ BadRequest,
+ Conflict,
+ FeatureNotImplemented,
+ Forbidden,
+ Gone,
+ InternalServerError,
+ ItemNotFound,
+ JIDMalformed,
+ NotAcceptable,
+ NotAllowed,
+ NotAuthorized,
+ PaymentRequired,
+ RecipientUnavailable,
+ Redirect,
+ RegistrationRequired,
+ RemoteServerNotFound,
+ RemoteServerTimeout,
+ ResourceConstraint,
+ ServiceUnavailable,
+ SubscriptionRequired,
+ UndefinedCondition,
+ UnexpectedRequest
+ };
+
+ public ErrorPayload(Condition condition, Type type, String text) {
+ condition_ = condition;
+ type_ = type;
+ text_ = text;
+ }
+
+ public ErrorPayload(Condition condition, Type type) {
+ this(condition, type, "");
+ }
+
+ public ErrorPayload(Condition condition) {
+ this(condition, Type.Cancel);
+ }
+
+ public ErrorPayload() {
+ this(Condition.UndefinedCondition);
+ }
+
+ public Type getType() {
+ return type_;
+ }
+
+ public void setType(Type type) {
+ type_ = type;
+ }
+
+ public Condition getCondition() {
+ return condition_;
+ }
+
+ public void setCondition(Condition condition) {
+ condition_ = condition;
+ }
+
+ public void setText(String text) {
+ text_ = text;
+ }
+
+ public String getText() {
+ return text_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/IQ.java b/src/com/isode/stroke/elements/IQ.java
new file mode 100644
index 0000000..a4fc9dc
--- /dev/null
+++ b/src/com/isode/stroke/elements/IQ.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+
+public class IQ extends Stanza {
+ public enum Type {Get, Set, Result, Error};
+
+ private Type type_;
+
+ public IQ() {
+ this(Type.Get);
+ }
+
+ public IQ(Type type) {
+ type_ = type;
+ }
+
+ public Type getType() {
+ return type_;
+ }
+
+ public void setType(Type type) {
+ type_ = type;
+ }
+
+ public static IQ createRequest(Type type, JID to, String id, Payload payload) {
+ IQ iq = new IQ(type);
+ iq.setTo(to);
+ iq.setID(id);
+ iq.addPayload(payload);
+ return iq;
+ }
+
+ public static IQ createResult(JID to, String id, Payload payload) {
+ IQ iq = new IQ(Type.Result);
+ iq.setTo(to);
+ iq.setID(id);
+ iq.addPayload(payload);
+ return iq;
+ }
+
+ public static IQ createError(JID to, String id, ErrorPayload.Condition condition, ErrorPayload.Type type) {
+ IQ iq = new IQ(Type.Error);
+ iq.setTo(to);
+ iq.setID(id);
+ iq.addPayload(new ErrorPayload(condition, type));
+ return iq;
+ }
+
+}
diff --git a/src/com/isode/stroke/elements/Last.java b/src/com/isode/stroke/elements/Last.java
new file mode 100644
index 0000000..8f12616
--- /dev/null
+++ b/src/com/isode/stroke/elements/Last.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2011, Kevin Smith.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class Last extends Payload {
+ int seconds_;
+
+ public Last() {}
+
+ public Last(final int seconds) {
+ setSeconds(seconds);
+ }
+
+ public void setSeconds(final int seconds) {
+ seconds_ = seconds;
+ }
+
+ public int getSeconds() {
+ return seconds_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/Message.java b/src/com/isode/stroke/elements/Message.java
new file mode 100644
index 0000000..6820e6f
--- /dev/null
+++ b/src/com/isode/stroke/elements/Message.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class Message extends Stanza {
+
+ Type type_ = Type.Chat;
+
+ public enum Type {
+
+ Normal, Chat, Error, Groupchat, Headline
+ };
+
+ public String getSubject() {
+ Subject subject = getPayload(new Subject());
+ if (subject != null) {
+ return subject.getText();
+ }
+ return "";
+ }
+
+ public void setSubject(String subject) {
+ updatePayload(new Subject(subject));
+ }
+
+ public String getBody() {
+ Body body = getPayload(new Body());
+ if (body != null) {
+ return body.getText();
+ }
+ return "";
+ }
+
+ public void setBody(String body) {
+ updatePayload(new Body(body));
+ }
+
+ public boolean isError() {
+ ErrorPayload error = getPayload(new ErrorPayload());
+ return getType().equals(Type.Error) || error != null;
+ }
+
+ public Type getType() {
+ return type_;
+ }
+
+ public void setType(Type type) {
+ type_ = type;
+ }
+}
diff --git a/src/com/isode/stroke/elements/Payload.java b/src/com/isode/stroke/elements/Payload.java
new file mode 100644
index 0000000..fbe47f2
--- /dev/null
+++ b/src/com/isode/stroke/elements/Payload.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class Payload {
+
+}
diff --git a/src/com/isode/stroke/elements/Presence.java b/src/com/isode/stroke/elements/Presence.java
new file mode 100644
index 0000000..f32fb9f
--- /dev/null
+++ b/src/com/isode/stroke/elements/Presence.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class Presence extends Stanza {
+
+ private Type type_;
+
+ public enum Type {
+
+ Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed
+ };
+
+ public Presence() {
+ type_ = Type.Available;
+ }
+
+ public Presence(String status) {
+ type_ = Type.Available;
+ setStatus(status);
+ }
+
+ public Type getType() {
+ return type_;
+ }
+
+ public void setType(Type type) {
+ type_ = type;
+ }
+
+ public StatusShow.Type getShow() {
+ StatusShow show = getPayload (new StatusShow());
+ if (show != null) {
+ return show.getType();
+ }
+ return type_ == Type.Available ? StatusShow.Type.Online : StatusShow.Type.None;
+ }
+
+ public void setShow(StatusShow.Type show) {
+ updatePayload(new StatusShow(show));
+ }
+
+ public String getStatus() {
+ Status status = getPayload(new Status());
+ if (status != null) {
+ return status.getText();
+ }
+ return "";
+ }
+
+ public void setStatus(String status) {
+ updatePayload(new Status(status));
+ }
+
+ public int getPriority() {
+ Priority priority = getPayload(new Priority());
+ return (priority != null ? priority.getPriority() : 0);
+ }
+
+ public void setPriority(int priority) {
+ updatePayload(new Priority(priority));
+ }
+}
diff --git a/src/com/isode/stroke/elements/Priority.java b/src/com/isode/stroke/elements/Priority.java
new file mode 100644
index 0000000..850c67a
--- /dev/null
+++ b/src/com/isode/stroke/elements/Priority.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+/**
+ * Resource priority from presence stanzas.
+ */
+public class Priority extends Payload {
+ int priority_ = 0;
+
+ public Priority(){
+
+ }
+
+ public Priority (int priority) {
+ priority_ = priority;
+ }
+
+ public void setPriority(int priority) {
+ priority_ = priority;
+ }
+
+ public int getPriority() {
+ return priority_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/ProtocolHeader.java b/src/com/isode/stroke/elements/ProtocolHeader.java
new file mode 100644
index 0000000..16d2925
--- /dev/null
+++ b/src/com/isode/stroke/elements/ProtocolHeader.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class ProtocolHeader {
+
+ public ProtocolHeader() {
+ version = "1.0";
+ }
+
+ public String getTo() {
+ return to;
+ }
+
+ public void setTo(String a) {
+ to = a;
+ }
+
+ public String getFrom() {
+ return from;
+ }
+
+ public void setFrom(String a) {
+ from = a;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String a) {
+ version = a;
+ }
+
+ public String getID() {
+ return id;
+ }
+
+ public void setID(String a) {
+ id = a;
+ }
+ private String to = "";
+ private String from = "";
+ private String id = "";
+ private String version = "";
+}
diff --git a/src/com/isode/stroke/elements/RawXMLPayload.java b/src/com/isode/stroke/elements/RawXMLPayload.java
new file mode 100644
index 0000000..8c261e9
--- /dev/null
+++ b/src/com/isode/stroke/elements/RawXMLPayload.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+/**
+ * Unparsed content.
+ */
+public class RawXMLPayload extends Payload {
+ private String rawXML_;
+
+ public void setRawXML(String data) {
+ rawXML_ = data;
+ }
+
+ public String getRawXML() {
+ return rawXML_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/ResourceBind.java b/src/com/isode/stroke/elements/ResourceBind.java
new file mode 100644
index 0000000..863ef98
--- /dev/null
+++ b/src/com/isode/stroke/elements/ResourceBind.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+
+public class ResourceBind extends Payload {
+//FIXME: serializer and parser
+ public void setJID(JID jid) {
+ jid_ = jid;
+ }
+
+ public JID getJID() {
+ return jid_;
+ }
+
+ public void setResource(String resource) {
+ resource_ = resource;
+ }
+
+ public String getResource() {
+ return resource_;
+ }
+ private JID jid_ = new JID();
+ private String resource_ = "";
+}
diff --git a/src/com/isode/stroke/elements/RosterItemPayload.java b/src/com/isode/stroke/elements/RosterItemPayload.java
new file mode 100644
index 0000000..a80ecc6
--- /dev/null
+++ b/src/com/isode/stroke/elements/RosterItemPayload.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * Roster Items
+ */
+public class RosterItemPayload {
+
+ public enum Subscription {
+
+ None, To, From, Both, Remove
+ };
+
+ public RosterItemPayload() {
+ subscription_ = Subscription.None;
+ ask_ = false;
+ }
+
+ public RosterItemPayload(JID jid, String name, Subscription subscription) {
+ jid_ = jid;
+ name_ = name;
+ subscription_ = subscription;
+ ask_ = false;
+ }
+
+ public void setJID(JID jid) {
+ jid_ = jid;
+ }
+
+ public JID getJID() {
+ return jid_;
+ }
+
+ public void setName(String name) {
+ name_ = name;
+ }
+
+ public String getName() {
+ return name_;
+ }
+
+ public void setSubscription(Subscription subscription) {
+ subscription_ = subscription;
+ }
+
+ public Subscription getSubscription() {
+ return subscription_;
+ }
+
+ public void addGroup(String group) {
+ groups_.add(group);
+ }
+
+ public void setGroups(Collection<String> groups) {
+ groups_ = new ArrayList<String>();
+ groups_.addAll(groups);
+ }
+
+ public Collection<String> getGroups() {
+ return groups_;
+ }
+
+ public void setSubscriptionRequested() {
+ ask_ = true;
+ }
+
+ public boolean getSubscriptionRequested() {
+ return ask_;
+ }
+ private JID jid_;
+ private String name_;
+ private Subscription subscription_;
+ private ArrayList<String> groups_ = new ArrayList<String>();
+ private boolean ask_;
+}
diff --git a/src/com/isode/stroke/elements/RosterPayload.java b/src/com/isode/stroke/elements/RosterPayload.java
new file mode 100644
index 0000000..6208216
--- /dev/null
+++ b/src/com/isode/stroke/elements/RosterPayload.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+import java.util.ArrayList;
+import java.util.Collection;
+
+/**
+ * Roster.
+ */
+public class RosterPayload extends Payload {
+
+ public RosterPayload() {
+ }
+
+ public RosterItemPayload getItem(JID jid) {
+ for (RosterItemPayload item : items_) {
+ if (item.getJID().equals(jid)) {
+ return item;
+ }
+ }
+ return null;
+ }
+
+ public void addItem(RosterItemPayload item) {
+ items_.add(item);
+ }
+
+ public Collection<RosterItemPayload> getItems() {
+ return items_;
+ }
+
+ private final ArrayList<RosterItemPayload> items_ = new ArrayList<RosterItemPayload>();
+}
diff --git a/src/com/isode/stroke/elements/SearchPayload.java b/src/com/isode/stroke/elements/SearchPayload.java
new file mode 100644
index 0000000..b8e8a0d
--- /dev/null
+++ b/src/com/isode/stroke/elements/SearchPayload.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+import java.util.ArrayList;
+import java.util.List;
+
+public class SearchPayload extends Payload {
+
+ public static class Item {
+
+ public String first;
+ public String last;
+ public String nick;
+ public String email;
+ public JID jid;
+ };
+
+ public SearchPayload() {
+ }
+
+ //Form::ref getForm() const { return form; } /* Not ported yet */
+ //void setForm(Form::ref f) { form = f; } /* Not ported yet */
+ /**
+ * @return Can be null
+ */
+ public String getInstructions() {
+ return instructions;
+ }
+
+ /**
+ * @return Can be null
+ */
+ public String getNick() {
+ return nick;
+ }
+
+ /**
+ * @return Can be null
+ */
+ public String getFirst() {
+ return first;
+ }
+
+ /**
+ * @return Can be null
+ */
+ public String getLast() {
+ return last;
+ }
+
+ /**
+ * @return Can be null
+ */
+ public String getEMail() {
+ return email;
+ }
+
+ /**
+ * @param v Null means no value.
+ */
+ public void setInstructions(String v) {
+ this.instructions = v;
+ }
+
+ /**
+ * @param v Null means no value.
+ */
+ public void setNick(String v) {
+ this.nick = v;
+ }
+
+ /**
+ * @param v Null means no value.
+ */
+ public void setFirst(String v) {
+ this.first = v;
+ }
+
+ /**
+ * @param v Null means no value.
+ */
+ public void setLast(String v) {
+ this.last = v;
+ }
+
+ /**
+ * @param v Null means no value.
+ */
+ public void setEMail(String v) {
+ this.email = v;
+ }
+
+ /**
+ *
+ * @return non-null
+ */
+ public List<Item> getItems() {
+ return items;
+ }
+
+ /**
+ *
+ * @param item Non-null.
+ */
+ public void addItem(Item item) {
+ items.add(item);
+ }
+
+ //private Form::ref form; /*Not ported yet*/
+ private String instructions;
+ private String nick;
+ private String first;
+ private String last;
+ private String email;
+ private ArrayList<Item> items = new ArrayList<Item>();
+}
diff --git a/src/com/isode/stroke/elements/Stanza.java b/src/com/isode/stroke/elements/Stanza.java
new file mode 100644
index 0000000..ac4f06f
--- /dev/null
+++ b/src/com/isode/stroke/elements/Stanza.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+import com.isode.stroke.jid.JID;
+import java.util.Vector;
+
+/**
+ * Basic XMPP stanza.
+ */
+public class Stanza implements Element {
+ private String id_;
+ private JID from_;
+ private JID to_;
+ private Vector<Payload> payloads_ = new Vector<Payload>();
+
+
+ public <T extends Payload> T getPayload(T type) {
+ for (Payload payload : payloads_) {
+ if (payload.getClass().isAssignableFrom(type.getClass())) {
+ return (T)payload;
+ }
+ }
+ return null;
+ }
+
+ public <T extends Payload> Vector<T> getPayloads(T type) {
+ Vector<T> results = new Vector<T>();
+ for (Payload payload : payloads_) {
+ if (payload.getClass().isAssignableFrom(type.getClass())) {
+ results.add((T)payload);
+ }
+ }
+ return results;
+ }
+
+ public Vector<Payload> getPayloads() {
+ return payloads_;
+ }
+
+ public void addPayload(Payload payload) {
+ payloads_.add(payload);
+ }
+
+ public void updatePayload(Payload payload) {
+ for (int i = 0; i < payloads_.size(); i++) {
+ if (payloads_.get(i).getClass() == payload.getClass()) {
+ payloads_.set(i, payload);
+ return;
+ }
+ }
+ payloads_.add(payload);
+ }
+
+ public JID getFrom() {
+ return from_;
+ }
+
+ public void setFrom(JID from) {
+ from_ = from;
+ }
+
+ public JID getTo() {
+ return to_;
+ }
+
+ public void setTo(JID to) {
+ to_ = to;
+ }
+
+ public String getID() {
+ return id_;
+ }
+
+ public void setID(String id) {
+ id_ = id;
+ }
+
+}
diff --git a/src/com/isode/stroke/elements/StanzaAck.java b/src/com/isode/stroke/elements/StanzaAck.java
new file mode 100644
index 0000000..0589d39
--- /dev/null
+++ b/src/com/isode/stroke/elements/StanzaAck.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StanzaAck implements Element {
+ //FIXME: parser/serialiser
+ public StanzaAck() {
+ }
+
+ public StanzaAck(long handledStanzasCount) {
+ valid = true;
+ this.handledStanzasCount = handledStanzasCount;
+ }
+
+ public long getHandledStanzasCount() {
+ return handledStanzasCount;
+ }
+
+ public void setHandledStanzasCount(long i) {
+ handledStanzasCount = i;
+ valid = true;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+ private boolean valid = false;
+ private long handledStanzasCount = 0;
+}
diff --git a/src/com/isode/stroke/elements/StanzaAckRequest.java b/src/com/isode/stroke/elements/StanzaAckRequest.java
new file mode 100644
index 0000000..b02ac4e
--- /dev/null
+++ b/src/com/isode/stroke/elements/StanzaAckRequest.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class StanzaAckRequest implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/StartSession.java b/src/com/isode/stroke/elements/StartSession.java
new file mode 100644
index 0000000..b886535
--- /dev/null
+++ b/src/com/isode/stroke/elements/StartSession.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class StartSession extends Payload{
+
+}
diff --git a/src/com/isode/stroke/elements/StartTLSFailure.java b/src/com/isode/stroke/elements/StartTLSFailure.java
new file mode 100644
index 0000000..7b18dfe
--- /dev/null
+++ b/src/com/isode/stroke/elements/StartTLSFailure.java
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class StartTLSFailure implements Element {
+
+ //FIXME: parser/serialiser
+
+}
diff --git a/src/com/isode/stroke/elements/StartTLSRequest.java b/src/com/isode/stroke/elements/StartTLSRequest.java
new file mode 100644
index 0000000..23c3297
--- /dev/null
+++ b/src/com/isode/stroke/elements/StartTLSRequest.java
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+
+public class StartTLSRequest implements Element {
+//FIXME: parser/serialiser
+
+}
diff --git a/src/com/isode/stroke/elements/Status.java b/src/com/isode/stroke/elements/Status.java
new file mode 100644
index 0000000..f40814d
--- /dev/null
+++ b/src/com/isode/stroke/elements/Status.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class Status extends Payload {
+
+ String text_ = "";
+
+ public Status() {
+ }
+
+ public Status(String text) {
+ text_ = text;
+ }
+
+ public void setText(String text) {
+ text_ = text;
+ }
+
+ public String getText() {
+ return text_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/StatusShow.java b/src/com/isode/stroke/elements/StatusShow.java
new file mode 100644
index 0000000..d7f8575
--- /dev/null
+++ b/src/com/isode/stroke/elements/StatusShow.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StatusShow extends Payload {
+
+ private Type type_;
+
+ public enum Type {
+
+ Online, Away, FFC, XA, DND, None
+ };
+
+ public StatusShow() {
+ type_ = Type.Online;
+ }
+
+ public StatusShow(Type type) {
+ type_ = type;
+ }
+
+ void setType(Type type) {
+ type_ = type;
+ }
+
+ Type getType() {
+ return type_;
+ }
+
+ static String typeToFriendlyName(Type type) {
+ switch (type) {
+ case Online:
+ return "Available";
+ case FFC:
+ return "Available";
+ case Away:
+ return "Away";
+ case XA:
+ return "Away";
+ case DND:
+ return "Busy";
+ case None:
+ return "Offline";
+ }
+ return "Unknown";
+ }
+}
diff --git a/src/com/isode/stroke/elements/StreamError.java b/src/com/isode/stroke/elements/StreamError.java
new file mode 100644
index 0000000..9335ddb
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamError.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StreamError implements Element {
+
+ public enum Type {
+
+ BadFormat,
+ BadNamespacePrefix,
+ Conflict,
+ ConnectionTimeout,
+ HostGone,
+ HostUnknown,
+ ImproperAddressing,
+ InternalServerError,
+ InvalidFrom,
+ InvalidID,
+ InvalidNamespace,
+ InvalidXML,
+ NotAuthorized,
+ NotWellFormed,
+ PolicyViolation,
+ RemoteConnectionFailed,
+ Reset,
+ ResourceConstraint,
+ RestrictedXML,
+ SeeOtherHost,
+ SystemShutdown,
+ UndefinedCondition,
+ UnsupportedEncoding,
+ UnsupportedStanzaType,
+ UnsupportedVersion,
+ };
+
+ public StreamError() {
+ this(Type.UndefinedCondition);
+ }
+
+ public StreamError(Type type) {
+ this(type, "");
+ }
+
+ public StreamError(Type type, String text) {
+ if (type == null) {
+ throw new IllegalStateException();
+ }
+ type_ = type;
+ text_ = text;
+ }
+
+ public Type getType() {
+ return type_;
+ }
+
+ public void setType(Type type) {
+ type_ = type;
+ }
+
+ public void setText(String text) {
+ text_ = text;
+ }
+
+ public String getText() {
+ return text_;
+ }
+ private Type type_;
+ private String text_;
+};
diff --git a/src/com/isode/stroke/elements/StreamFeatures.java b/src/com/isode/stroke/elements/StreamFeatures.java
new file mode 100644
index 0000000..c784077
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamFeatures.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron?on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+//FIXME: parser/serialiser
+import java.util.ArrayList;
+import java.util.Collection;
+
+public class StreamFeatures implements Element {
+
+ public StreamFeatures() {
+ hasStartTLS_ = false;
+ hasResourceBind_ = false;
+ hasSession_ = false;
+ hasStreamManagement_ = false;
+ }
+
+ public void setHasStartTLS() {
+ hasStartTLS_ = true;
+ }
+
+ public boolean hasStartTLS() {
+ return hasStartTLS_;
+ }
+
+ public void setHasSession() {
+ hasSession_ = true;
+ }
+
+ public boolean hasSession() {
+ return hasSession_;
+ }
+
+ public void setHasResourceBind() {
+ hasResourceBind_ = true;
+ }
+
+ public boolean hasResourceBind() {
+ return hasResourceBind_;
+ }
+
+ public Collection<String> getCompressionMethods() {
+ return compressionMethods_;
+ }
+
+ public void addCompressionMethod(String mechanism) {
+ compressionMethods_.add(mechanism);
+ }
+
+ public boolean hasCompressionMethod(String mechanism) {
+ return compressionMethods_.contains(mechanism);
+ }
+
+ public Collection<String> getAuthenticationMechanisms() {
+ return authenticationMechanisms_;
+ }
+
+ public void addAuthenticationMechanism(String mechanism) {
+ authenticationMechanisms_.add(mechanism);
+ }
+
+ public boolean hasAuthenticationMechanism(String mechanism) {
+ return authenticationMechanisms_.contains(mechanism);
+ }
+
+ public boolean hasAuthenticationMechanisms() {
+ return !authenticationMechanisms_.isEmpty();
+ }
+
+ public boolean hasStreamManagement() {
+ return hasStreamManagement_;
+ }
+
+ public void setHasStreamManagement() {
+ hasStreamManagement_ = true;
+ }
+
+ public boolean hasRosterVersioning() {
+ return hasRosterVersioning_;
+ }
+
+ public void setHasRosterVersioning() {
+ hasRosterVersioning_ = true;
+ }
+
+ private boolean hasStartTLS_;
+ private ArrayList<String> compressionMethods_ = new ArrayList<String>();
+ private ArrayList<String> authenticationMechanisms_ = new ArrayList<String>();
+ private boolean hasResourceBind_;
+ private boolean hasSession_;
+ private boolean hasStreamManagement_;
+ private boolean hasRosterVersioning_;
+}
diff --git a/src/com/isode/stroke/elements/StreamManagementEnabled.java b/src/com/isode/stroke/elements/StreamManagementEnabled.java
new file mode 100644
index 0000000..db2aa77
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamManagementEnabled.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StreamManagementEnabled implements Element {
+
+ public void setResumeSupported() {
+ resumeSupported = true;
+ }
+
+ public boolean getResumeSupported() {
+ return resumeSupported;
+ }
+
+ public void setResumeID(String id) {
+ resumeID = id;
+ }
+
+ public String getResumeID() {
+ return resumeID;
+ }
+ private boolean resumeSupported;
+ private String resumeID;
+}
diff --git a/src/com/isode/stroke/elements/StreamManagementFailed.java b/src/com/isode/stroke/elements/StreamManagementFailed.java
new file mode 100644
index 0000000..7be357b
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamManagementFailed.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class StreamManagementFailed implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/StreamResume.java b/src/com/isode/stroke/elements/StreamResume.java
new file mode 100644
index 0000000..40c6326
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamResume.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2011, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StreamResume implements Element {
+
+ public void setResumeID(String id) {
+ resumeID = id;
+ }
+
+ public String getResumeID() {
+ return resumeID;
+ }
+
+ public Long getHandledStanzasCount() {
+ return handledStanzasCount;
+ }
+
+ public void setHandledStanzasCount(long i) {
+ handledStanzasCount = i;
+ }
+ private String resumeID;
+ private Long handledStanzasCount;
+}
diff --git a/src/com/isode/stroke/elements/StreamResumed.java b/src/com/isode/stroke/elements/StreamResumed.java
new file mode 100644
index 0000000..23f0e54
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamResumed.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2011, Remko Tron¨on.
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+public class StreamResumed implements Element {
+
+ public void setResumeID(String id) {
+ resumeID = id;
+ }
+
+ public String getResumeID() {
+ return resumeID;
+ }
+
+ public Long getHandledStanzasCount() {
+ return handledStanzasCount;
+ }
+
+ public void setHandledStanzasCount(long i) {
+ handledStanzasCount = i;
+ }
+ private String resumeID;
+ private Long handledStanzasCount;
+}
diff --git a/src/com/isode/stroke/elements/StreamType.java b/src/com/isode/stroke/elements/StreamType.java
new file mode 100644
index 0000000..4ec7d9f
--- /dev/null
+++ b/src/com/isode/stroke/elements/StreamType.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+
+public enum StreamType {
+ ClientStreamType,
+ ServerStreamType,
+ ComponentStreamType
+}
diff --git a/src/com/isode/stroke/elements/Subject.java b/src/com/isode/stroke/elements/Subject.java
new file mode 100644
index 0000000..0881a26
--- /dev/null
+++ b/src/com/isode/stroke/elements/Subject.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class Subject extends Payload {
+ String text_ = "";
+
+ public Subject() {}
+
+ public Subject(String text) {
+ setText(text);
+ }
+
+ public void setText(String text) {
+ text_ = text;
+ }
+
+ public String getText() {
+ return text_;
+ }
+}
diff --git a/src/com/isode/stroke/elements/TLSProceed.java b/src/com/isode/stroke/elements/TLSProceed.java
new file mode 100644
index 0000000..d330364
--- /dev/null
+++ b/src/com/isode/stroke/elements/TLSProceed.java
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+
+public class TLSProceed implements Element {
+//FIXME: parser/serialiser
+}
diff --git a/src/com/isode/stroke/elements/UnknownElement.java b/src/com/isode/stroke/elements/UnknownElement.java
new file mode 100644
index 0000000..c9d1f4f
--- /dev/null
+++ b/src/com/isode/stroke/elements/UnknownElement.java
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Remko Tron¨on.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+public class UnknownElement implements Element {
+
+}
diff --git a/src/com/isode/stroke/elements/Version.java b/src/com/isode/stroke/elements/Version.java
new file mode 100644
index 0000000..80c1af3
--- /dev/null
+++ b/src/com/isode/stroke/elements/Version.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Remko Tron¨on
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010 Isode Limited, London, England.
+ * All rights reserved.
+ */
+
+package com.isode.stroke.elements;
+
+
+public class Version extends Payload {
+ private String name_;
+ private String version_;
+ private String os_;
+
+ public Version(final String name, final String version, final String os) {
+ name_ = name;
+ version_ = version;
+ os_ = os;
+ }
+
+ public Version() {
+
+ }
+
+ public String getName() {
+ return name_;
+ }
+
+ public String getVersion() {
+ return version_;
+ }
+
+ public String getOS() {
+ return os_;
+ }
+
+ public void setName(final String name) {
+ name_ = name;
+ }
+
+ public void setVersion(final String version) {
+ version_ = version;
+ }
+
+ public void setOS(final String os) {
+ os_ = os;
+ }
+}