You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by js...@apache.org on 2006/10/24 18:48:25 UTC
svn commit: r467379 [1/2] - in /incubator/activemq/sandbox/activemq-xmpp: ./
src/main/excluded-schemas/ src/main/java/org/apache/activemq/transport/xmpp/
src/main/java/org/apache/activemq/transport/xmpp/command/
src/main/resources/ src/main/resources/M...
Author: jstrachan
Date: Tue Oct 24 09:48:24 2006
New Revision: 467379
URL: http://svn.apache.org/viewvc?view=rev&rev=467379
Log:
added basic support for XMPP for non-SASL based authentication and sending messages from XMPP into ActiveMQ
Added:
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-version.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/roster.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/rosternotes.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/rosterx.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/session.xsd (with props)
incubator/activemq/sandbox/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppBroker.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/test/java/org/apache/activemq/transport/xmpp/XmppTest.java (with props)
incubator/activemq/sandbox/activemq-xmpp/src/test/resources/
incubator/activemq/sandbox/activemq-xmpp/src/test/resources/example-xmpp.xml (with props)
incubator/activemq/sandbox/activemq-xmpp/src/test/resources/log4j.properties (with props)
Modified:
incubator/activemq/sandbox/activemq-xmpp/pom.xml
incubator/activemq/sandbox/activemq-xmpp/src/main/excluded-schemas/x-data.xsd
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/sasl.xsd
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/streams.xsd
incubator/activemq/sandbox/activemq-xmpp/src/main/resources/tls.xsd
Modified: incubator/activemq/sandbox/activemq-xmpp/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/pom.xml?view=diff&rev=467379&r1=467378&r2=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/pom.xml (original)
+++ incubator/activemq/sandbox/activemq-xmpp/pom.xml Tue Oct 24 09:48:24 2006
@@ -36,6 +36,11 @@
<repositories>
<repository>
+ <id>codehaus</id>
+ <name>Codehaus Maven 2 Repository</name>
+ <url>https://repository.codehaus.org/</url>
+ </repository>
+ <repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Maven 2 Repository</name>
<url>https://maven2-repository.dev.java.net/nonav/repository</url>
@@ -80,32 +85,80 @@
</dependency>
<dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax</artifactId>
+ <scope>runtime</scope>
+ <optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xmlbeans-jsr173-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+
+ <dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.0.2</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml</groupId>
+ <artifactId>jsr173</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.jws</groupId>
+ <artifactId>jsr181-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml</groupId>
+ <artifactId>jsr173</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
+
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring</artifactId>
+ <groupId>org.codehaus.woodstox</groupId>
+ <!--<groupId>woodstox</groupId>-->
+ <artifactId>wstx-asl</artifactId>
+ <version>3.0.1</version>
+ <!--<version>3.1-rc1</version>-->
</dependency>
+
<dependency>
- <groupId>aopalliance</groupId>
- <artifactId>aopalliance</artifactId>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0</version>
</dependency>
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smack</artifactId>
<version>1.5.0</version>
+ <!--<version>2.2.1</version>-->
<scope>test</scope>
</dependency>
<dependency>
<groupId>jivesoftware</groupId>
<artifactId>smackx</artifactId>
<version>1.5.0</version>
- <scope>test</scope>
+ <!--<version>2.2.1</version>-->
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
@@ -128,12 +181,11 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <!--
<includes>
- <include>**/Nothing</include>
- <!--
<include>**/*Test.*</include>
- -->
</includes>
+ -->
<excludes>
</excludes>
</configuration>
@@ -152,7 +204,12 @@
<configuration>
<strict>false</strict>
<verbose>false</verbose>
- <!-- ??
+ <!--
+ <args>
+ <arg>-XtoString</arg>
+ <arg>-Xequals</arg>
+ <arg>-XhashCode</arg>
+ </args>
<schemasExcludes>
<exclude>delimiter.xsd</exclude>
</schemasExcludes>
Modified: incubator/activemq/sandbox/activemq-xmpp/src/main/excluded-schemas/x-data.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/excluded-schemas/x-data.xsd?view=diff&rev=467379&r1=467378&r2=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/excluded-schemas/x-data.xsd (original)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/excluded-schemas/x-data.xsd Tue Oct 24 09:48:24 2006
@@ -84,12 +84,14 @@
<xs:element ref='field' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
+ <!--
<xs:annotation>
<xs:documentation>
When contained in a "reported" element, the "field" element
SHOULD NOT contain a "value" child.
</xs:documentation>
</xs:annotation>
+ -->
</xs:element>
<xs:element name='item'>
@@ -98,6 +100,7 @@
<xs:element ref='field' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
+ </xs:element>
<xs:simpleType name='empty'>
<xs:restriction base='xs:string'>
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java Tue Oct 24 09:48:24 2006
@@ -0,0 +1,312 @@
+/**
+ *
+ * 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.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 javax.jms.JMSException;
+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<Integer, Handler<Response>> resposeHandlers = new ConcurrentHashMap<Integer, Handler<Response>>();
+ private final Map<ConsumerId, Handler<MessageDispatch>> subscriptionsByConsumerId = new ConcurrentHashMap<ConsumerId, Handler<MessageDispatch>>();
+ 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<Message>() {
+ public void handle(Message event) throws Exception {
+ onMessage(event);
+ }
+ });
+ registry.registerHandler(Auth.class, new Handler<Auth>() {
+ public void handle(Auth event) throws Exception {
+ onAuth(event);
+ }
+ });
+ registry.registerHandler(Starttls.class, new Handler<Starttls>() {
+ public void handle(Starttls event) throws Exception {
+ onStarttls(event);
+ }
+ });
+ registry.registerHandler(Iq.class, new Handler<Iq>() {
+ public void handle(Iq event) throws Exception {
+ onIq(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<Response> handler = resposeHandlers.remove(new Integer(response.getCorrelationId()));
+ if (handler != null) {
+ handler.handle(response);
+ }
+ }
+ else if (command.isMessageDispatch()) {
+ MessageDispatch md = (MessageDispatch) command;
+ Handler<MessageDispatch> 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 (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<Response>() {
+ 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 {
+ Iq result = createResult(iq);
+ jabber.client.Error error = new Error();
+ error.setUnexpectedRequest("Don't understand: " + any.toString());
+ result.setAny(error);
+ transport.marshall(result);
+ }
+ }
+
+ /**
+ * 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<Response> 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<Object> 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;
+ }
+
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/ProtocolConverter.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java Tue Oct 24 09:48:24 2006
@@ -0,0 +1,286 @@
+/**
+ *
+ * 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.trace("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"
+ + ":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");
+ }
+
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransport.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java Tue Oct 24 09:48:24 2006
@@ -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);
+ }
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java Tue Oct 24 09:48:24 2006
@@ -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);
+ }
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppTransportServer.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java Tue Oct 24 09:48:24 2006
@@ -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("<thread>");
+// buffer.append(id);
+// buffer.append("</thread>");
+// }
+// buffer.append(body);
+// buffer.append("</");
+// buffer.append(type);
+// 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;
+ }
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormat.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java Tue Oct 24 09:48:24 2006
@@ -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();
+ }
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/XmppWireFormatFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java Tue Oct 24 09:48:24 2006
@@ -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<T> {
+ void handle(T event) throws Exception;
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/Handler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java Tue Oct 24 09:48:24 2006
@@ -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<Class, Handler> map = new HashMap<Class, Handler>();
+
+ public Handler getHandler(Class eventType) {
+ synchronized (map) {
+ return map.get(eventType);
+ }
+ }
+
+ public void registerHandler(Class eventType, Handler handler) {
+ synchronized (map) {
+ map.put(eventType, handler);
+ }
+ }
+}
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/java/org/apache/activemq/transport/xmpp/command/HandlerRegistry.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/transport/xmpp Tue Oct 24 09:48:24 2006
@@ -0,0 +1 @@
+class=org.apache.activemq.transport.xmpp.XmppTransportFactory
Modified: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp?view=diff&rev=467379&r1=467378&r2=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp (original)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/META-INF/services/org/apache/activemq/wireformat/xmpp Tue Oct 24 09:48:24 2006
@@ -1 +1 @@
-class=org.apache.activemq.transport.xmpp.XMPPWireFormatFactory
+class=org.apache.activemq.transport.xmpp.XmppWireFormatFactory
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,111 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://jabber.org/protocol/activity'
+ xmlns='http://jabber.org/protocol/activity'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0108: http://www.jabber.org/jeps/jep-0108.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='activity'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name='doing_chores' type='general'/>
+ <xs:element name='drinking' type='general'/>
+ <xs:element name='eating' type='general'/>
+ <xs:element name='exercising' type='general'/>
+ <xs:element name='grooming' type='general'/>
+ <xs:element name='having_appointment' type='general'/>
+ <xs:element name='inactive' type='general'/>
+ <xs:element name='relaxing' type='general'/>
+ <xs:element name='talking' type='general'/>
+ <xs:element name='traveling' type='general'/>
+ <xs:element name='working' type='general'/>
+ </xs:choice>
+ <xs:element name='text' minOccurs='0' type='xs:string'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name='general'>
+ <xs:choice minOccurs='0'>
+ <xs:choice minOccurs='0'>
+ <xs:element name='at_the_spa' type='specific'/>
+ <xs:element name='brushing_teeth' type='specific'/>
+ <xs:element name='buying_groceries' type='specific'/>
+ <xs:element name='cleaning' type='specific'/>
+ <xs:element name='coding' type='specific'/>
+ <xs:element name='commuting' type='specific'/>
+ <xs:element name='cooking' type='specific'/>
+ <xs:element name='cycling' type='specific'/>
+ <xs:element name='day_off' type='specific'/>
+ <xs:element name='doing_maintenance' type='specific'/>
+ <xs:element name='doing_the_dishes' type='specific'/>
+ <xs:element name='doing_the_laundry' type='specific'/>
+ <xs:element name='driving' type='specific'/>
+ <xs:element name='gaming' type='specific'/>
+ <xs:element name='gardening' type='specific'/>
+ <xs:element name='getting_a_haircut' type='specific'/>
+ <xs:element name='going_out' type='specific'/>
+ <xs:element name='hanging_out' type='specific'/>
+ <xs:element name='having_a_beer' type='specific'/>
+ <xs:element name='having_a_snack' type='specific'/>
+ <xs:element name='having_breakfast' type='specific'/>
+ <xs:element name='having_coffee' type='specific'/>
+ <xs:element name='having_dinner' type='specific'/>
+ <xs:element name='having_lunch' type='specific'/>
+ <xs:element name='having_tea' type='specific'/>
+ <xs:element name='hiking' type='specific'/>
+ <xs:element name='in_a_car' type='specific'/>
+ <xs:element name='in_a_meeting' type='specific'/>
+ <xs:element name='in_real_life' type='specific'/>
+ <xs:element name='jogging' type='specific'/>
+ <xs:element name='on_a_bus' type='specific'/>
+ <xs:element name='on_a_plane' type='specific'/>
+ <xs:element name='on_a_train' type='specific'/>
+ <xs:element name='on_a_trip' type='specific'/>
+ <xs:element name='on_the_phone' type='specific'/>
+ <xs:element name='on_vacation' type='specific'/>
+ <xs:element name='other' type='specific'/>
+ <xs:element name='partying' type='specific'/>
+ <xs:element name='playing_sports' type='specific'/>
+ <xs:element name='reading' type='specific'/>
+ <xs:element name='rehearsing' type='specific'/>
+ <xs:element name='running' type='specific'/>
+ <xs:element name='running_an_errand' type='specific'/>
+ <xs:element name='scheduled_holiday' type='specific'/>
+ <xs:element name='shaving' type='specific'/>
+ <xs:element name='shopping' type='specific'/>
+ <xs:element name='skiing' type='specific'/>
+ <xs:element name='sleeping' type='specific'/>
+ <xs:element name='socializing' type='specific'/>
+ <xs:element name='studying' type='specific'/>
+ <xs:element name='sunbathing' type='specific'/>
+ <xs:element name='swimming' type='specific'/>
+ <xs:element name='taking_a_bath' type='specific'/>
+ <xs:element name='taking_a_shower' type='specific'/>
+ <xs:element name='walking' type='specific'/>
+ <xs:element name='walking_the_dog' type='specific'/>
+ <xs:element name='watching_tv' type='specific'/>
+ <xs:element name='watching_a_movie' type='specific'/>
+ <xs:element name='working_out' type='specific'/>
+ <xs:element name='writing' type='specific'/>
+ </xs:choice>
+ <xs:any namespace='##other'/>
+ </xs:choice>
+ </xs:complexType>
+
+ <xs:complexType name='specific'>
+ <xs:sequence minOccurs='0'>
+ <xs:any namespace='##other'/>
+ </xs:sequence>
+ </xs:complexType>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/activity.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://jabber.org/protocol/address'
+ xmlns='http://jabber.org/protocol/address'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0033: http://www.jabber.org/jeps/jep-0033.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='addresses'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='address'
+ minOccurs='1'
+ maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='address'>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base='empty'>
+ <xs:attribute name='delivered' use='optional' fixed='true'/>
+ <xs:attribute name='desc' use='optional' type='xs:string'/>
+ <xs:attribute name='jid' use='optional' type='xs:string'/>
+ <xs:attribute name='node' use='optional' type='xs:string'/>
+ <xs:attribute name='type' use='required'>
+ <xs:simpleType>
+ <xs:restriction base='xs:NCName'>
+ <xs:enumeration value='bcc'/>
+ <xs:enumeration value='cc'/>
+ <xs:enumeration value='noreply'/>
+ <xs:enumeration value='replyroom'/>
+ <xs:enumeration value='replyto'/>
+ <xs:enumeration value='to'/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name='uri' use='optional' type='xs:string'/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name='empty'>
+ <xs:restriction base='xs:string'>
+ <xs:enumeration value=''/>
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/address.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,32 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://jabber.org/protocol/amp#errors'
+ xmlns='http://jabber.org/protocol/amp#errors'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0079: http://www.jabber.org/jeps/jep-0079.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='failed-rules'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='rule' minOccurs='1' maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='rule'>
+ <xs:complexType>
+ <xs:attribute name='action' use='required' type='xs:NCName'/>
+ <xs:attribute name='condition' use='required' type='xs:NCName'/>
+ <xs:attribute name='value' use='required' type='xs:string'/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-errors.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://jabber.org/features/amp'
+ xmlns='http://jabber.org/features/amp'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0079: http://www.jabber.org/jeps/jep-0079.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='amp' type='empty'/>
+
+ <xs:simpleType name='empty'>
+ <xs:restriction base='xs:string'>
+ <xs:enumeration value=''/>
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp-feature.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,60 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='http://jabber.org/protocol/amp'
+ xmlns='http://jabber.org/protocol/amp'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0079: http://www.jabber.org/jeps/jep-0079.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='amp'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='rule' minOccurs='1' maxOccurs='unbounded'/>
+ </xs:sequence>
+ <xs:attribute name='from' usage='optional' type='xs:string'/>
+ <xs:attribute name='per-hop' use='optional' type='xs:boolean' default='false'/>
+ <xs:attribute name='status' usage='optional' type='xs:NCName'/>
+ <xs:attribute name='to' usage='optional' type='xs:string'/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='invalid-rules'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='rule' minOccurs='1' maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='unsupported-actions'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='rule' minOccurs='1' maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='unsupported-conditions'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element ref='rule' minOccurs='1' maxOccurs='unbounded'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name='rule'>
+ <xs:complexType>
+ <xs:attribute name='action' use='required' type='xs:NCName'/>
+ <xs:attribute name='condition' use='required' type='xs:NCName'/>
+ <xs:attribute name='value' use='required' type='xs:string'/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/amp.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,29 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:auth'
+ xmlns='jabber:iq:auth'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0078: http://www.jabber.org/jeps/jep-0078.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name='username' type='xs:string' minOccurs='0'/>
+ <xs:choice>
+ <xs:element name='password' type='xs:string' minOccurs='0'/>
+ <xs:element name='digest' type='xs:string' minOccurs='0'/>
+ </xs:choice>
+ <xs:element name='resource' type='xs:string' minOccurs='0'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-auth.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:gateway'
+ xmlns='jabber:iq:gateway'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0100: http://www.jabber.org/jeps/jep-0100.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:choice>
+ <xs:sequence>
+ <xs:element name='desc' minOccurs='0' type='xs:string'/>
+ <xs:element name='prompt' type='xs:string'/>
+ </xs:sequence>
+ <xs:element name='jid' type='xs:string'/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-gateway.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:last'
+ xmlns='jabber:iq:last'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0012: http://www.jabber.org/jeps/jep-0012.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base='xs:string'>
+ <xs:attribute name='seconds' type='xs:unsignedLong' use='optional'/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-last.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:oob'
+ xmlns='jabber:iq:oob'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0066: http://www.jabber.org/jeps/jep-0066.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name='url' type='xs:string' minOccurs='1'/>
+ <xs:element name='desc' type='xs:string' minOccurs='0'/>
+ </xs:sequence>
+ <xs:attribute name='sid' type='xs:string' use='optional'/>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-oob.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,43 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:pass'
+ xmlns='jabber:iq:pass'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0003: http://www.jabber.org/jeps/jep-0003.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:choice minOccurs='0' maxOccurs='unbounded'>
+ <xs:element name='client' type='PassEntity'/>
+ <xs:element name='close' type='empty'/>
+ <xs:element name='expire' type='xs:unsignedLong'/>
+ <xs:element name='oneshot' type='empty'/>
+ <xs:element name='proxy' type='PassEntity'/>
+ <xs:element name='server' type='PassEntity'/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name='PassEntity'>
+ <xs:simpleContent>
+ <xs:extension base='xs:NMTOKEN'>
+ <xs:attribute name='port' type='xs:short' use='optional'/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:simpleType name='empty'>
+ <xs:restriction base='xs:string'>
+ <xs:enumeration value=''/>
+ </xs:restriction>
+ </xs:simpleType>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-pass.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,24 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:private'
+ xmlns='jabber:iq:private'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0049: http://www.jabber.org/jeps/jep-0049.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:sequence minOccurs='0'>
+ <xs:any namespace='##other'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-private.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd
URL: http://svn.apache.org/viewvc/incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd?view=auto&rev=467379
==============================================================================
--- incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd (added)
+++ incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd Tue Oct 24 09:48:24 2006
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<xs:schema
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ targetNamespace='jabber:iq:time'
+ xmlns='jabber:iq:time'
+ elementFormDefault='qualified'>
+
+ <xs:annotation>
+ <xs:documentation>
+ The protocol documented by this schema is defined in
+ JEP-0090: http://www.jabber.org/jeps/jep-0090.html
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name='query'>
+ <xs:complexType>
+ <xs:sequence minOccurs='0'>
+ <xs:element name='utc' type='xs:string' minOccurs='1'/>
+ <xs:element name='tz' type='xs:string' minOccurs='0'/>
+ <xs:element name='display' type='xs:string' minOccurs='0'/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: incubator/activemq/sandbox/activemq-xmpp/src/main/resources/iq-time.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml