diff --git a/activemq-xmpp/pom.xml b/activemq-xmpp/pom.xml new file mode 100755 index 0000000000..3147694dae --- /dev/null +++ b/activemq-xmpp/pom.xml @@ -0,0 +1,238 @@ + + + + + + + 4.0.0 + + + org.apache.activemq + activemq-parent + 4.1-incubator-SNAPSHOT + + + activemq-xmpp + jar + ActiveMQ :: XMPP + + + + codehaus + Codehaus Maven 2 Repository + http://repository.codehaus.org/ + + + maven2-repository.dev.java.net + Java.net Maven 2 Repository + https://maven2-repository.dev.java.net/nonav/repository + + + maven-repository.dev.java.net + Java.net Maven 1 Repository (legacy) + https://maven-repository.dev.java.net/nonav/repository + legacy + + + + + maven2-repository.dev.java.net + https://maven2-repository.dev.java.net/nonav/repository + + + maven-repository.dev.java.net + Java.net Maven 1 Repository (legacy) + https://maven-repository.dev.java.net/nonav/repository + legacy + + + + + + + ${pom.groupId} + activemq-core + + + + ${pom.groupId} + activeio-core + + + + stax + stax + runtime + true + + + xmlbeans + xmlbeans-jsr173-api + + + + + + + com.sun.xml.bind + jaxb-impl + 2.0.2 + + + javax.xml + jsr173 + + + javax.jws + jsr181-api + + + + + javax.xml + jaxb-api + 2.0 + + + javax.xml + jsr173 + + + + + + org.codehaus.woodstox + + wstx-asl + 3.0.1 + + + + + org.springframework + spring + 2.0 + + + + jivesoftware + smack + 1.5.0 + + test + + + jivesoftware + smackx + 1.5.0 + + + + + junit + junit + 3.8.1 + test + + + + + + install + + + + + org.apache.maven.plugins + maven-compiler-plugin + true + + 1.5 + 1.5 + + + + + + maven-surefire-plugin + + + + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + net.java.dev.jaxb2-commons + jaxb-fluent-api + 2.0.1 + + + com.sun.xml + jaxb-xjc + + + + + + + + generate + + + + + false + false + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/README.txt b/activemq-xmpp/src/main/excluded-schemas/README.txt new file mode 100644 index 0000000000..6c098fa084 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/README.txt @@ -0,0 +1,5 @@ +This directory contains all the bad XSDs from the XMPP project that we can't process via JAXB2 + +For more see + +http://www.xmpp.org/schemas/ \ No newline at end of file diff --git a/activemq-xmpp/src/main/excluded-schemas/bind.xsd b/activemq-xmpp/src/main/excluded-schemas/bind.xsd new file mode 100755 index 0000000000..5a843bb6c7 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/bind.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/bookmarks.xsd b/activemq-xmpp/src/main/excluded-schemas/bookmarks.xsd new file mode 100644 index 0000000000..c5517d6f62 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/bookmarks.xsd @@ -0,0 +1,54 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0048: http://www.jabber.org/jeps/jep-0048.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/bytestreams.xsd b/activemq-xmpp/src/main/excluded-schemas/bytestreams.xsd new file mode 100644 index 0000000000..259bdff087 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/bytestreams.xsd @@ -0,0 +1,74 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0065: http://www.jabber.org/jeps/jep-0065.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/caps.xsd b/activemq-xmpp/src/main/excluded-schemas/caps.xsd new file mode 100644 index 0000000000..e93555c71c --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/caps.xsd @@ -0,0 +1,34 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0115: http://www.jabber.org/jeps/jep-0115.html + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/chatstates.xsd b/activemq-xmpp/src/main/excluded-schemas/chatstates.xsd new file mode 100644 index 0000000000..9b579b12d8 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/chatstates.xsd @@ -0,0 +1,28 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0085: http://www.jabber.org/jeps/jep-0085.html + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/commands.xsd b/activemq-xmpp/src/main/excluded-schemas/commands.xsd new file mode 100644 index 0000000000..306b6098fe --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/commands.xsd @@ -0,0 +1,102 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0050: http://www.jabber.org/jeps/jep-0050.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/component-accept.xsd b/activemq-xmpp/src/main/excluded-schemas/component-accept.xsd new file mode 100644 index 0000000000..ff8a158497 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/component-accept.xsd @@ -0,0 +1,201 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0114: http://www.jabber.org/jeps/jep-0114.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/component-connect.xsd b/activemq-xmpp/src/main/excluded-schemas/component-connect.xsd new file mode 100644 index 0000000000..c25547acb8 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/component-connect.xsd @@ -0,0 +1,200 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0114: http://www.jabber.org/jeps/jep-0114.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/compress-feature.xsd b/activemq-xmpp/src/main/excluded-schemas/compress-feature.xsd new file mode 100644 index 0000000000..f4b6fe1176 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/compress-feature.xsd @@ -0,0 +1,24 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0138: http://www.jabber.org/jeps/jep-0138.html + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/compress.xsd b/activemq-xmpp/src/main/excluded-schemas/compress.xsd new file mode 100644 index 0000000000..461a3c27f8 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/compress.xsd @@ -0,0 +1,48 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0138: http://www.jabber.org/jeps/jep-0138.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/delimiter.xsd b/activemq-xmpp/src/main/excluded-schemas/delimiter.xsd new file mode 100644 index 0000000000..842aedc697 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/delimiter.xsd @@ -0,0 +1,15 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0083: http://www.jabber.org/jeps/jep-0083.html + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/e2e.xsd b/activemq-xmpp/src/main/excluded-schemas/e2e.xsd new file mode 100755 index 0000000000..67e3566aa2 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/e2e.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/feature-neg.xsd b/activemq-xmpp/src/main/excluded-schemas/feature-neg.xsd new file mode 100644 index 0000000000..2133b48b39 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/feature-neg.xsd @@ -0,0 +1,27 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0020: http://www.jabber.org/jeps/jep-0020.html + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/file-transfer.xsd b/activemq-xmpp/src/main/excluded-schemas/file-transfer.xsd new file mode 100644 index 0000000000..4a6c08cac9 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/file-transfer.xsd @@ -0,0 +1,46 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0096: http://www.jabber.org/jeps/jep-0096.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/geoloc.xsd b/activemq-xmpp/src/main/excluded-schemas/geoloc.xsd new file mode 100644 index 0000000000..ab133e6f2e --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/geoloc.xsd @@ -0,0 +1,31 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0080: http://www.jabber.org/jeps/jep-0080.html + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/http-auth.xsd b/activemq-xmpp/src/main/excluded-schemas/http-auth.xsd new file mode 100644 index 0000000000..66ea5e2810 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/http-auth.xsd @@ -0,0 +1,34 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0070: http://www.jabber.org/jeps/jep-0070.html + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/httpbind.xsd b/activemq-xmpp/src/main/excluded-schemas/httpbind.xsd new file mode 100644 index 0000000000..b23d6b3c46 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/httpbind.xsd @@ -0,0 +1,92 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0124: http://www.jabber.org/jeps/jep-0124.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/ibb.xsd b/activemq-xmpp/src/main/excluded-schemas/ibb.xsd new file mode 100644 index 0000000000..54d083b965 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/ibb.xsd @@ -0,0 +1,54 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0047: http://www.jabber.org/jeps/jep-0047.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/index.shtml b/activemq-xmpp/src/main/excluded-schemas/index.shtml new file mode 100755 index 0000000000..ee5a998365 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/index.shtml @@ -0,0 +1,413 @@ + + +XMPP Schemas + +

XMPP Schemas

+

Last Updated: 2006-10-04

+

The wire protocols defined in the XMPP RFCs and various XMPP extensions are described formally in terms of W3C XML Schema. This page provides links to online versions of the relevant schemas.

+

Note: The following table is sortable, just click on the headers (click twice to reverse the sort order).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NamespaceSchemaSpec
http://etherx.jabber.org/streamsstreams.xsdRFC 3920 *
http://jabber.org/protocol/activityactivity.xsdXEP-0108
http://jabber.org/protocol/addressaddress.xsdXEP-0033
http://jabber.org/protocol/ampamp.xsdXEP-0079
http://jabber.org/protocol/amp#errorsamp-errors.xsdXEP-0079
http://jabber.org/protocol/bytestreamsbytestreams.xsdXEP-0065
http://jabber.org/protocol/capscaps.xsdXEP-0115
http://jabber.org/protocol/chatstateschatstates.xsdXEP-0085
http://jabber.org/protocol/commandscommands.xsdXEP-0050
http://jabber.org/protocol/compresscompress.xsdXEP-0138
http://jabber.org/features/compresscompress-feature.xsdXEP-0138
http://jabber.org/protocol/disco#infodisco-info.xsdXEP-0030
http://jabber.org/protocol/disco#itemsdisco-items.xsdXEP-0030
http://jabber.org/protocol/feature-negfeature-neg.xsdXEP-0020
http://jabber.org/protocol/geolocgeoloc.xsdXEP-0080
http://jabber.org/protocol/http-authhttp-auth.xsdXEP-0070
http://jabber.org/protocol/httpbindhttpbind.xsdXEP-0124
http://jabber.org/protocol/ibbibb.xsdXEP-0047
http://jabber.org/protocol/moodmood.xsdXEP-0107
http://jabber.org/protocol/mucmuc.xsdXEP-0045
http://jabber.org/protocol/muc#adminmuc-admin.xsdXEP-0045
http://jabber.org/protocol/muc#ownermuc-owner.xsdXEP-0045
http://jabber.org/protocol/muc#usermuc-user.xsdXEP-0045
http://jabber.org/protocol/nicknick.xsdXEP-0172
http://jabber.org/protocol/offlineoffline.xsdXEP-0013
http://jabber.org/protocol/pubsubpubsub.xsdXEP-0060
http://jabber.org/protocol/pubsub#errorspubsub-errors.xsdXEP-0060
http://jabber.org/protocol/pubsub#eventpubsub-event.xsdXEP-0060
http://jabber.org/protocol/pubsub#ownerpubsub-owner.xsdXEP-0060
http://jabber.org/protocol/rosterxrosterx.xsdXEP-0144
http://jabber.org/protocol/rsmrsm.xsdXEP-0059
http://jabber.org/protocol/sisi.xsdXEP-0095
http://jabber.org/protocol/si/profile/file-transferfile-transfer.xsdXEP-0096
http://jabber.org/protocol/sipubsipub.xsdXEP-0137
http://jabber.org/protocol/soap#faultsoap-fault.xsdXEP-0072
http://jabber.org/protocol/tunetune.xsdXEP-0095
http://jabber.org/protocol/waitinglistwaitinglist.xsdXEP-0130
http://jabber.org/protocol/xhtml-imxhtml-im-driver.xsdXEP-0071
http://jabber.org/protocol/xhtml-imxhtml-im-model.xsdXEP-0071
http://jabber.org/protocol/xhtml-imxhtml-im-wrapper.xsdXEP-0071
http://jabber.org/protocol/xdata-layoutxdata-layout.xsdXEP-0141
http://jabber.org/protocol/xdata-validatexdata-validate.xsdXEP-0122
jabber:clientjabber-client.xsdRFC 3920 *
jabber:component:acceptcomponent-accept.xsdXEP-0114
jabber:component:connectcomponent-connect.xsdXEP-0114
jabber:iq:authiq-auth.xsdXEP-0078
jabber:iq:gatewayiq-gateway.xsdXEP-0100
jabber:iq:lastiq-last.xsdXEP-0012
jabber:iq:oobiq-oob.xsdXEP-0066
jabber:iq:passiq-pass.xsdXEP-0003
jabber:iq:privacyprivacy.xsdRFC 3921 *
jabber:iq:privateiq-private.xsdXEP-0049
jabber:iq:registeriq-register.xsdXEP-0077
jabber:iq:rosterroster.xsdRFC 3921 *
jabber:iq:rpcjabber-rpc.xsdXEP-0009
jabber:iq:searchiq-search.xsdXEP-0055
jabber:iq:timeiq-time.xsdXEP-0090
jabber:iq:versioniq-version.xsdXEP-0092
jabber:serverjabber-server.xsdRFC 3920 *
jabber:server:dialbackdialback.xsdRFC 3920 *
jabber:x:datax-data.xsdXEP-0004
jabber:x:delayx-delay.xsdXEP-0091
jabber:x:encryptedx-encrypted.xsdXEP-0027
jabber:x:eventx-event.xsdXEP-0022
jabber:x:expirex-expire.xsdXEP-0023
jabber:x:oobx-oob.xsdXEP-0066
jabber:x:rosterx-roster.xsdXEP-0093
jabber:x:signedx-signed.xsdXEP-0027
roster:delimiterdelimiter.xsdXEP-0083
storage:bookmarksbookmarks.xsdXEP-0048
storage:rosternotesrosternotes.xsdXEP-0045
urn:ietf:params:xml:ns:xmpp-bindbind.xsdRFC 3920 *
urn:ietf:params:xml:ns:xmpp-e2ee2e.xsdRFC 3923
urn:ietf:params:xml:ns:xmpp-saslsasl.xsdRFC 3920 *
urn:ietf:params:xml:ns:xmpp-sessionsession.xsdRFC 3921 *
urn:ietf:params:xml:ns:xmpp-stanzasstanzaerror.xsdRFC 3920 *
urn:ietf:params:xml:ns:xmpp-streamsstreamerror.xsdRFC 3920 *
urn:ietf:params:xml:ns:xmpp-tlstls.xsdRFC 3920 *
vcard-temp:x:updatevcard-avatar.xsdXEP-0153
+

* Note: The schemas provided here are the latest versions from the CVS repository, incorporating expected changes as reflected in rfc3920bis and rfc3921bis.

