You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2006/06/12 18:09:25 UTC

svn commit: r413697 [4/4] - in /webservices/muse/trunk/modules/muse-wsn: specs/ src/org/apache/muse/ws/notification/ src/org/apache/muse/ws/notification/faults/ src/org/apache/muse/ws/notification/impl/ src/org/apache/muse/ws/notification/properties/ s...

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/Topic.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/Topic.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/Topic.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/Topic.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,101 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics;
+
+import java.util.Collection;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.muse.util.xml.XmlSerializable;
+import org.apache.muse.ws.notification.NotificationMessage;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+public interface Topic extends XmlSerializable
+{
+    void addMessageType(QName messageType);
+
+    void addTopic(Topic childTopic) 
+        throws BaseFault;
+    
+    /**
+     *
+     * @return A fully-qualified name for the SimpleTopic, which can be used 
+     *         in WS-N requests.
+     *
+     */
+    QName getConcretePath();
+
+    /**
+     *
+     * @return The last message published to this SimpleTopic (via publish()).
+     *
+     */
+    NotificationMessage getCurrentMessage();
+
+    /**
+     *
+     * @return An XPath that further expresses the types of messages 
+     *         this topic publishes.
+     *
+     */
+    String getMessagePattern();
+
+    /**
+     *
+     * @return The XPath 1.0 namespace.
+     *
+     */
+    String getMessagePatternDialect();
+
+    Set getMessageTypes();
+
+    String getName();
+
+    /**
+     *
+     * @return The SimpleTopic's parent SimpleTopic, or null if it is a root SimpleTopic.
+     *
+     */
+    Topic getParentTopic();
+
+    Topic getTopic(String topicName);
+
+    Collection getTopics();
+
+    TopicNamespace getTopicNamespace();
+
+    boolean hasTopic(String topicName);
+
+    boolean isFinal();
+
+    boolean isRootTopic();
+
+    void removeAllTopics();
+
+    void removeMessageType(QName messageType);
+
+    void removeTopic(String topicName);
+
+    void setFinal(boolean isFinal);
+
+    void setMessagePattern(String messagePattern);
+
+    void setParentTopic(Topic parentTopic) 
+        throws BaseFault;
+
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicNamespace.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicNamespace.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicNamespace.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicNamespace.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,45 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics;
+
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.muse.util.xml.XmlSerializable;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+public interface TopicNamespace extends XmlSerializable
+{
+    void addTopic(Topic topic) 
+        throws BaseFault;
+
+    String getName();
+
+    Collection getRootTopics();
+
+    Iterator iterator();
+
+    String getTargetNamespace();
+
+    Topic getTopic(String topicName);
+
+    boolean hasTopic(String topicName);
+
+    void removeTopic(String topicName);
+
+    void setName(String name);
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicPathExpression.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicPathExpression.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicPathExpression.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicPathExpression.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,68 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics;
+
+import java.util.ListIterator;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ *
+ * TopicPathExpression represents a qualified path that can be resolved 
+ * to a topic that is published by a resource. Once the expression has 
+ * been created, the resolve() method can be used to find a topic rather 
+ * than searching through the resource's collection manually.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public interface TopicPathExpression
+{
+    /**
+     *
+     * @return That path that will be resolved by this expression.
+     *
+     */
+    QName getTopicPath();
+
+    /**
+     *
+     * @return The SimpleTopicNamespace against which the path will be resolved.
+     *
+     */
+    TopicNamespace getTopicSpace();
+
+    /**
+     *
+     * @return An iterator that allows the user to view each section of 
+     *         the topic path (the strings in between each '/').
+     *
+     */
+    ListIterator iterator();
+
+    /**
+     * 
+     * Evaluates the topic path and finds the SimpleTopic it represents.
+     *
+     * @return The SimpleTopic that is represented by the path, or null if no 
+     *         such SimpleTopic exists.
+     *
+     */
+    Topic resolve();
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicSet.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicSet.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicSet.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/TopicSet.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,34 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics;
+
+import java.util.Collection;
+
+import org.apache.muse.util.xml.XmlSerializable;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+public interface TopicSet extends XmlSerializable
+{
+    void addTopicNamespace(TopicNamespace topicSpace) 
+        throws BaseFault;
+
+    Collection getTopicNamespaceURIs();
+
+    TopicNamespace getTopicNamespace(String namespace);
+
+    void removeTopicNamespace(String namespace);
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/WstConstants.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/WstConstants.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/WstConstants.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/WstConstants.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,67 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics;
+
+import javax.xml.namespace.QName;
+
+import org.apache.muse.ws.notification.topics.impl.SimpleTopicNamespace;
+
+/**
+ *
+ * WstConstants is a collection of properties and methods that is useful when 
+ * programming against the WS-Topics spec. This class uses WS-T v1.2, draft 01.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class WstConstants
+{
+    public static final String NAMESPACE_URI = "http://docs.oasis-open.org/wsn/t-1";
+        
+    public static final String PREFIX = "wst";
+    
+    public static final String CONCRETE_TOPIC_URI = NAMESPACE_URI + "/TopicExpression/Concrete";
+    
+    public static final String FULL_TOPIC_URI = NAMESPACE_URI + "/TopicExpression/Full";
+        
+    public static final String SIMPLE_TOPIC_URI = NAMESPACE_URI + "/TopicExpression/Simple";
+    
+    public static final QName TOPIC_NAMESPACE_QNAME = 
+        new QName(NAMESPACE_URI, "TopicNamespace", PREFIX);
+    
+    public static final QName TOPIC_QNAME = 
+        new QName(NAMESPACE_URI, "Topic", PREFIX);
+    
+    public static final QName TOPIC_SET_QNAME = 
+        new QName(NAMESPACE_URI, "TopicSet", PREFIX);
+    
+    public static final QName PATTERN_QNAME = 
+        new QName(NAMESPACE_URI, "MessagePattern", PREFIX);
+
+    public static final String DIALECT = "dialect";
+    public static final String FINAL = "final";
+    public static final String MESSAGE_TYPES = "messageTypes";
+    
+    /**
+     * 
+     * The curious ad-hoc TopicNamespace. It's the ultimate dream for fans 
+     * of xsd:any and query dialects.
+     * 
+     */
+    public static final TopicNamespace AD_HOC = new SimpleTopicNamespace(NAMESPACE_URI + "/adHoc");
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/ConcretePathExpression.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,292 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics.impl;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.ListIterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.notification.faults.InvalidTopicExpressionFault;
+import org.apache.muse.ws.notification.topics.Topic;
+import org.apache.muse.ws.notification.topics.TopicPathExpression;
+import org.apache.muse.ws.notification.topics.TopicNamespace;
+import org.apache.muse.ws.notification.topics.TopicSet;
+
+/**
+ *
+ * ConcretePathExpression allows users to evaluate simple and concrete 
+ * topic expressions, as defined by WS-Topics 1.2 draft 03. This class 
+ * cannot evaluate paths with wildcards ('full' expressions).
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class ConcretePathExpression implements TopicPathExpression
+{
+    private static Messages _MESSAGES = MessagesFactory.get(ConcretePathExpression.class);
+    
+    private TopicNamespace _topicSpace = null;
+    
+    private QName _topicPath = null;
+    
+    public ConcretePathExpression(TopicNamespace topicSpace, QName topicPath)
+        throws InvalidTopicExpressionFault
+    {
+        if (topicSpace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpace"));
+
+        if (topicPath == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicPath"));
+        
+        _topicSpace = topicSpace;
+        _topicPath = topicPath;
+
+        String topicNS = topicPath.getNamespaceURI();
+        String targetNS = _topicSpace.getTargetNamespace();
+        
+        if (!targetNS.equals(topicNS))
+        {
+            Object[] filler = { topicNS, targetNS };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidTopicNS", filler));
+        }
+        
+        validateTopicPath(_topicPath);
+    }
+    
+    public ConcretePathExpression(TopicSet topics, QName topicPath)
+        throws InvalidTopicExpressionFault
+    {
+        if (topics == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpaceForest"));
+        
+        if (topicPath == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicPath"));
+        
+        _topicPath = topicPath;
+        
+        String uri = _topicPath.getNamespaceURI();
+        _topicSpace = topics.getTopicNamespace(uri);
+        
+        if (_topicSpace == null)
+        {
+            Object[] filler = { uri };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidTopicSpaceNS", filler));
+        }
+
+        String topicNS = topicPath.getNamespaceURI();
+        String targetNS = _topicSpace.getTargetNamespace();
+        
+        if (!targetNS.equals(topicNS))
+        {
+            Object[] filler = { topicNS, targetNS };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidTopicNS", filler));
+        }
+        
+        validateTopicPath(_topicPath);
+    }
+    
+    public ConcretePathExpression(Topic topic)
+    {
+        if (topic == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopic"));
+        
+        _topicSpace = topic.getTopicNamespace();
+        _topicPath = createTopicPath(_topicSpace, topic);
+    }
+    
+    private QName createTopicPath(TopicNamespace topicSpace, Topic topic)
+    {
+        String namespace = topicSpace.getTargetNamespace();
+        
+        LinkedList nodes = new LinkedList();
+        
+        String name = topic.getName();
+        int totalSize = name.length();
+        nodes.add(name);
+        
+        Topic parent = topic.getParentTopic();
+        
+        while (parent != null)
+        {
+            name = parent.getName();
+            totalSize += name.length();
+            
+            nodes.addFirst(name);
+            parent = parent.getParentTopic();
+        }
+        
+        StringBuffer buffer = new StringBuffer(totalSize);
+        Iterator i = nodes.iterator();
+        
+        while (i.hasNext())
+        {
+            buffer.append(i.next());
+            
+            if (i.hasNext())
+                buffer.append('/');
+        }
+        
+        return new QName(namespace, buffer.toString(), "topic");
+    }
+    
+    public static void validateTopicPath(QName topicPath) 
+        throws InvalidTopicExpressionFault
+    {        
+        String unqualifiedPath = topicPath.getLocalPart();
+        
+        if (unqualifiedPath.indexOf('*') >= 0 || 
+            unqualifiedPath.indexOf("//") >= 0)
+        {
+            Object[] filler = { XmlUtils.toString(topicPath) };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidConcretePath", filler));
+        }
+    }
+    
+    public QName getTopicPath()
+    {
+        return _topicPath;
+    }
+        
+    public TopicNamespace getTopicSpace()
+    {
+        return _topicSpace;
+    }
+    
+    public ListIterator iterator()
+    {
+        String[] nodes = _topicPath.getLocalPart().split("/");
+        return new ConcretePathIterator(_topicSpace, nodes);
+    }
+    
+    public Topic resolve()
+    {
+        //
+        // all we have to do is use a ConcretePathIterator to move 
+        // through the path; if we can get through each node with 
+        // the iterator without hitting a dead end (no topic), then 
+        // we have found a match
+        //
+        
+        ListIterator i = iterator();
+        Topic topic = null;
+        
+        while (i.hasNext())
+        {
+            topic = (Topic)i.next();
+            
+            if (topic == null)
+                return null;
+        }
+        
+        return topic;
+    }
+
+    /**
+     *
+     * ConcretePathIterator is an internal class that allows us to 
+     * move back and forth between nodes in a topic path. Each 
+     * node is one of the strings between the '/' characters in 
+     * the path.
+     *
+     * @author Dan Jemiolo (danj)
+     *
+     */
+    class ConcretePathIterator implements ListIterator
+    {
+        private TopicNamespace _root = null;
+        private Topic _currentTopic = null;
+        
+        private String[] _nodes = null;
+        private int _currentNode = 0;
+        
+        public ConcretePathIterator(TopicNamespace root, String[] nodes)
+        {
+            _root = root;
+            _nodes = nodes;
+        }
+        
+        public void add(Object item)
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public boolean hasNext()
+        {
+            return _currentNode < _nodes.length;
+        }
+        
+        public boolean hasPrevious()
+        {
+            return _currentNode > 0;
+        }
+
+        public Object next()
+        {
+            if (!hasNext())
+                throw new IllegalStateException();
+            
+            String name = _nodes[_currentNode++];
+            
+            //
+            // special case - if we're at the beginning, we have 
+            // to get the first topic from the SimpleTopicNamespace
+            //
+            if (_currentTopic == null)
+                _currentTopic = _root.getTopic(name);
+            
+            else
+                _currentTopic = _currentTopic.getTopic(name);
+            
+            return _currentTopic;
+        }
+        
+        public int nextIndex()
+        {
+            return _currentNode;
+        }
+        
+        public Object previous()
+        {
+            if (!hasPrevious())
+                throw new IllegalStateException();
+            
+            --_currentNode;
+            return _currentTopic.getParentTopic();
+        }
+        
+        public int previousIndex()
+        {
+            return _currentNode - 1;
+        }
+
+        public void remove()
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public void set(Object item)
+        {
+            throw new UnsupportedOperationException();
+        }
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/Messages.properties
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/Messages.properties?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/Messages.properties (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/Messages.properties Mon Jun 12 09:09:23 2006
@@ -0,0 +1,21 @@
+NoTopicName = There topic XML has no name attribute. Every topic must have a name.
+InvalidTopicNS = The topic's namespace - XXX - does not match that of its topic space - XXX. A topic must have the same namespace as its parent topic space.
+InvalidConcretePath = The value 'XXX' is not a concrete topic path as defined by WS-Topics. Only simple and concrete topic paths are supported.
+InvalidTopicSpaceNS = There is no topic space that has the namespace 'XXX'. 
+NoTopicSpaceNS = The topic space XML has no targetNamespace attribute. Every topic space must have a unique target namespace.
+NoNewTopics = The topic 'XXX' is final - it cannot have any more sub-topics.
+SubTopicExists = There is already a sub-topic named 'XXX' in the topic 'XXX'.
+TopicExists = There is already a topic named 'XXX' in the topic space for 'XXX'.
+TopicSpaceNSExists = There is already a topic space with the namespace 'XXX'. Each topic space in a resource must have a unique namespace.
+NullTopicSpace = The TopicSpace is null.
+NullTopicPath = The QName with the topic path is null.
+NullTopicSpaceForest = The TopicSpaceForest is null.
+NullTopic = The Topic is null.
+NullTopicElement = The DOM Element representing the Topic is null.
+NullTopicName = The topic name is null.
+NullTargetNS = The target namespace is null.
+NullMessageType = The QName with the messageType value is null.
+NullSubscription = The Subscription is null.
+MustBeRootTopic = A Topic must be a root topic (have no parent topic) to set the topic space. Setting the topic space will affect all child topics, and child topics cannot have different topic spaces than their parents.
+NullDocument = The DOM Document is null.
+NullTopicSpaceElement = The DOM Element representing the TopicSpace is null.

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopic.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,430 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XPathUtils;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.util.xml.XsdUtils;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+import org.apache.muse.ws.notification.NotificationMessage;
+import org.apache.muse.ws.notification.faults.InvalidTopicExpressionFault;
+import org.apache.muse.ws.notification.topics.Topic;
+import org.apache.muse.ws.notification.topics.TopicPathExpression;
+import org.apache.muse.ws.notification.topics.TopicNamespace;
+import org.apache.muse.ws.notification.topics.WstConstants;
+
+/**
+ *
+ * SimpleTopic is a representation of the WS-Topics SimpleTopic type. It is responsible 
+ * for managing all sub-topics (its topic tree) as well as the subscriptions 
+ * that have been made against the topic. Whenever a resource publishes a 
+ * message to a SimpleTopic, it must record the message and then send it out to 
+ * all of the subscribers. This class is used by all resources that implement 
+ * {@linkplain org.apache.muse.ws.notification.NotificationProducer NotificationProducer} 
+ * to actually send messages to subscribers.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class SimpleTopic implements Topic
+{
+    private static Messages _MESSAGES = MessagesFactory.get(SimpleTopic.class);
+    
+    private Map _childTopics = new LinkedHashMap();
+    
+    private NotificationMessage _currentMessage = null;
+    
+    private boolean _isFinal = false;
+    
+    private String _messagePattern = null;
+
+    private Set _messageTypes = new HashSet();
+
+    private String _name = null;
+    
+    private Topic _parentTopic = null;
+    
+    private TopicNamespace _topicSpace = null;
+    
+    public SimpleTopic(Element root, TopicNamespace topicSpace)
+        throws InvalidTopicExpressionFault, BaseFault
+    {
+        if (root == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicElement"));
+        
+        if (topicSpace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpace"));
+
+        _topicSpace = topicSpace;
+        
+        _name = root.getAttribute(XsdUtils.NAME);
+        
+        if (_name == null || _name.length() == 0)
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("NoTopicName"));
+        
+        String finalValue = root.getAttribute(WstConstants.FINAL);
+        
+        if (finalValue != null && finalValue.length() > 0)
+            _isFinal = Boolean.valueOf(finalValue).booleanValue();
+        
+        String messageTypesValue = root.getAttribute(WstConstants.MESSAGE_TYPES);
+        
+        if (messageTypesValue != null && messageTypesValue.length() > 0)
+        {
+            String[] values = messageTypesValue.split(" ");
+            
+            for (int n = 0; n < values.length; ++n)
+            {
+                QName qname = XmlUtils.parseQName(values[n], root);
+                _messageTypes.add(qname);
+            }
+        }
+        
+        _messagePattern = XmlUtils.getElementText(root, WstConstants.PATTERN_QNAME);
+        
+        Element[] children = XmlUtils.getElements(root, WstConstants.TOPIC_QNAME);
+        
+        for (int n = 0; n < children.length; ++n)
+        {
+            SimpleTopic topic = new SimpleTopic(children[n], topicSpace);
+            addTopicEvenIfFinal(topic);
+        }
+    }
+    
+    public SimpleTopic(String name, TopicNamespace topicSpace)
+        throws BaseFault
+    {
+        if (name == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicName"));
+        
+        if (topicSpace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpace"));
+        
+        _topicSpace = topicSpace;
+        
+        int slash = name.indexOf('/');
+        int end = slash >= 0 ? slash : name.length();
+        _name = name.substring(0, end);
+                
+        if (end < name.length())
+        {
+            String childName = name.substring(end + 1);
+            addTopic(new SimpleTopic(childName, topicSpace));
+        }
+    }
+    
+    public synchronized final void addMessageType(QName messageType)
+    {
+        if (messageType == null)
+            throw new NullPointerException(_MESSAGES.get("NullMessageType"));
+        
+        _messageTypes.add(messageType);
+    }
+    
+    public synchronized final void addTopic(Topic childTopic) 
+        throws InvalidTopicExpressionFault, BaseFault
+    {
+        if (childTopic == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopic"));
+        
+        if (isFinal())
+        {
+            Object[] filler = { getConcretePath() };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("NoNewTopics", filler));
+        }
+        
+        addTopicEvenIfFinal(childTopic);
+    }
+    
+    private void addTopicEvenIfFinal(Topic childTopic) 
+        throws InvalidTopicExpressionFault, BaseFault
+    {
+        String name = childTopic.getName();
+        
+        if (_childTopics.containsKey(name))
+        {
+            Object[] filler = { name, getConcretePath() };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("SubTopicExists", filler));
+        }
+        
+        String topicNS = childTopic.getTopicNamespace().getTargetNamespace();
+        String targetNS = getTopicNamespace().getTargetNamespace();
+        
+        if (!targetNS.equals(topicNS))
+        {
+            Object[] filler = { topicNS, targetNS };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidTopicNS", filler));
+        }
+        
+        childTopic.setParentTopic(this);
+        
+        _childTopics.put(name, childTopic);
+    }
+    
+    public synchronized boolean equals(Object obj)
+    {
+        if (obj == null)
+            return false;
+        
+        Topic that = (Topic)obj;
+        
+        if (!getName().equals(that.getName()))
+            return false;
+        
+        String thisNS = getTopicNamespace().getTargetNamespace();
+        String thatNS = that.getTopicNamespace().getTargetNamespace();
+        
+        if (!thisNS.equals(thatNS))
+            return false;
+        
+        if (!getConcretePath().equals(that.getConcretePath()))
+            return false;
+
+        if (isFinal() != that.isFinal())
+            return false;
+        
+        String thisPattern = getMessagePattern();
+        String thatPattern = that.getMessagePattern();
+        
+        if (thisPattern != null)
+            return thisPattern.equals(thatPattern);
+        
+        return thatPattern == null;
+    }
+    
+    /**
+     *
+     * @return A fully-qualified name for the SimpleTopic, which can be used 
+     *         in WS-N requests.
+     *
+     */
+    public synchronized QName getConcretePath()
+    {
+        TopicPathExpression path = new ConcretePathExpression(this);
+        return path.getTopicPath();
+    }
+    
+    /**
+     *
+     * @return The last message published to this SimpleTopic (via publish()).
+     *
+     */
+    public synchronized NotificationMessage getCurrentMessage()
+    {
+        return _currentMessage;
+    }
+    
+    /**
+     *
+     * @return An XPath that further expresses the types of messages 
+     *         this topic publishes.
+     *
+     */
+    public synchronized String getMessagePattern()
+    {
+        return _messagePattern;
+    }
+    
+    /**
+     *
+     * @return The XPath 1.0 namespace.
+     *
+     */
+    public String getMessagePatternDialect()
+    {
+        return XPathUtils.NAMESPACE_URI;
+    }
+    
+    public Set getMessageTypes()
+    {
+        return Collections.unmodifiableSet(_messageTypes);
+    }
+    
+    public final String getName()
+    {
+        return _name;
+    }
+    
+    /**
+     *
+     * @return The SimpleTopic's parent SimpleTopic, or null if it is a root SimpleTopic.
+     *
+     */
+    public synchronized Topic getParentTopic()
+    {
+        return _parentTopic;
+    }
+    
+    public synchronized Topic getTopic(String topicName)
+    {
+        return (Topic)_childTopics.get(topicName);
+    }
+    
+    public synchronized Collection getTopics()
+    {
+        return Collections.unmodifiableCollection(_childTopics.values());
+    }
+    
+    public synchronized TopicNamespace getTopicNamespace()
+    {
+        return _topicSpace;
+    }
+    
+    public synchronized int hashCode()
+    {
+        String pattern = getMessagePattern();
+        String ns = getTopicNamespace().getTargetNamespace();
+        
+        return getName().hashCode() + 
+               ns.hashCode() + 
+               getConcretePath().hashCode() + 
+               ( isFinal() ? 1 : 0 ) + 
+               ( pattern == null ? 0 : pattern.hashCode());
+    }
+    
+    public synchronized boolean hasTopic(String topicName)
+    {
+        return getTopic(topicName) != null;
+    }
+    
+    public synchronized boolean isFinal()
+    {
+        return _isFinal;
+    }
+    
+    public synchronized boolean isRootTopic()
+    {
+        return getParentTopic() == null;
+    }
+    
+    public synchronized final void removeAllTopics()
+    {
+        _childTopics.clear();
+    }
+    
+    public synchronized final void removeMessageType(QName messageType)
+    {
+        if (messageType == null)
+            throw new NullPointerException(_MESSAGES.get("NullMessageType"));
+        
+        _messageTypes.remove(messageType);
+    }
+    
+    public synchronized final void removeTopic(String topicName)
+    {
+        if (topicName == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicName"));
+        
+        _childTopics.remove(topicName);
+    }
+    
+    public synchronized void setFinal(boolean isFinal)
+    {
+        _isFinal = isFinal;
+    }
+    
+    public synchronized void setMessagePattern(String messagePattern)
+    {
+        _messagePattern = messagePattern;
+    }
+    
+    public synchronized void setParentTopic(Topic parentTopic)
+    {
+        _parentTopic = parentTopic;
+    }
+    
+    public synchronized String toString()
+    {
+        return XmlUtils.toString(toXML(), false);
+    }
+    
+    public synchronized Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+    
+    public synchronized Element toXML(Document doc)
+    {
+        if (doc == null)
+            throw new NullPointerException(_MESSAGES.get("NullDocument"));
+        
+        Element root = XmlUtils.createElement(doc, WstConstants.TOPIC_QNAME);
+        
+        root.setAttribute(XsdUtils.NAME, getName());
+        root.setAttribute(XmlUtils.TARGET_NS, getTopicNamespace().getTargetNamespace());
+        root.setAttribute(WstConstants.FINAL, Boolean.toString(isFinal()));
+        
+        String pattern = getMessagePattern();
+        
+        if (pattern != null)
+        {
+            Element patternXML = 
+                XmlUtils.createElement(doc, WstConstants.PATTERN_QNAME, pattern);
+            root.appendChild(patternXML);
+            
+            patternXML.setAttribute(WstConstants.DIALECT, XPathUtils.NAMESPACE_URI);
+        }
+        
+        Set messageTypes = getMessageTypes();
+        
+        if (!messageTypes.isEmpty())
+        {
+            Iterator i = messageTypes.iterator();
+            
+            int size = messageTypes.size();
+            StringBuffer buffer = new StringBuffer(size * 128);
+            
+            for (int n = 1; i.hasNext(); ++n)
+            {
+                QName messageName = (QName)i.next();
+                buffer.append(XmlUtils.toString(messageName));
+                
+                if (n != size)
+                    buffer.append(' ');
+            }
+            
+            root.setAttribute(WstConstants.MESSAGE_TYPES, buffer.toString());
+        }
+        
+        Iterator i = getTopics().iterator();
+        
+        while (i.hasNext())
+        {
+            Topic topic = (Topic)i.next();
+            Element topicXML = topic.toXML(doc);
+            root.appendChild(topicXML);
+        }
+        
+        return root;
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicNamespace.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,210 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.util.xml.XsdUtils;
+import org.apache.muse.ws.notification.faults.InvalidTopicExpressionFault;
+import org.apache.muse.ws.notification.topics.Topic;
+import org.apache.muse.ws.notification.topics.TopicNamespace;
+import org.apache.muse.ws.notification.topics.WstConstants;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+
+/**
+ *
+ * SimpleTopicNamespace is a representation of the WS-Topics SimpleTopicNamespace type. It 
+ * contains a set of topic trees that all have the same namespace. Users 
+ * can evaluate topic path expressions against TopicSpaces to find out if 
+ * a SimpleTopic is published by a resource.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class SimpleTopicNamespace implements TopicNamespace
+{
+    private static Messages _MESSAGES = MessagesFactory.get(SimpleTopicNamespace.class);
+    
+    private String _name = null;
+
+    private Map _rootTopics = new LinkedHashMap();
+    
+    private String _targetNamespace = null;
+    
+    public SimpleTopicNamespace(Element root)
+        throws BaseFault
+    {
+        if (root == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpaceElement"));
+        
+        _targetNamespace = root.getAttribute(XmlUtils.TARGET_NS);
+        
+        if (_targetNamespace == null)
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("NoTopicSpaceNS"));
+        
+        _name = root.getAttribute(XsdUtils.NAME);
+        
+        Element[] children = XmlUtils.getElements(root, WstConstants.TOPIC_QNAME);
+        
+        for (int n = 0; n < children.length; ++n)
+        {
+            Topic topic = new SimpleTopic(children[n], this);
+            addTopic(topic);
+        }
+    }
+    
+    public SimpleTopicNamespace(String targetNamespace)
+    {
+        if (targetNamespace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTargetNS"));
+        
+        _targetNamespace = targetNamespace;
+    }
+    
+    public synchronized final void addTopic(Topic topic)
+        throws BaseFault
+    {
+        if (topic == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopic"));
+        
+        String name = topic.getName();
+        
+        if (_rootTopics.containsKey(name))
+        {
+            Object[] filler = { name, getTargetNamespace() };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("TopicExists", filler));
+        }
+        
+        TopicNamespace topicSpace = topic.getTopicNamespace();
+        
+        if (topicSpace != this)
+        {
+            Object[] filler = { topicSpace.getTargetNamespace(), getTargetNamespace() };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("InvalidTopicNS", filler));
+        }
+        
+        _rootTopics.put(name, topic);
+    }
+    
+    public boolean equals(Object obj)
+    {
+        if (obj == null)
+            return false;
+        
+        TopicNamespace that = (TopicNamespace)obj;
+        return getTargetNamespace().equals(that.getTargetNamespace());
+    }
+    
+    public static TopicNamespace getAdHocTopicSpace()
+    {
+        return WstConstants.AD_HOC;
+    }
+    
+    public synchronized final String getName()
+    {
+        return _name;
+    }
+
+    public synchronized final Collection getRootTopics()
+    {
+        return Collections.unmodifiableCollection(_rootTopics.values());
+    }
+    
+    public synchronized final Iterator iterator()
+    {
+        return getRootTopics().iterator();
+    }
+    
+    public synchronized final String getTargetNamespace()
+    {
+        return _targetNamespace;
+    }
+
+    public synchronized final Topic getTopic(String topicName)
+    {
+        return (Topic)_rootTopics.get(topicName);
+    }
+    
+    public int hashCode()
+    {
+        return getTargetNamespace().hashCode();
+    }
+    
+    public synchronized final boolean hasTopic(String topicName)
+    {
+        return getTopic(topicName) != null;
+    }
+    
+    public synchronized final void removeTopic(String topicName)
+    {
+        if (topicName == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicName"));
+        
+        _rootTopics.remove(topicName);
+    }
+    
+    public synchronized final void setName(String name)
+    {
+        _name = name;
+    }
+    
+    public synchronized String toString()
+    {
+        return XmlUtils.toString(toXML(), false);
+    }
+    
+    public synchronized Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+    
+    public synchronized Element toXML(Document doc)
+    {
+        if (doc == null)
+            throw new NullPointerException(_MESSAGES.get("NullDocument"));
+        
+        Element topicSpace = XmlUtils.createElement(doc, WstConstants.TOPIC_NAMESPACE_QNAME);
+        topicSpace.setAttribute(XmlUtils.TARGET_NS, getTargetNamespace());
+        
+        String name = getName();
+        
+        if (name != null)
+            topicSpace.setAttribute(XsdUtils.NAME, name);
+        
+        Iterator i = getRootTopics().iterator();
+        
+        while (i.hasNext())
+        {
+            SimpleTopic topic = (SimpleTopic)i.next();
+            Element topicXML = topic.toXML(doc);
+            topicSpace.appendChild(topicXML);
+        }
+        
+        return topicSpace;
+    }
+}

Added: webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java?rev=413697&view=auto
==============================================================================
--- webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java (added)
+++ webservices/muse/trunk/modules/muse-wsn/src/org/apache/muse/ws/notification/topics/impl/SimpleTopicSet.java Mon Jun 12 09:09:23 2006
@@ -0,0 +1,103 @@
+/*=============================================================================*
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *=============================================================================*/
+
+package org.apache.muse.ws.notification.topics.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.muse.util.messages.Messages;
+import org.apache.muse.util.messages.MessagesFactory;
+import org.apache.muse.util.xml.XmlUtils;
+import org.apache.muse.ws.notification.faults.InvalidTopicExpressionFault;
+import org.apache.muse.ws.notification.topics.TopicNamespace;
+import org.apache.muse.ws.notification.topics.TopicSet;
+import org.apache.muse.ws.notification.topics.WstConstants;
+import org.apache.muse.ws.resource.basefaults.BaseFault;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ *
+ * SimpleTopicSet is a top-level container that keeps all of a 
+ * resource's topic spaces sorted by their namespaces.
+ *
+ * @author Dan Jemiolo (danj)
+ *
+ */
+
+public class SimpleTopicSet implements TopicSet
+{
+    //
+    // Used to lookup all exception messages
+    //
+    private static Messages _MESSAGES = 
+        MessagesFactory.get(SimpleTopicSet.class);
+    
+    private Map _topicSpacesByNS = new HashMap();
+    
+    public synchronized final void addTopicNamespace(TopicNamespace topicSpace)
+        throws BaseFault
+    {
+        if (topicSpace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTopicSpace"));
+
+        String namespace = topicSpace.getTargetNamespace();
+        
+        if (_topicSpacesByNS.keySet().contains(namespace))
+        {
+            Object[] filler = { namespace };
+            throw new InvalidTopicExpressionFault(_MESSAGES.get("TopicSpaceNSExists", filler));
+        }
+        
+        _topicSpacesByNS.put(namespace, topicSpace);
+    }
+    
+    public synchronized final Collection getTopicNamespaceURIs()
+    {
+        return Collections.unmodifiableCollection(_topicSpacesByNS.keySet());
+    }
+    
+    public synchronized final TopicNamespace getTopicNamespace(String namespace)
+    {
+        return (TopicNamespace)_topicSpacesByNS.get(namespace);
+    }
+    
+    public synchronized final void removeTopicNamespace(String namespace)
+    {
+        if (namespace == null)
+            throw new NullPointerException(_MESSAGES.get("NullTargetNS"));
+        
+        _topicSpacesByNS.remove(namespace);
+    }
+
+    public Element toXML()
+    {
+        return toXML(XmlUtils.EMPTY_DOC);
+    }
+
+    public Element toXML(Document factory)
+    {
+        Element root = XmlUtils.createElement(WstConstants.TOPIC_SET_QNAME);
+
+        // FIXME: placeholder - not implemented yet
+        XmlUtils.setElement(root, WstConstants.TOPIC_QNAME, "Placeholder");
+        
+        return root;
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org