From 332f85a2ef7e27d9841ea23fd888b7cfb56a220e Mon Sep 17 00:00:00 2001 From: Josh Long Date: Mon, 12 Jul 2010 08:19:49 +0000 Subject: [PATCH] updating docs for xmpp adapters. --- .../integration/xmpp/XmppHeaders.java | 4 +- .../InboundXmppEndpointTests-context.xml | 58 ++++++------ src/docbkx/xmpp.xml | 90 ++++++++++++++++++- 3 files changed, 116 insertions(+), 36 deletions(-) diff --git a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppHeaders.java b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppHeaders.java index a7444c528a..de144a8ea5 100644 --- a/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppHeaders.java +++ b/spring-integration-xmpp/src/main/java/org/springframework/integration/xmpp/XmppHeaders.java @@ -33,9 +33,9 @@ public class XmppHeaders { public static final String CHAT_TO_USER = PREFIX + "chat_to_user"; public static final String CHAT_THREAD_ID = PREFIX + "thread_id"; public static final String TYPE = PREFIX + "type"; - public static final String ROSTER_CHANGE_TYPE = PREFIX + "roster_change_type"; +// public static final String ROSTER_CHANGE_TYPE = PREFIX + "roster_change_type"; public static final String PRESENCE = PREFIX + "presence"; - public static final String ROSTER = PREFIX + "roster"; +// public static final String ROSTER = PREFIX + "roster"; public static final String PRESENCE_LANGUAGE = PRESENCE + "language" ; public static final String PRESENCE_PRIORITY = PRESENCE + "priority" ; diff --git a/spring-integration-xmpp/src/test/resources/org/springframework/integration/xmpp/messages/InboundXmppEndpointTests-context.xml b/spring-integration-xmpp/src/test/resources/org/springframework/integration/xmpp/messages/InboundXmppEndpointTests-context.xml index d7aa3cdc82..489c766656 100644 --- a/spring-integration-xmpp/src/test/resources/org/springframework/integration/xmpp/messages/InboundXmppEndpointTests-context.xml +++ b/spring-integration-xmpp/src/test/resources/org/springframework/integration/xmpp/messages/InboundXmppEndpointTests-context.xml @@ -15,16 +15,16 @@ ~ limitations under the License. --> - + - - - - - - - + - + - + - + - + diff --git a/src/docbkx/xmpp.xml b/src/docbkx/xmpp.xml index a8753e0c47..796f0b7667 100644 --- a/src/docbkx/xmpp.xml +++ b/src/docbkx/xmpp.xml @@ -58,7 +58,7 @@ XMPP Connection To participate in the network, an actor must connect to an XMPP server. Typically this requires - at a minimum - a - user, apassword, ahost, and aport. + user, a password, a host, and a port. To create an XMPP connection, you may use the XML namespace. @@ -78,7 +78,93 @@ XMPP Messages
Inbound Message Adapter - TBD + The Spring Integration adapters support receiving messages from other users in the system. To do this, the adapter "logs in" as a user + on your behalf and receives the messages sent to that user. Those messages are then forwarded to your Spring Integration + client. + The payload of the inbound Spring Integration message may be of the raw type + org.jivesoftware.smack.packet.Message, or of the type java.lang.String - which is the type of the raw + Message's + body property - + depending on whether you specify extract-payload on the adapter's configuration or not. + Inbound Messages are typically small and are text-oriented. Messages received using the adapter have + a pretty standard layout, with known headers (all headers have keys defined on org.springframework.integration.xmpp.XmppHeaders): + + + + + + + + + +
Header Name What it Describes
XmppHeaders.CHAT A reference to the org.jivesoftware.smack.Chat class which represents the + threaded conversation containing the message. +
XmppHeaders.TYPE The value of the + the + org.jivesoftware.smack.packet.Message.Type enum that describes the inbound message. Possible values are: + normal, + chat, + groupchat, + headline, + error. +
+ + + + + This adapter requires a reference to an XMPP Connection. You may + use the xmpp-connection + element to define one. + + An example might look as follows: + + + + + + + + + + + + + + + + + +]]> + + + + +
Outbound Message Adapter