summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-07-01 09:19:49 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-07-01 09:19:49 (GMT)
commit2da71a8a85486a494343f1662d64fb5ae5a2a44e (patch)
tree23992f9f2a00bac23b345e5c2cc9c1194efc25be /src/com/isode/stroke/elements/StreamFeatures.java
downloadstroke-2da71a8a85486a494343f1662d64fb5ae5a2a44e.zip
stroke-2da71a8a85486a494343f1662d64fb5ae5a2a44e.tar.bz2
Initial import
Diffstat (limited to 'src/com/isode/stroke/elements/StreamFeatures.java')
-rw-r--r--src/com/isode/stroke/elements/StreamFeatures.java99
1 files changed, 99 insertions, 0 deletions
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_;
+}