Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2013-07-12 12:17:18 +0000
committerMarkus Alexander Kuppe2013-07-12 12:17:18 +0000
commit3a8252a1911015e66fa90e3d885d472bfa838744 (patch)
treeb2573f5c10692b83120806b8b8a9742cfcf59eb2 /protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java
parent449e90b72304873f71c7e36a960468cbc9001ad1 (diff)
downloadorg.eclipse.ecf-3a8252a1911015e66fa90e3d885d472bfa838744.tar.gz
org.eclipse.ecf-3a8252a1911015e66fa90e3d885d472bfa838744.tar.xz
org.eclipse.ecf-3a8252a1911015e66fa90e3d885d472bfa838744.zip
Bug 411797 - [xmpp] org.eclipse.ecf.core.ContainerConnectException: Login attempt failed with ejabberd server
https://bugs.eclipse.org/411797
Diffstat (limited to 'protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java')
-rw-r--r--protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java b/protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java
new file mode 100644
index 000000000..ef5671ec8
--- /dev/null
+++ b/protocols/bundles/org.jivesoftware.smack/src/org/jivesoftware/smackx/pubsub/provider/EventProvider.java
@@ -0,0 +1,38 @@
+/**
+ * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jivesoftware.smackx.pubsub.provider;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jivesoftware.smack.packet.PacketExtension;
+import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider;
+import org.jivesoftware.smackx.pubsub.EventElement;
+import org.jivesoftware.smackx.pubsub.EventElementType;
+import org.jivesoftware.smackx.pubsub.NodeExtension;
+
+/**
+ * Parses the event element out of the message stanza from
+ * the server as specified in the <a href="http://xmpp.org/extensions/xep-0060.html#schemas-event">event schema</a>.
+ *
+ * @author Robin Collier
+ */
+public class EventProvider extends EmbeddedExtensionProvider
+{
+ @Override
+ protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map<String, String> attMap, List<? extends PacketExtension> content)
+ {
+ return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0));
+ }
+}

Back to the top