summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGurmeen Bindra <gurmeen.bindra@isode.com>2012-04-17 08:59:20 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-04-19 10:45:48 (GMT)
commitc040dd31cf285f9e2ffddab859586badf6ae059e (patch)
tree0f24f533afce95dd85da16a01733d7f7f42087bb /src/com/isode/stroke/elements/MUCPayload.java
parentcb7cb7fdb0564bd7c27680b371588a45277c000a (diff)
downloadstroke-c040dd31cf285f9e2ffddab859586badf6ae059e.zip
stroke-c040dd31cf285f9e2ffddab859586badf6ae059e.tar.bz2
Port elements for MUC Administration
This patch ports basic elements from swiftern to stroke. This includes various types od MUC Payloads. Test-information: the junits for the parsers (still WIP) code works fine.
Diffstat (limited to 'src/com/isode/stroke/elements/MUCPayload.java')
-rw-r--r--src/com/isode/stroke/elements/MUCPayload.java115
1 files changed, 115 insertions, 0 deletions
diff --git a/src/com/isode/stroke/elements/MUCPayload.java b/src/com/isode/stroke/elements/MUCPayload.java
new file mode 100644
index 0000000..03b776e
--- /dev/null
+++ b/src/com/isode/stroke/elements/MUCPayload.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2012, Isode Limited, London, England.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2010, Kevin Smith
+ * All rights reserved.
+ */
+package com.isode.stroke.elements;
+
+import java.util.Date;
+
+/**
+ * Class representing a MUC Payload
+ *
+ */
+public class MUCPayload extends Payload {
+ private int maxChars_;
+ private int maxStanzas_;
+ private int seconds_;
+ private Date since_;
+ private String password_;
+
+ /**
+ * Constructor
+ */
+ public MUCPayload() {
+ maxChars_ = -1;
+ maxStanzas_ = -1;
+ seconds_ = -1;
+ }
+
+ /**
+ * Set the maximum number of characters where character count is the characters of the
+ * complete XML stanzas, not only their XML character data
+ * @param maxChars maximum number of characters (positive value)
+ */
+ public void setMaxChars(int maxChars) {
+ maxChars_ = maxChars;
+ }
+
+ /**
+ * Set the maximum number of stanzas which means limiting the total number of messages
+ * @param maxStanzas maximum number of stanzas
+ */
+ public void setMaxStanzas(int maxStanzas) {
+ maxStanzas_ = maxStanzas;
+ }
+
+ /**
+ * Set the number of seconds which means send only the messages received in the
+ * last "X" seconds.
+ * @param seconds number of seconds
+ */
+ public void setSeconds(int seconds) {
+ seconds_ = seconds;
+ }
+
+ /**
+ * Set the date which means send only the messages received since the
+ * date/time specified
+ * @param since date-time, should not be null
+ */
+ public void setSince(Date since) {
+ since_ = since;
+ }
+
+ /**
+ * Set the MUC password
+ * @param password password, can be null
+ */
+ public void setPassword(String password) {
+ password_ = password;
+ }
+
+ /**
+ * Get the maximum number of characters
+ * @return max characters
+ */
+ public int getMaxChars() {
+ return maxChars_;
+ }
+
+ /**
+ * Get the maximum number of stanzas
+ * @return max stanzas
+ */
+ public int getMaxStanzas(){
+ return maxStanzas_;
+ }
+
+ /**
+ * Get the number of seconds
+ * @return number of seconds
+ */
+ public int getSeconds() {
+ return seconds_;
+ }
+
+ /**
+ * Get the password
+ * @return password, can be null if not set
+ */
+ public String getPassword() {
+ return password_;
+ }
+
+ /**
+ * Get the date specified to limit the stazas
+ * @return date, ca be null if not set
+ */
+ public Date getSince() {
+ return since_;
+ }
+} \ No newline at end of file