+ diff --git a/activemq-xmpp/src/main/excluded-schemas/iq-register.xsd b/activemq-xmpp/src/main/excluded-schemas/iq-register.xsd new file mode 100644 index 0000000000..bf5d72b3e2 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/iq-register.xsd @@ -0,0 +1,63 @@ + + + + + + + + + + The protocol documented by this schema is defined in + JEP-0077: http://www.jabber.org/jeps/jep-0077.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/iq-search.xsd b/activemq-xmpp/src/main/excluded-schemas/iq-search.xsd new file mode 100644 index 0000000000..5299cd4eff --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/iq-search.xsd @@ -0,0 +1,47 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0055: http://www.jabber.org/jeps/jep-0055.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/jabber-rpc.xsd b/activemq-xmpp/src/main/excluded-schemas/jabber-rpc.xsd new file mode 100644 index 0000000000..b7444d21b9 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/jabber-rpc.xsd @@ -0,0 +1,152 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0009: http://www.jabber.org/jeps/jep-0009.html + + There is no official XML schema for XML-RPC. The main body + of this schema has been borrowed from an unofficial schema + representation contained in the book "Processing XML With + Java" by Elliotte Rusty Harold, as located at: + + http://www.ibiblio.org/xml/books/xmljava/chapters/ch02s05.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/mood.xsd b/activemq-xmpp/src/main/excluded-schemas/mood.xsd new file mode 100644 index 0000000000..1e911817dd --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/mood.xsd @@ -0,0 +1,93 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0107: http://www.jabber.org/jeps/jep-0107.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/muc-owner.xsd b/activemq-xmpp/src/main/excluded-schemas/muc-owner.xsd new file mode 100644 index 0000000000..e419056135 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/muc-owner.xsd @@ -0,0 +1,45 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0045: http://www.jabber.org/jeps/jep-0045.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/nick.xsd b/activemq-xmpp/src/main/excluded-schemas/nick.xsd new file mode 100644 index 0000000000..5eafcd0a1f --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/nick.xsd @@ -0,0 +1,18 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0172: http://www.jabber.org/jeps/jep-0172.html + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/offline.xsd b/activemq-xmpp/src/main/excluded-schemas/offline.xsd new file mode 100644 index 0000000000..d00defa508 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/offline.xsd @@ -0,0 +1,39 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0013: http://www.jabber.org/jeps/jep-0013.html + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/privacy.xsd b/activemq-xmpp/src/main/excluded-schemas/privacy.xsd new file mode 100755 index 0000000000..34c84dcd38 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/privacy.xsd @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/pubsub-errors.xsd b/activemq-xmpp/src/main/excluded-schemas/pubsub-errors.xsd new file mode 100644 index 0000000000..a13b9df1c3 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/pubsub-errors.xsd @@ -0,0 +1,87 @@ + + + + + + + This namespace is used for error reporting only, as + defined in JEP-0060: + + http://www.jabber.org/jeps/jep-0060.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/pubsub-event.xsd b/activemq-xmpp/src/main/excluded-schemas/pubsub-event.xsd new file mode 100644 index 0000000000..4d3d803d08 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/pubsub-event.xsd @@ -0,0 +1,139 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0060: http://www.jabber.org/jeps/jep-0060.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/pubsub-owner.xsd b/activemq-xmpp/src/main/excluded-schemas/pubsub-owner.xsd new file mode 100644 index 0000000000..40dc8e8c29 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/pubsub-owner.xsd @@ -0,0 +1,127 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0060: http://www.jabber.org/jeps/jep-0060.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/pubsub.xsd b/activemq-xmpp/src/main/excluded-schemas/pubsub.xsd new file mode 100644 index 0000000000..a76ca99718 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/pubsub.xsd @@ -0,0 +1,203 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0060: http://www.jabber.org/jeps/jep-0060.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/rsm.xsd b/activemq-xmpp/src/main/excluded-schemas/rsm.xsd new file mode 100644 index 0000000000..1333a35936 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/rsm.xsd @@ -0,0 +1,40 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0059: http://www.jabber.org/jeps/jep-0059.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/shim.xsd b/activemq-xmpp/src/main/excluded-schemas/shim.xsd new file mode 100644 index 0000000000..70bca4a054 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/shim.xsd @@ -0,0 +1,34 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0131: http://www.jabber.org/jeps/jep-0131.html + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/si.xsd b/activemq-xmpp/src/main/excluded-schemas/si.xsd new file mode 100644 index 0000000000..b1546b060f --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/si.xsd @@ -0,0 +1,47 @@ + + + + + + + + + The protocol documented by this schema is defined in + JEP-0095: http://www.jabber.org/jeps/jep-0095.html + + + + + + + This is the root content element. All other elements in + this namespace are for communicating error information. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/sipub.xsd b/activemq-xmpp/src/main/excluded-schemas/sipub.xsd new file mode 100644 index 0000000000..7a6116bb4f --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/sipub.xsd @@ -0,0 +1,49 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0137: http://www.jabber.org/jeps/jep-0137.html + + + + + + This is the root content element for advertising a stream. + + + + + + + + + + + + + + + This is the element for requesting retrieval of a stream. + + + + + + + + + This is the element for specifying the stream to be retrieved. + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/soap-fault.xsd b/activemq-xmpp/src/main/excluded-schemas/soap-fault.xsd new file mode 100644 index 0000000000..4ff2465709 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/soap-fault.xsd @@ -0,0 +1,28 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0072: http://www.jabber.org/jeps/jep-0072.html + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/tune.xsd b/activemq-xmpp/src/main/excluded-schemas/tune.xsd new file mode 100644 index 0000000000..67eeed6d93 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/tune.xsd @@ -0,0 +1,28 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0118: http://www.jabber.org/jeps/jep-0118.html + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/vcard-avatar.xsd b/activemq-xmpp/src/main/excluded-schemas/vcard-avatar.xsd new file mode 100644 index 0000000000..2614ead355 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/vcard-avatar.xsd @@ -0,0 +1,24 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0153: http://www.jabber.org/jeps/jep-0153.html + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/waitinglist.xsd b/activemq-xmpp/src/main/excluded-schemas/waitinglist.xsd new file mode 100644 index 0000000000..21dc101b4e --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/waitinglist.xsd @@ -0,0 +1,79 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0130: http://www.jabber.org/jeps/jep-0130.html + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-data.xsd b/activemq-xmpp/src/main/excluded-schemas/x-data.xsd new file mode 100644 index 0000000000..bae984e862 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-data.xsd @@ -0,0 +1,111 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0004: http://www.jabber.org/jeps/jep-0004.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-delay.xsd b/activemq-xmpp/src/main/excluded-schemas/x-delay.xsd new file mode 100644 index 0000000000..8ea3047285 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-delay.xsd @@ -0,0 +1,27 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0091: http://www.jabber.org/jeps/jep-0091.html + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-encrypted.xsd b/activemq-xmpp/src/main/excluded-schemas/x-encrypted.xsd new file mode 100644 index 0000000000..9e13a338f3 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-encrypted.xsd @@ -0,0 +1,18 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0027: http://www.jabber.org/jeps/jep-0027.html + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-event.xsd b/activemq-xmpp/src/main/excluded-schemas/x-event.xsd new file mode 100644 index 0000000000..12cebeb0c6 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-event.xsd @@ -0,0 +1,34 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0022: http://www.jabber.org/jeps/jep-0022.html + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-expire.xsd b/activemq-xmpp/src/main/excluded-schemas/x-expire.xsd new file mode 100644 index 0000000000..60bf762454 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-expire.xsd @@ -0,0 +1,33 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0023: http://www.jabber.org/jeps/jep-0023.html + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-oob.xsd b/activemq-xmpp/src/main/excluded-schemas/x-oob.xsd new file mode 100644 index 0000000000..d77887367a --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-oob.xsd @@ -0,0 +1,25 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0066: http://www.jabber.org/jeps/jep-0066.html + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-roster.xsd b/activemq-xmpp/src/main/excluded-schemas/x-roster.xsd new file mode 100644 index 0000000000..2482ba0df2 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-roster.xsd @@ -0,0 +1,37 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0093: http://www.jabber.org/jeps/jep-0093.html + + NOTE WELL: This protocol has been superseded by JEP-0144: + http://www.jabber.org/jeps/jep-0144.html + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/x-signed.xsd b/activemq-xmpp/src/main/excluded-schemas/x-signed.xsd new file mode 100644 index 0000000000..f8d51595f6 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/x-signed.xsd @@ -0,0 +1,18 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0027: http://www.jabber.org/jeps/jep-0027.html + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xdata-layout.xsd b/activemq-xmpp/src/main/excluded-schemas/xdata-layout.xsd new file mode 100644 index 0000000000..6e599a84bb --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xdata-layout.xsd @@ -0,0 +1,60 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0141: http://www.jabber.org/jeps/jep-0141.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xdata-validate.xsd b/activemq-xmpp/src/main/excluded-schemas/xdata-validate.xsd new file mode 100644 index 0000000000..f227b545b7 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xdata-validate.xsd @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-blkphras-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-blkphras-1.xsd new file mode 100644 index 0000000000..efbe02bc7e --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-blkphras-1.xsd @@ -0,0 +1,207 @@ + + + + + + + This is the XML Schema Block Phrasal support module for XHTML + $Id$ + + + + + + + Block Phrasal + This module declares the elements and their attributes used to + support block-level phrasal markup. + This is the XML Schema block phrasal elements module for XHTML + + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-blkstruct-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-blkstruct-1.xsd new file mode 100644 index 0000000000..8fc2edb803 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-blkstruct-1.xsd @@ -0,0 +1,57 @@ + + + + + + Block Structural + + * div, p + + This module declares the elements and their attributes used to + support block-level structural markup. + + This is the XML Schema Block Structural module for XHTML + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-hypertext-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-hypertext-1.xsd new file mode 100644 index 0000000000..bbf727c769 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-hypertext-1.xsd @@ -0,0 +1,51 @@ + + + + + + Hypertext Module + This is the XML Schema Hypertext module for XHTML + + * a + + This module declares the anchor ('a') element type, which + defines the source of a hypertext link. The destination + (or link 'target') is identified via its 'id' attribute + rather than the 'name' attribute as was used in HTML. + + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-im-driver.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-driver.xsd new file mode 100644 index 0000000000..19f073d040 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-driver.xsd @@ -0,0 +1,220 @@ + + + + + + + + This is the XML Schema module of named XHTML 1.0 content models + for XHTML-IM, an XHTML 1.0 Integration Set for use in exchanging + marked-up instant messages between entities that conform to + the Extensible Messaging and Presence Protocol (XMPP). This + Integration Set includes a subset of the modules defined for + XHTML 1.0 but does not redefine any existing modules, nor + does it define any new modules. Specifically, it includes the + following modules only: + + - Structure + - Text + - Hypertext + - List + - Image + - Style Attribute + + Therefore XHTML-IM uses the following content models: + + Block.mix; Block-like elements, e.g., paragraphs + Flow.mix; Any block or inline elements + Inline.mix; Character-level elements + InlineNoAnchor.class; Anchor element + InlinePre.mix; Pre element + + XHTML-IM also uses the following Attribute Groups: + + Core.extra.attrib + I18n.extra.attrib + Common.extra + + Full documentation of this Integration Set is contained in + "JEP-0071: XHTML-IM", a specification published by the + Jabber Software Foundation. + + http://www.jabber.org/jeps/jep-0071.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-im-model.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-model.xsd new file mode 100644 index 0000000000..19f073d040 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-model.xsd @@ -0,0 +1,220 @@ + + + + + + + + This is the XML Schema module of named XHTML 1.0 content models + for XHTML-IM, an XHTML 1.0 Integration Set for use in exchanging + marked-up instant messages between entities that conform to + the Extensible Messaging and Presence Protocol (XMPP). This + Integration Set includes a subset of the modules defined for + XHTML 1.0 but does not redefine any existing modules, nor + does it define any new modules. Specifically, it includes the + following modules only: + + - Structure + - Text + - Hypertext + - List + - Image + - Style Attribute + + Therefore XHTML-IM uses the following content models: + + Block.mix; Block-like elements, e.g., paragraphs + Flow.mix; Any block or inline elements + Inline.mix; Character-level elements + InlineNoAnchor.class; Anchor element + InlinePre.mix; Pre element + + XHTML-IM also uses the following Attribute Groups: + + Core.extra.attrib + I18n.extra.attrib + Common.extra + + Full documentation of this Integration Set is contained in + "JEP-0071: XHTML-IM", a specification published by the + Jabber Software Foundation. + + http://www.jabber.org/jeps/jep-0071.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-im-wrapper.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-wrapper.xsd new file mode 100644 index 0000000000..91a866a1f9 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-im-wrapper.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + This schema defines the element qualified by + the 'http://jabber.org/protocol/xhtml-im' namespace. + The only allowable child is a element qualified + by the 'http://www.w3.org/1999/xhtml' namespace. Refer + to the XHTML-IM schema driver for the definition of the + XHTML 1.0 Integration Set. + + Full documentation of this Integration Set is contained in + "JEP-0071: XHTML-IM", a specification published by the + Jabber Software Foundation. + + http://www.jabber.org/jeps/jep-0071.html + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-image-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-image-1.xsd new file mode 100644 index 0000000000..153cf7ff06 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-image-1.xsd @@ -0,0 +1,48 @@ + + + + + Images + This is the XML Schema Images module for XHTML + + * img + + This module provides markup to support basic image embedding. + + To avoid problems with text-only UAs as well as to make + image content understandable and navigable to users of + non-visual UAs, you need to provide a description with + the 'alt' attribute, and avoid server-side image maps. + + + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-inlphras-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlphras-1.xsd new file mode 100644 index 0000000000..19a93cf9f7 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlphras-1.xsd @@ -0,0 +1,220 @@ + + + + + + This is the XML Schema Inline Phrasal support module for XHTML + $Id$ + + + + + + + Inline Phrasal. + This module declares the elements and their attributes used to + support inline-level phrasal markup. + This is the XML Schema Inline Phrasal module for XHTML + + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstruct-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstruct-1.xsd new file mode 100644 index 0000000000..f53715da6b --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstruct-1.xsd @@ -0,0 +1,60 @@ + + + + + + + This is the XML Schema Inline Structural support module for XHTML + $Id$ + + + + + + + Inline Structural. + This module declares the elements and their attributes + used to support inline-level structural markup. + This is the XML Schema Inline Structural element module for XHTML + + * br, span + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstyle-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstyle-1.xsd new file mode 100644 index 0000000000..b946c3978e --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-inlstyle-1.xsd @@ -0,0 +1,27 @@ + + + + + + Inline Style module + This is the XML Schema Inline Style module for XHTML + + * styloe attribute + + This module declares the 'style' attribute, used to support inline + style markup. + + $Id$ + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-list-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-list-1.xsd new file mode 100644 index 0000000000..7503a1fce6 --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-list-1.xsd @@ -0,0 +1,128 @@ + + + + + + List Module + This is the XML Schema Lists module for XHTML + List Module Elements + + * dl, dt, dd, ol, ul, li + + This module declares the list-oriented element types + and their attributes. + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/excluded-schemas/xhtml-struct-1.xsd b/activemq-xmpp/src/main/excluded-schemas/xhtml-struct-1.xsd new file mode 100644 index 0000000000..8200115cdb --- /dev/null +++ b/activemq-xmpp/src/main/excluded-schemas/xhtml-struct-1.xsd @@ -0,0 +1,101 @@ + + + + + + This is the XML Schema Document Structure module for XHTML + Document Structure + + * title, head, body, html + + The Structure Module defines the major structural elements and + their attributes. + + $Id$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java new file mode 100644 index 0000000000..70778c6c75 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java @@ -0,0 +1,476 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import ietf.params.xml.ns.xmpp_sasl.Auth; +import ietf.params.xml.ns.xmpp_sasl.Challenge; +import ietf.params.xml.ns.xmpp_sasl.Success; +import ietf.params.xml.ns.xmpp_tls.Proceed; +import ietf.params.xml.ns.xmpp_tls.Starttls; +import jabber.client.Body; +import jabber.client.Error; +import jabber.client.Iq; +import jabber.client.Message; +import jabber.client.Presence; +import jabber.iq.auth.Query; +import org.apache.activemq.command.*; +import org.apache.activemq.transport.xmpp.command.Handler; +import org.apache.activemq.transport.xmpp.command.HandlerRegistry; +import org.apache.activemq.util.IdGenerator; +import org.apache.activemq.util.LongSequenceGenerator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jabber.protocol.disco_info.Feature; +import org.jabber.protocol.disco_info.Identity; +import org.jabber.protocol.disco_items.Item; +import org.jabber.protocol.muc_user.X; +import org.w3c.dom.Element; + +import javax.jms.JMSException; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * TODO lots of this code could be shared with Stomp + */ +public class ProtocolConverter { + private static final transient Log log = LogFactory.getLog(ProtocolConverter.class); + + private HandlerRegistry registry = new HandlerRegistry(); + private XmppTransport transport; + + + private static final IdGenerator connectionIdGenerator = new IdGenerator(); + private static final IdGenerator clientIdGenerator = new IdGenerator("xmpp"); + private final ConnectionId connectionId = new ConnectionId(connectionIdGenerator.generateId()); + private final SessionId sessionId = new SessionId(connectionId, -1); + private final ProducerId producerId = new ProducerId(sessionId, 1); + + private final ConnectionInfo connectionInfo = new ConnectionInfo(connectionId); + private final SessionInfo sessionInfo = new SessionInfo(sessionId); + private final ProducerInfo producerInfo = new ProducerInfo(producerId); + + private final LongSequenceGenerator consumerIdGenerator = new LongSequenceGenerator(); + private final LongSequenceGenerator messageIdGenerator = new LongSequenceGenerator(); + private final LongSequenceGenerator transactionIdGenerator = new LongSequenceGenerator(); + + private final Map> resposeHandlers = new ConcurrentHashMap>(); + private final Map> subscriptionsByConsumerId = new ConcurrentHashMap>(); + private final Map transactions = new ConcurrentHashMap(); + + private final Object commnadIdMutex = new Object(); + private int lastCommandId; + private final AtomicBoolean connected = new AtomicBoolean(false); + + public ProtocolConverter(XmppTransport transport) { + this.transport = transport; + initialiseRegistry(); + } + + protected int generateCommandId() { + synchronized (commnadIdMutex) { + return lastCommandId++; + } + } + + protected void initialiseRegistry() { + // this kinda wiring muck is soooo much cleaner in C# :( + registry.registerHandler(Message.class, new Handler() { + public void handle(Message event) throws Exception { + onMessage(event); + } + }); + registry.registerHandler(Auth.class, new Handler() { + public void handle(Auth event) throws Exception { + onAuth(event); + } + }); + registry.registerHandler(Starttls.class, new Handler() { + public void handle(Starttls event) throws Exception { + onStarttls(event); + } + }); + registry.registerHandler(Iq.class, new Handler() { + public void handle(Iq event) throws Exception { + onIq(event); + } + }); + registry.registerHandler(Presence.class, new Handler() { + public void handle(Presence event) throws Exception { + onPresence(event); + } + }); + } + + public void onXmppCommand(Object command) throws Exception { + // TODO we could do some nice code generation to boost performance + // by autogenerating the bytecode to statically lookup a handler from a registry maybe? + + Handler handler = registry.getHandler(command.getClass()); + if (handler == null) { + unknownCommand(command); + } + else { + handler.handle(command); + } + } + + public void onActiveMQCommad(Command command) throws Exception { + if (command.isResponse()) { + Response response = (Response) command; + Handler handler = resposeHandlers.remove(new Integer(response.getCorrelationId())); + if (handler != null) { + handler.handle(response); + } + } + else if (command.isMessageDispatch()) { + MessageDispatch md = (MessageDispatch) command; + Handler handler = subscriptionsByConsumerId.get(md.getConsumerId()); + if (handler != null) { + handler.handle(md); + } + } + } + + protected void unknownCommand(Object command) throws Exception { + log.warn("Unkown command: " + command + " of type: " + command.getClass().getName()); + } + + protected void onIq(final Iq iq) throws Exception { + Object any = iq.getAny(); + + if (any instanceof Query) { + Query query = (Query) any; + if (log.isDebugEnabled()) { + log.debug("Iq Auth Query " + debugString(iq) + " resource: " + query.getResource() + " username: " + query.getUsername()); + } + if (query.getPassword() == null) { + Iq result = createResult(iq); + Query required = new Query(); + required.setPassword(""); + required.setUsername(""); + result.setAny(required); + transport.marshall(result); + return; + } + + //connectionInfo.setClientId(query.getResource()); + connectionInfo.setUserName(query.getUsername()); + connectionInfo.setPassword(query.getPassword()); + + // TODO support digest? + + if (connectionInfo.getClientId() == null) { + connectionInfo.setClientId(clientIdGenerator.generateId()); + } + + sendToActiveMQ(connectionInfo, new Handler() { + public void handle(Response response) throws Exception { + + Iq result = createResult(iq); + + if (response instanceof ExceptionResponse) { + ExceptionResponse exceptionResponse = (ExceptionResponse) response; + jabber.client.Error error = new jabber.client.Error(); + result.setError(error); + + StringWriter buffer = new StringWriter(); + exceptionResponse.getException().printStackTrace(new PrintWriter(buffer)); + error.setInternalServerError(buffer.toString()); + } + else { + connected.set(true); + } + transport.marshall(result); + + sendToActiveMQ(sessionInfo, null); + sendToActiveMQ(producerInfo, null); + } + }); + + } + else if (any instanceof jabber.iq._private.Query) { + jabber.iq._private.Query query = (jabber.iq._private.Query) any; + + if (log.isDebugEnabled()) { + log.debug("Iq Private " + debugString(iq) + " any: " + query.getAny()); + } + + Iq result = createResult(iq); + jabber.iq._private.Query answer = new jabber.iq._private.Query(); + result.setAny(answer); + transport.marshall(result); + } + else if (any instanceof jabber.iq.roster.Query) { + jabber.iq.roster.Query query = (jabber.iq.roster.Query) any; + + if (log.isDebugEnabled()) { + log.debug("Iq Roster " + debugString(iq) + " item: " + query.getItem()); + } + + Iq result = createResult(iq); + jabber.iq.roster.Query roster = new jabber.iq.roster.Query(); + result.setAny(roster); + transport.marshall(result); + } + else if (any instanceof org.jabber.protocol.disco_items.Query) { + onDiscoItems(iq, (org.jabber.protocol.disco_items.Query) any); + } + else if (any instanceof org.jabber.protocol.disco_info.Query) { + onDiscoInfo(iq, (org.jabber.protocol.disco_info.Query) any); + } + else { + if (any instanceof Element) { + Element element = (Element) any; + log.warn("Iq Unknown " + debugString(iq) + " element namespace: " + element.getNamespaceURI() + " localName: " + element.getLocalName()); + } + else { + log.warn("Iq Unknown " + debugString(iq) + " any: " + any + " of type: " + any.getClass().getName()); + } + Iq result = createResult(iq); + jabber.client.Error error = new Error(); + error.setUnexpectedRequest("Don't understand: " + any.toString()); + result.setAny(error); + transport.marshall(result); + } + } + + protected String debugString(Iq iq) { + return " to: " + iq.getTo() + " type: " + iq.getType() + " from: " + iq.getFrom() + " id: " + iq.getId(); + } + + protected void onDiscoItems(Iq iq, org.jabber.protocol.disco_items.Query query) throws IOException { + String to = iq.getTo(); + + if (log.isDebugEnabled()) { + log.debug("Iq Disco Items query " + debugString(iq) + " node: " + query.getNode() + " item: " + query.getItem()); + } + + Iq result = createResult(iq); + org.jabber.protocol.disco_items.Query answer = new org.jabber.protocol.disco_items.Query(); + if (to == null || to.length() == 0) { + answer.getItem().add(createItem("queues", "Queues", "queues")); + answer.getItem().add(createItem("topics", "Topics", "topics")); + } + else { + // lets not add anything? + } + + result.setAny(answer); + transport.marshall(result); + } + + protected void onDiscoInfo(Iq iq, org.jabber.protocol.disco_info.Query query) throws IOException { + String to = iq.getTo(); + + // TODO lets create the topic 'to' + + if (log.isDebugEnabled()) { + log.debug("Iq Disco Info query " + debugString(iq) + " node: " + query.getNode() + " features: " + query.getFeature() + " identity: " + query.getIdentity()); + } + + Iq result = createResult(iq); + org.jabber.protocol.disco_info.Query answer = new org.jabber.protocol.disco_info.Query(); + answer.setNode(to); + answer.getFeature().add(createFeature("http://jabber.org/protocol/disco#info")); + answer.getFeature().add(createFeature("http://jabber.org/protocol/disco#items")); + if (to == null || to.length() == 0) { + answer.getIdentity().add(createIdentity("directory", "chatroom", "queues")); + answer.getIdentity().add(createIdentity("directory", "chatroom", "topics")); + /* + answer.getIdentity().add(createIdentity("hierarchy", "queues", "branch")); + answer.getIdentity().add(createIdentity("hierarchy", "topics", "branch")); + */ + } + else { + // for queues/topics + if (to.equals("queues")) { + answer.getIdentity().add(createIdentity("conference", "queue.a", "text")); + answer.getIdentity().add(createIdentity("conference", "queue.b", "text")); + } + else if (to.equals("topics")) { + answer.getIdentity().add(createIdentity("conference", "topic.x", "text")); + answer.getIdentity().add(createIdentity("conference", "topic.y", "text")); + answer.getIdentity().add(createIdentity("conference", "topic.z", "text")); + } + else { + // lets reply to an actual room + answer.getIdentity().add(createIdentity("conference", to, "text")); + answer.getFeature().add(createFeature("http://jabber.org/protocol/muc")); + answer.getFeature().add(createFeature("muc-open")); + } + } + + result.setAny(answer); + transport.marshall(result); + } + + protected void onPresence(Presence presence) throws IOException { + if (log.isDebugEnabled()) { + log.debug("Presence: " + presence.getFrom() + " id: " + presence.getId() + " to: " + presence.getTo() + " type: " + presence.getType() + + " showOrStatusOrPriority: " + presence.getShowOrStatusOrPriority() + " any: " + presence.getAny()); + } + Presence answer = new Presence(); + answer.setFrom(presence.getTo()); + answer.setType(presence.getType()); + answer.setTo(presence.getFrom()); + X x = new X(); + org.jabber.protocol.muc_user.Item item = new org.jabber.protocol.muc_user.Item(); + item.setAffiliation("owner"); + item.setRole("moderator"); + item.setNick("broker"); + x.getDeclineOrDestroyOrInvite().add(item); + answer.getShowOrStatusOrPriority().add(x); + transport.marshall(answer); + } + + + protected Item createItem(String jid, String name, String node) { + Item answer = new Item(); + answer.setJid(jid); + answer.setName(name); + answer.setNode(node); + return answer; + } + + protected Identity createIdentity(String category, String type, String name) { + Identity answer = new Identity(); + answer.setCategory(category); + answer.setName(name); + answer.setType(type); + return answer; + } + + protected Feature createFeature(String var) { + Feature feature = new Feature(); + feature.setVar(var); + return feature; + } + + /** + * Creates a result command from the input + */ + protected Iq createResult(Iq iq) { + Iq result = new Iq(); + result.setId(iq.getId()); + result.setFrom(transport.getFrom()); + result.setTo(iq.getFrom()); + result.setLang(iq.getLang()); + result.setType("result"); + return result; + } + + protected void sendToActiveMQ(Command command, Handler handler) { + command.setCommandId(generateCommandId()); + if (handler != null) { + command.setResponseRequired(true); + resposeHandlers.put(command.getCommandId(), handler); + } + transport.getTransportListener().onCommand(command); + } + + + protected void onStarttls(Starttls starttls) throws Exception { + log.debug("Starttls"); + transport.marshall(new Proceed()); + } + + protected void onMessage(Message message) throws Exception { + if (log.isDebugEnabled()) { + log.debug("Message from: " + message.getFrom() + " to: " + message.getTo() + " subjectOrBodyOrThread: " + message.getSubjectOrBodyOrThread()); + } + + ActiveMQMessage activeMQMessage = createActiveMQMessage(message); + + ActiveMQDestination destination = createActiveMQDestination(message.getTo()); + + activeMQMessage.setMessageId(new MessageId(producerInfo, messageIdGenerator.getNextSequenceId())); + activeMQMessage.setDestination(destination); + addActiveMQMessageHeaders(activeMQMessage, message); + + MessageDispatch dispatch = new MessageDispatch(); + dispatch.setDestination(destination); + dispatch.setMessage(activeMQMessage); + sendToActiveMQ(dispatch, null); + } + + /** + * Converts the Jabber destination name into a destination in ActiveMQ + */ + protected ActiveMQDestination createActiveMQDestination(String jabberDestination) throws JMSException { + if (jabberDestination == null) { + return null; + } + String name = jabberDestination; + int idx = jabberDestination.indexOf('@'); + if (idx > 0) { + name = name.substring(0, idx); + } + return new ActiveMQTopic(name); + } + + protected ActiveMQMessage createActiveMQMessage(Message message) throws JMSException { + ActiveMQTextMessage answer = new ActiveMQTextMessage(); + String text = ""; + List list = message.getSubjectOrBodyOrThread(); + for (Object object : list) { + if (object instanceof Body) { + Body body = (Body) object; + text = body.getValue(); + break; + } + } + answer.setText(text); + return answer; + } + + protected void addActiveMQMessageHeaders(ActiveMQMessage answer, Message message) throws JMSException { + answer.setStringProperty("XMPPFrom", message.getFrom()); + answer.setStringProperty("XMPPID", message.getId()); + answer.setStringProperty("XMPPLang", message.getLang()); + answer.setStringProperty("XMPPTo", message.getTo()); + answer.setJMSType(message.getType()); + answer.setJMSReplyTo(createActiveMQDestination(message.getFrom())); + } + + protected void onAuth(Auth auth) throws Exception { + if (log.isDebugEnabled()) { + log.debug("Auth mechanism: " + auth.getMechanism() + " value: " + auth.getValue()); + } + String value = createChallengeValue(auth); + if (value != null) { + Challenge challenge = new Challenge(); + challenge.setValue(value); + transport.marshall(challenge); + } + else { + transport.marshall(new Success()); + } + } + + protected String createChallengeValue(Auth auth) { + // TODO implement the challenge + return null; + } + +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java new file mode 100644 index 0000000000..265634d655 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java @@ -0,0 +1,291 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import ietf.params.xml.ns.xmpp_sasl.Mechanisms; +import org.apache.activemq.command.BrokerInfo; +import org.apache.activemq.command.Command; +import org.apache.activemq.transport.tcp.TcpBufferedInputStream; +import org.apache.activemq.transport.tcp.TcpBufferedOutputStream; +import org.apache.activemq.transport.tcp.TcpTransport; +import org.apache.activemq.util.IOExceptionSupport; +import org.apache.activemq.util.ServiceStopper; +import org.apache.activemq.wireformat.WireFormat; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jabber.etherx.streams.Features; + +import javax.net.SocketFactory; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; +import javax.xml.stream.Location; +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLOutputFactory; +import javax.xml.stream.XMLReporter; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamWriter; +import javax.xml.stream.events.Attribute; +import javax.xml.stream.events.StartElement; +import javax.xml.stream.events.XMLEvent; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.net.URI; + +/** + * @version $Revision$ + */ +public class XmppTransport extends TcpTransport { + protected static final QName ATTRIBUTE_TO = new QName("to"); + + private static final transient Log log = LogFactory.getLog(XmppTransport.class); + + private JAXBContext context; + private XMLEventReader xmlReader; + private Unmarshaller unmarshaller; + private Marshaller marshaller; + private XMLStreamWriter xmlWriter; + private String to = "client"; + protected OutputStream outputStream; + protected InputStream inputStream; + private ProtocolConverter converter; + private String from; + + public XmppTransport(WireFormat wireFormat, Socket socket) throws IOException { + super(wireFormat, socket); + init(); + } + + public XmppTransport(WireFormat wireFormat, SocketFactory socketFactory, URI uri, URI uri1) throws IOException { + super(wireFormat, socketFactory, uri, uri1); + init(); + } + + private void init() { + converter = new ProtocolConverter(this); + } + + + @Override + public void oneway(Object object) throws IOException { + if (object instanceof Command) { + Command command = (Command) object; + + if (command instanceof BrokerInfo) { + BrokerInfo brokerInfo = (BrokerInfo) command; + + String id = brokerInfo.getBrokerId().toString(); + from = brokerInfo.getBrokerName(); + try { + writeOpenStream(id, from); + + // now lets write the features + Features features = new Features(); + //features.getAny().add(new Starttls()); + Mechanisms mechanisms = new Mechanisms(); + //mechanisms.getMechanism().add("DIGEST-MD5"); + //mechanisms.getMechanism().add("PLAIN"); + features.getAny().add(mechanisms); + marshall(features); + /* + xmlWriter.flush(); + outputStream.flush(); + */ + } + catch (XMLStreamException e) { + throw IOExceptionSupport.create(e); + } + } + else { + try { + converter.onActiveMQCommad(command); + } + catch (IOException e) { + throw e; + } + catch (Exception e) { + throw IOExceptionSupport.create(e); + } + } + } + else { + log.warn("Unkown command: " + object); + } + } + + + /** + * Marshalls the given POJO to the client + */ + public void marshall(Object command) throws IOException { + try { + marshaller.marshal(command, xmlWriter); + xmlWriter.flush(); + } + catch (JAXBException e) { + throw IOExceptionSupport.create(e); + } + catch (XMLStreamException e) { + throw IOExceptionSupport.create(e); + } + } + + @Override + public void run() { + log.debug("XMPP consumer thread starting"); + + try { + XMLInputFactory xif = XMLInputFactory.newInstance(); + xif.setXMLReporter(new XMLReporter() { + public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException { + log.warn(message + " errorType: " + errorType + " relatedInfo: " + relatedInformation); + } + }); + + xmlReader = xif.createXMLEventReader(inputStream); + + XMLEvent docStart = xmlReader.nextEvent(); + + XMLEvent rootElement = xmlReader.nextTag(); + + if (rootElement instanceof StartElement) { + StartElement startElement = (StartElement) rootElement; + Attribute toAttribute = startElement.getAttributeByName(ATTRIBUTE_TO); + if (toAttribute != null) { + to = toAttribute.getValue(); + } + } + while (true) { + if (isStopped()) { + break; + } + + XMLEvent event = xmlReader.peek(); + if (event.isStartElement()) { + // unmarshal a new object + Object object = unmarshaller.unmarshal(xmlReader); + if (object != null) { + converter.onXmppCommand(object); + } + } + else { + if (event.getEventType() == XMLEvent.END_ELEMENT) { + break; + } + else if (event.getEventType() == XMLEvent.END_ELEMENT || event.getEventType() == XMLEvent.END_DOCUMENT) { + break; + } + else { + xmlReader.nextEvent(); + } + + } + } + } + catch (XMLStreamException e) { + log.error("XMPP Reader thread caught: " + e, e); + } + catch (Exception e) { + log.error("XMPP Reader thread caught: " + e, e); + } + try { + stop(); + } + catch (Exception e) { + log.error("Failed to stop XMPP transport: " + e, e); + } + } + + + public String getFrom() { + return from; + } + + @Override + protected void doStop(ServiceStopper stopper) throws Exception { + if (xmlWriter != null) { + try { + xmlWriter.writeEndElement(); + xmlWriter.writeEndDocument(); + xmlWriter.close(); + } + catch (XMLStreamException e) { + // the client may have closed first so ignore this + log.info("Caught trying to close transport: " + e, e); + } + } + if (xmlReader != null) { + try { + xmlReader.close(); + } + catch (XMLStreamException e) { + // the client may have closed first so ignore this + log.info("Caught trying to close transport: " + e, e); + } + } + super.doStop(stopper); + } + + @Override + protected void initializeStreams() throws Exception { + // TODO it would be preferable to use class discovery here! + context = JAXBContext.newInstance("jabber.client" + ":jabber.server" + + ":jabber.iq._private" + ":jabber.iq.auth" + ":jabber.iq.gateway" + ":jabber.iq.last" + ":jabber.iq.oob" + + ":jabber.iq.pass" + ":jabber.iq.roster" + ":jabber.iq.time" + ":jabber.iq.version" + + ":org.jabber.etherx.streams" + ":org.jabber.protocol.activity" + ":org.jabber.protocol.address" + + ":org.jabber.protocol.amp" + ":org.jabber.protocol.amp_errors" + + ":org.jabber.protocol.disco_info" + ":org.jabber.protocol.disco_items" + + ":org.jabber.protocol.muc" + ":org.jabber.protocol.muc_admin" + + ":org.jabber.protocol.muc_unique" + ":org.jabber.protocol.muc_user" + + ":ietf.params.xml.ns.xmpp_sasl" + ":ietf.params.xml.ns.xmpp_stanzas" + + ":ietf.params.xml.ns.xmpp_streams" + ":ietf.params.xml.ns.xmpp_tls"); + + inputStream = new TcpBufferedInputStream(socket.getInputStream(), 8 * 1024); + outputStream = new TcpBufferedOutputStream(socket.getOutputStream(), 16 * 1024); + + unmarshaller = context.createUnmarshaller(); + marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true); + } + + protected void writeOpenStream(String id, String from) throws IOException, XMLStreamException { + XMLOutputFactory factory = XMLOutputFactory.newInstance(); + //factory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); + xmlWriter = factory.createXMLStreamWriter(outputStream); + + // write the dummy start tag + xmlWriter.writeStartDocument(); + xmlWriter.writeStartElement("stream", "stream", "http://etherx.jabber.org/streams"); + xmlWriter.writeDefaultNamespace("jabber:client"); + xmlWriter.writeNamespace("stream", "http://etherx.jabber.org/streams"); + xmlWriter.writeAttribute("version", "1.0"); + xmlWriter.writeAttribute("id", id); + if (to == null) { + to = "client"; + } + xmlWriter.writeAttribute("to", to); + xmlWriter.writeAttribute("from", from); + xmlWriter.writeCharacters("\n"); + } + +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java new file mode 100644 index 0000000000..54a1206338 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java @@ -0,0 +1,57 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import org.apache.activemq.transport.Transport; +import org.apache.activemq.transport.tcp.TcpTransport; +import org.apache.activemq.transport.tcp.TcpTransportFactory; +import org.apache.activemq.transport.tcp.TcpTransportServer; +import org.apache.activemq.wireformat.WireFormat; + +import javax.net.SocketFactory; +import javax.net.ServerSocketFactory; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Map; + +/** + * @version $Revision$ + */ +public class XmppTransportFactory extends TcpTransportFactory { + + protected String getDefaultWireFormatType() { + return "xmpp"; + } + + @Override + public Transport compositeConfigure(Transport transport, WireFormat format, Map options) { + //transport = new StompTransportFilter(transport, new LegacyFrameTranslator()); + return super.compositeConfigure(transport, format, options); + } + + @Override + protected TcpTransport createTcpTransport(WireFormat wf, SocketFactory socketFactory, URI location, URI localLocation) throws IOException { + return new XmppTransport(wf, socketFactory, location, localLocation); + } + + @Override + protected TcpTransportServer createTcpTransportServer(final URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException { + return new XmppTransportServer(this, location, serverSocketFactory); + } +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java new file mode 100644 index 0000000000..f9883cbc85 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java @@ -0,0 +1,44 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import org.apache.activemq.transport.tcp.TcpTransportServer; +import org.apache.activemq.transport.tcp.TcpTransportFactory; +import org.apache.activemq.transport.Transport; +import org.apache.activemq.wireformat.WireFormat; + +import javax.net.ServerSocketFactory; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.Socket; +import java.io.IOException; + +/** + * @version $Revision$ + */ +public class XmppTransportServer extends TcpTransportServer { + + public XmppTransportServer(TcpTransportFactory transportFactory, URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException { + super(transportFactory, location, serverSocketFactory); + } + + @Override + protected Transport createTransport(Socket socket, WireFormat format) throws IOException { + return new XmppTransport(format, socket); + } +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java new file mode 100644 index 0000000000..8cd774d546 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java @@ -0,0 +1,219 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import org.apache.activemq.util.ByteArrayInputStream; +import org.apache.activemq.util.ByteArrayOutputStream; +import org.apache.activemq.util.ByteSequence; +import org.apache.activemq.wireformat.WireFormat; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +/** + * A wire format which uses XMPP format of messages + * + * @version $Revision$ + */ +public class XmppWireFormat implements WireFormat { + private static final Log log = LogFactory.getLog(XmppWireFormat.class); + + private int version = 1; + + public WireFormat copy() { + return new XmppWireFormat(); + } + + /* + public Packet readPacket(DataInput in) throws IOException { + return null; + } + + public Packet readPacket(int firstByte, DataInput in) throws IOException { + return null; + } + + public Packet writePacket(Packet packet, DataOutput out) throws IOException, JMSException { + switch (packet.getPacketType()) { + case Packet.ACTIVEMQ_MESSAGE: + writeMessage((ActiveMQMessage) packet, "", out); + break; + + case Packet.ACTIVEMQ_TEXT_MESSAGE: + writeTextMessage((ActiveMQTextMessage) packet, out); + break; + + case Packet.ACTIVEMQ_BYTES_MESSAGE: + writeBytesMessage((ActiveMQBytesMessage) packet, out); + break; + + case Packet.ACTIVEMQ_OBJECT_MESSAGE: + writeObjectMessage((ActiveMQObjectMessage) packet, out); + break; + + case Packet.ACTIVEMQ_MAP_MESSAGE: + case Packet.ACTIVEMQ_STREAM_MESSAGE: + + + case Packet.ACTIVEMQ_BROKER_INFO: + case Packet.ACTIVEMQ_CONNECTION_INFO: + case Packet.ACTIVEMQ_MSG_ACK: + case Packet.CONSUMER_INFO: + case Packet.DURABLE_UNSUBSCRIBE: + case Packet.INT_RESPONSE_RECEIPT_INFO: + case Packet.PRODUCER_INFO: + case Packet.RECEIPT_INFO: + case Packet.RESPONSE_RECEIPT_INFO: + case Packet.SESSION_INFO: + case Packet.TRANSACTION_INFO: + case Packet.XA_TRANSACTION_INFO: + default: + log.warn("Ignoring message type: " + packet.getPacketType() + " packet: " + packet); + } + return null; + } +*/ + +// /** +// * Can this wireformat process packets of this version +// * @param version the version number to test +// * @return true if can accept the version +// */ +// public boolean canProcessWireFormatVersion(int version){ +// return true; +// } +// +// /** +// * @return the current version of this wire format +// */ +// public int getCurrentWireFormatVersion(){ +// return 1; +// } +// +// // Implementation methods +// //------------------------------------------------------------------------- +// protected void writeObjectMessage(ActiveMQObjectMessage message, DataOutput out) throws JMSException, IOException { +// Serializable object = message.getObject(); +// String text = (object != null) ? object.toString() : ""; +// writeMessage(message, text, out); +// } +// +// protected void writeTextMessage(ActiveMQTextMessage message, DataOutput out) throws JMSException, IOException { +// writeMessage(message, message.getText(), out); +// } +// +// protected void writeBytesMessage(ActiveMQBytesMessage message, DataOutput out) throws IOException { +// ByteArray data = message.getBodyAsBytes(); +// String text = encodeBinary(data.getBuf(),data.getOffset(),data.getLength()); +// writeMessage(message, text, out); +// } +// +// protected void writeMessage(ActiveMQMessage message, String body, DataOutput out) throws IOException { +// String type = getXmppType(message); +// +// StringBuffer buffer = new StringBuffer("<"); +// buffer.append(type); +// buffer.append(" to='"); +// buffer.append(message.getJMSDestination().toString()); +// buffer.append("' from='"); +// buffer.append(message.getJMSReplyTo().toString()); +// String messageID = message.getJMSMessageID(); +// if (messageID != null) { +// buffer.append("' id='"); +// buffer.append(messageID); +// } +// +// HashMap properties = message.getProperties(); +// if (properties != null) { +// for (Iterator iter = properties.entrySet().iterator(); iter.hasNext();) { +// Map.Entry entry = (Map.Entry) iter.next(); +// Object key = entry.getKey(); +// Object value = entry.getValue(); +// if (value != null) { +// buffer.append("' "); +// buffer.append(key.toString()); +// buffer.append("='"); +// buffer.append(value.toString()); +// } +// } +// } +// +// buffer.append("'>"); +// +// String id = message.getJMSCorrelationID(); +// if (id != null) { +// buffer.append(""); +// buffer.append(id); +// buffer.append(""); +// } +// buffer.append(body); +// buffer.append(""); +// +// out.write(buffer.toString().getBytes()); +// } +// +// protected String encodeBinary(byte[] data,int offset,int length) { +// // TODO +// throw new RuntimeException("Not implemented yet!"); +// } +// +// protected String getXmppType(ActiveMQMessage message) { +// String type = message.getJMSType(); +// if (type == null) { +// type = "message"; +// } +// return type; +// } + + + public ByteSequence marshal(Object command) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + DataOutputStream dos = new DataOutputStream(baos); + marshal(command, dos); + dos.close(); + return baos.toByteSequence(); + } + + public Object unmarshal(ByteSequence packet) throws IOException { + ByteArrayInputStream stream = new ByteArrayInputStream(packet); + DataInputStream dis = new DataInputStream(stream); + return unmarshal(dis); + } + + public void marshal(Object object, DataOutputStream dataOutputStream) throws IOException { + /** TODO */ + } + + public Object unmarshal(DataInputStream dataInputStream) throws IOException { + return null; /** TODO */ + } + + + public int getVersion() { + return version; + } + + public void setVersion(int version) { + this.version = version; + } +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java new file mode 100644 index 0000000000..3becb11fed --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java @@ -0,0 +1,30 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import org.apache.activemq.wireformat.WireFormat; +import org.apache.activemq.wireformat.WireFormatFactory; + +/** + * @version $Revision$ + */ +public class XmppWireFormatFactory implements WireFormatFactory { + public WireFormat createWireFormat() { + return new XmppWireFormat(); + } +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java new file mode 100644 index 0000000000..837fe8d860 --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java @@ -0,0 +1,27 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp.command; + +/** + * Represents a handler of a type of event + * + * @version $Revision$ + */ +public interface Handler { + void handle(T event) throws Exception; +} diff --git a/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java new file mode 100644 index 0000000000..4817f82eff --- /dev/null +++ b/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java @@ -0,0 +1,42 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp.command; + +import java.util.HashMap; +import java.util.Map; + +/** + * A registry of handlers + * + * @version $Revision$ + */ +public class HandlerRegistry { + private Map map = new HashMap(); + + public Handler getHandler(Class eventType) { + synchronized (map) { + return map.get(eventType); + } + } + + public void registerHandler(Class eventType, Handler handler) { + synchronized (map) { + map.put(eventType, handler); + } + } +} diff --git a/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp b/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp new file mode 100644 index 0000000000..c4b2cd891d --- /dev/null +++ b/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp @@ -0,0 +1 @@ +class=org.apache.activemq.transport.xmpp.XmppTransportFactory diff --git a/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp b/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp new file mode 100644 index 0000000000..b02ee4a127 --- /dev/null +++ b/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp @@ -0,0 +1 @@ +class=org.apache.activemq.transport.xmpp.XmppWireFormatFactory diff --git a/activemq-xmpp/src/main/resources/activity.xsd b/activemq-xmpp/src/main/resources/activity.xsd new file mode 100644 index 0000000000..f01f1eff58 --- /dev/null +++ b/activemq-xmpp/src/main/resources/activity.xsd @@ -0,0 +1,111 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0108: http://www.jabber.org/jeps/jep-0108.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/address.xsd b/activemq-xmpp/src/main/resources/address.xsd new file mode 100644 index 0000000000..d39f678d52 --- /dev/null +++ b/activemq-xmpp/src/main/resources/address.xsd @@ -0,0 +1,58 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0033: http://www.jabber.org/jeps/jep-0033.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/amp-errors.xsd b/activemq-xmpp/src/main/resources/amp-errors.xsd new file mode 100644 index 0000000000..af2c82b4d4 --- /dev/null +++ b/activemq-xmpp/src/main/resources/amp-errors.xsd @@ -0,0 +1,32 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0079: http://www.jabber.org/jeps/jep-0079.html + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/amp-feature.xsd b/activemq-xmpp/src/main/resources/amp-feature.xsd new file mode 100644 index 0000000000..3fc562a772 --- /dev/null +++ b/activemq-xmpp/src/main/resources/amp-feature.xsd @@ -0,0 +1,24 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0079: http://www.jabber.org/jeps/jep-0079.html + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/amp.xsd b/activemq-xmpp/src/main/resources/amp.xsd new file mode 100644 index 0000000000..bfb583882c --- /dev/null +++ b/activemq-xmpp/src/main/resources/amp.xsd @@ -0,0 +1,60 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0079: http://www.jabber.org/jeps/jep-0079.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/dialback.xsd b/activemq-xmpp/src/main/resources/dialback.xsd new file mode 100755 index 0000000000..3a873dfe3c --- /dev/null +++ b/activemq-xmpp/src/main/resources/dialback.xsd @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/disco-info.xsd b/activemq-xmpp/src/main/resources/disco-info.xsd new file mode 100644 index 0000000000..b7498565e2 --- /dev/null +++ b/activemq-xmpp/src/main/resources/disco-info.xsd @@ -0,0 +1,54 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0030: http://www.jabber.org/jeps/jep-0030.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/disco-items.xsd b/activemq-xmpp/src/main/resources/disco-items.xsd new file mode 100644 index 0000000000..636aa8177b --- /dev/null +++ b/activemq-xmpp/src/main/resources/disco-items.xsd @@ -0,0 +1,51 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0030: http://www.jabber.org/jeps/jep-0030.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-auth.xsd b/activemq-xmpp/src/main/resources/iq-auth.xsd new file mode 100644 index 0000000000..1a5ef91088 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-auth.xsd @@ -0,0 +1,29 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0078: http://www.jabber.org/jeps/jep-0078.html + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-gateway.xsd b/activemq-xmpp/src/main/resources/iq-gateway.xsd new file mode 100644 index 0000000000..c8f7af3c8c --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-gateway.xsd @@ -0,0 +1,28 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0100: http://www.jabber.org/jeps/jep-0100.html + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-last.xsd b/activemq-xmpp/src/main/resources/iq-last.xsd new file mode 100644 index 0000000000..540b55b260 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-last.xsd @@ -0,0 +1,26 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0012: http://www.jabber.org/jeps/jep-0012.html + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-oob.xsd b/activemq-xmpp/src/main/resources/iq-oob.xsd new file mode 100644 index 0000000000..713c6c8eb6 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-oob.xsd @@ -0,0 +1,26 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0066: http://www.jabber.org/jeps/jep-0066.html + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-pass.xsd b/activemq-xmpp/src/main/resources/iq-pass.xsd new file mode 100644 index 0000000000..e23015f4c9 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-pass.xsd @@ -0,0 +1,43 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0003: http://www.jabber.org/jeps/jep-0003.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-private.xsd b/activemq-xmpp/src/main/resources/iq-private.xsd new file mode 100644 index 0000000000..886901d916 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-private.xsd @@ -0,0 +1,24 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0049: http://www.jabber.org/jeps/jep-0049.html + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-time.xsd b/activemq-xmpp/src/main/resources/iq-time.xsd new file mode 100644 index 0000000000..fcb259501c --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-time.xsd @@ -0,0 +1,26 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0090: http://www.jabber.org/jeps/jep-0090.html + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/iq-version.xsd b/activemq-xmpp/src/main/resources/iq-version.xsd new file mode 100644 index 0000000000..2c3c6e92d5 --- /dev/null +++ b/activemq-xmpp/src/main/resources/iq-version.xsd @@ -0,0 +1,26 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0092: http://www.jabber.org/jeps/jep-0092.html + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/jabber-client.xsd b/activemq-xmpp/src/main/resources/jabber-client.xsd new file mode 100755 index 0000000000..3644c61df6 --- /dev/null +++ b/activemq-xmpp/src/main/resources/jabber-client.xsd @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/jabber-server.xsd b/activemq-xmpp/src/main/resources/jabber-server.xsd new file mode 100755 index 0000000000..94b95d310b --- /dev/null +++ b/activemq-xmpp/src/main/resources/jabber-server.xsd @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/muc-admin.xsd b/activemq-xmpp/src/main/resources/muc-admin.xsd new file mode 100644 index 0000000000..9c141b14d0 --- /dev/null +++ b/activemq-xmpp/src/main/resources/muc-admin.xsd @@ -0,0 +1,74 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0045: http://www.jabber.org/jeps/jep-0045.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/muc-unique.xsd b/activemq-xmpp/src/main/resources/muc-unique.xsd new file mode 100644 index 0000000000..121d7cf553 --- /dev/null +++ b/activemq-xmpp/src/main/resources/muc-unique.xsd @@ -0,0 +1,18 @@ + + + + + + + The protocol documented by this schema is defined in + XEP-0045: http://www.xmpp.org/extensions/xep-0045.html + + + + + + diff --git a/activemq-xmpp/src/main/resources/muc-user.xsd b/activemq-xmpp/src/main/resources/muc-user.xsd new file mode 100644 index 0000000000..99ddc7f27b --- /dev/null +++ b/activemq-xmpp/src/main/resources/muc-user.xsd @@ -0,0 +1,121 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0045: http://www.jabber.org/jeps/jep-0045.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/muc.xsd b/activemq-xmpp/src/main/resources/muc.xsd new file mode 100644 index 0000000000..89f463ffa3 --- /dev/null +++ b/activemq-xmpp/src/main/resources/muc.xsd @@ -0,0 +1,44 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0045: http://www.jabber.org/jeps/jep-0045.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/roster.xsd b/activemq-xmpp/src/main/resources/roster.xsd new file mode 100755 index 0000000000..bf85745551 --- /dev/null +++ b/activemq-xmpp/src/main/resources/roster.xsd @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/rosternotes.xsd b/activemq-xmpp/src/main/resources/rosternotes.xsd new file mode 100644 index 0000000000..2100219ab8 --- /dev/null +++ b/activemq-xmpp/src/main/resources/rosternotes.xsd @@ -0,0 +1,36 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0045: http://www.jabber.org/jeps/jep-0045.html + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/rosterx.xsd b/activemq-xmpp/src/main/resources/rosterx.xsd new file mode 100644 index 0000000000..27ef4c40df --- /dev/null +++ b/activemq-xmpp/src/main/resources/rosterx.xsd @@ -0,0 +1,43 @@ + + + + + + + The protocol documented by this schema is defined in + JEP-0144: http://www.jabber.org/jeps/jep-0144.html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/sasl.xsd b/activemq-xmpp/src/main/resources/sasl.xsd new file mode 100755 index 0000000000..e201299dda --- /dev/null +++ b/activemq-xmpp/src/main/resources/sasl.xsd @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/session.xsd b/activemq-xmpp/src/main/resources/session.xsd new file mode 100755 index 0000000000..30b147ad4d --- /dev/null +++ b/activemq-xmpp/src/main/resources/session.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/stanzaerror.xsd b/activemq-xmpp/src/main/resources/stanzaerror.xsd new file mode 100755 index 0000000000..fcbc4ede60 --- /dev/null +++ b/activemq-xmpp/src/main/resources/stanzaerror.xsd @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/streamerror.xsd b/activemq-xmpp/src/main/resources/streamerror.xsd new file mode 100755 index 0000000000..daeae21394 --- /dev/null +++ b/activemq-xmpp/src/main/resources/streamerror.xsd @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/streams.xsd b/activemq-xmpp/src/main/resources/streams.xsd new file mode 100755 index 0000000000..d30041eee7 --- /dev/null +++ b/activemq-xmpp/src/main/resources/streams.xsd @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/tls.xsd b/activemq-xmpp/src/main/resources/tls.xsd new file mode 100755 index 0000000000..fd0a36d921 --- /dev/null +++ b/activemq-xmpp/src/main/resources/tls.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/activemq-xmpp/src/main/resources/xml.xsd b/activemq-xmpp/src/main/resources/xml.xsd new file mode 100644 index 0000000000..7a9139f609 --- /dev/null +++ b/activemq-xmpp/src/main/resources/xml.xsd @@ -0,0 +1,149 @@ + + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + The xml:id specification is not yet a W3C Recommendation, + but this attribute is included here to facilitate experimentation + with the mechanisms it proposes. Note that it is _not_ included + in the specialAttrs attribute group. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang or xml:space attributes + on elements they define. + + To enable this, such a schema must import this schema + for the XML namespace, e.g. as follows: + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> + + Subsequently, qualified reference to any of the attributes + or the group defined below will have the desired effect, e.g. + + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + + will define a type which will schema-validate an instance + element with any of those attributes + + + + + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + http://www.w3.org/2004/10/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2004/10/xml.xsd will not change. + + + + + + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + + See http://www.w3.org/TR/xml-id/ for + information about this attribute. + + + + + + + + + + + diff --git a/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppBroker.java b/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppBroker.java new file mode 100644 index 0000000000..f1c4a5bcec --- /dev/null +++ b/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppBroker.java @@ -0,0 +1,53 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import org.apache.activemq.Service; +import org.apache.activemq.broker.BrokerService; + +/** + * @version $Revision$ + */ +public class XmppBroker implements Service { + private BrokerService broker = new BrokerService(); + + public static void main(String[] args) { + try { + XmppBroker broker = new XmppBroker(); + broker.start(); + + System.out.println("Press any key to terminate"); + System.in.read(); + } + catch (Exception e) { + System.out.println("Caught: " + e); + e.printStackTrace(); + } + } + + public void start() throws Exception { + broker.setPersistent(false); + broker.setUseJmx(false); + broker.addConnector("xmpp://localhost:61222"); + broker.start(); + } + + public void stop() throws Exception { + broker.stop(); + } +} diff --git a/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppTest.java b/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppTest.java new file mode 100644 index 0000000000..b7cc409302 --- /dev/null +++ b/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppTest.java @@ -0,0 +1,72 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.apache.activemq.transport.xmpp; + +import junit.framework.TestCase; +import org.jivesoftware.smack.Chat; +import org.jivesoftware.smack.XMPPException; +import org.jivesoftware.smack.XMPPConnection; + +/** + * @version $Revision$ + */ +public class XmppTest extends TestCase { + + private XmppBroker broker = new XmppBroker(); + private boolean block = true; + + public void testConnect() throws Exception { + //ConnectionConfiguration config = new ConnectionConfiguration("localhost", 61222); + //config.setDebuggerEnabled(true); + + try { + //SmackConfiguration.setPacketReplyTimeout(1000); + //XMPPConnection con = new XMPPConnection(config); + XMPPConnection con = new XMPPConnection("localhost", 61222); + con.login("amq-user", "amq-pwd"); + Chat chat = con.createChat("test@localhost"); + for (int i = 0; i < 10; i++) { + System.out.println("Sending message: " + i); + chat.sendMessage("Hello from Message: " + i); + } + System.out.println("Sent all messages!"); + } + catch (XMPPException e) { + System.out.println("Caught: " + e); + e.printStackTrace(); + } + if (block) { + Thread.sleep(20000); + System.out.println("Press any key to quit!: "); + System.in.read(); + } + System.out.println("Done!"); + } + + + @Override + protected void setUp() throws Exception { + broker.start(); + } + + + @Override + protected void tearDown() throws Exception { + broker.stop(); + } +} diff --git a/activemq-xmpp/src/test/resources/example-xmpp.xml b/activemq-xmpp/src/test/resources/example-xmpp.xml new file mode 100644 index 0000000000..76ee078d76 --- /dev/null +++ b/activemq-xmpp/src/test/resources/example-xmpp.xml @@ -0,0 +1,12 @@ + + + + + Hello world! + + + diff --git a/activemq-xmpp/src/test/resources/log4j.properties b/activemq-xmpp/src/test/resources/log4j.properties new file mode 100644 index 0000000000..15ad2524dd --- /dev/null +++ b/activemq-xmpp/src/test/resources/log4j.properties @@ -0,0 +1,29 @@ +## ------------------------------------------------------------------------ +## Licensed to the Apache Software Foundation (ASF) under one or more +## contributor license agreements. See the NOTICE file distributed with +## this work for additional information regarding copyright ownership. +## The ASF licenses this file to You 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. +## ------------------------------------------------------------------------ + +# +# The logging properties used for eclipse testing, We want to see debug output on the console. +# +log4j.rootLogger=INFO, out + +log4j.logger.org.apache.activemq=DEBUG + +# CONSOLE appender not used by default +log4j.appender.out=org.apache.log4j.ConsoleAppender +log4j.appender.out.layout=org.apache.log4j.PatternLayout +log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n +#log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n