You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-commits@ws.apache.org by sc...@apache.org on 2005/07/26 20:41:15 UTC

svn commit: r225372 - in /webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics: TopicSet.java TopicSpaceSet.java impl/SubscriptionTopicListener.java impl/TopicImpl.java impl/TopicSpaceImpl.java impl/TopicSpaceSetImpl.java

Author: scamp
Date: Tue Jul 26 11:41:08 2005
New Revision: 225372

URL: http://svn.apache.org/viewcvs?rev=225372&view=rev
Log:
Handling of TODOs

Modified:
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/SubscriptionTopicListener.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java
    webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceSetImpl.java

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSet.java Tue Jul 26 11:41:08 2005
@@ -26,21 +26,23 @@
     /**
      * Adds the specified topic to this set.
      *
+     * If the Topic already exists it will be overwritten in the underlying Map
+     *
      * @param topic the topic to add
      *
-     * @throws Exception if topic is null or has the same name as a topic already in this set
+     * @throws IllegalStateException if the Reference TopicExpression is already set and someone attempts to add.
      */
-    Topic addTopic( Topic topic ) throws Exception;
+    Topic addTopic( Topic topic );
 
     /**
      * Creates a new Topic object with the specified name and adds it to this set.
      *
+     * If the Topic already exists it will be overwritten in the underlying Map
+     *
      * @param name the name of the topic to add
      *
-     * @throws Exception if name is null, invalid (contains '/', '*', or '.'), or is the same as the name of a topic
-     *                   already in this set
      */
-    Topic addTopic( String name ) throws Exception;
+    Topic addTopic( String name );
 
     /**
      * Removes the topic with the specified name from this set.

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/TopicSpaceSet.java Tue Jul 26 11:41:08 2005
@@ -25,7 +25,16 @@
 public interface TopicSpaceSet
 {
 
-    TopicSpace addTopicSpace( TopicSpace topicSpace ) throws Exception;
+    /**
+     * Adds the TopicSpace to the TopicSpaceSet.
+     *
+     * Note. If the TopiSpace already exists, this method will add all the known Topics
+     * to the passed-in TopicSpace and set it as the current TopicSpace in the TopicSpaceSet.
+     * This will ensure there is only 1 TopicSpace in the set and it is complete...
+     *
+     * @param topicSpace
+     */
+    TopicSpace addTopicSpace( TopicSpace topicSpace );
 
     void removeTopicSpace( String namespaceURI );
 

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/SubscriptionTopicListener.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/SubscriptionTopicListener.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/SubscriptionTopicListener.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/SubscriptionTopicListener.java Tue Jul 26 11:41:08 2005
@@ -258,7 +258,7 @@
             throws Exception
     {
         SOAPFactory factory = SOAPFactory.newInstance();
-        // TODO: this should not be hard-coded to use WSA 2003/03
+        // TODO: *SJC* this should not be hard-coded to use WSA 2003/03. Once a new version of WSN is implemented we will need to support multiple versions
         SOAPHeaderElement headerElem =
                 header.addHeaderElement( factory.createName( org.apache.ws.addressing.v2003_03.AddressingConstants.TO,
                         org.apache.ws.addressing.v2003_03.AddressingConstants.NSPREFIX_ADDRESSING_SCHEMA,
@@ -284,11 +284,13 @@
             boolean hasAnotherChild = cursor.toFirstChild();
             while ( hasAnotherChild )
             {
-                // TODO: the below logic should handle refProps that are complexTypes
+                // TODO: *SJC* the below logic should handle refProps that are complexTypes..
+                // Best way to do may be to build SOAPMessage as XmlBean and use MessageFactory.createMessage(..) to construct using the InputStream
                 SOAPElement soapElem = XmlBeanUtils.toSOAPElement( cursor.getObject() );
                 headerElem = header.addHeaderElement( soapElem.getElementName() );
                 headerElem.addTextNode( soapElem.getValue() );
                 hasAnotherChild = cursor.toNextSibling();
+
             }
             cursor.dispose();
         }

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java Tue Jul 26 11:41:08 2005
@@ -48,12 +48,11 @@
     private static final Log LOG = LogFactory.getLog( TopicImpl.class.getName() );
     protected boolean m_isVisible = true;
 
-    // TODO: throw more specific exceptions
-    public Topic addTopic( Topic topic ) throws Exception
+    public Topic addTopic( Topic topic )
     {
         if ( m_reference != null )
         {
-            throw new Exception( "addingSubTopicToReference" );
+            throw new IllegalStateException( "Cannot modify the TopicExpression reference by adding an additional Topic." );
         }
 
         m_subTopics.put( topic.getName(), topic );
@@ -72,7 +71,7 @@
         return topic;
     }
 
-    public Topic addTopic( String name ) throws Exception
+    public Topic addTopic( String name )
     {
         return addTopic( new TopicImpl( name ) );
     }
@@ -229,7 +228,7 @@
     }
     
     public String toString(){
-        // TODO: make this print the full concrete path of this Topic instead of just its name
+        // TODO: *SJC* make this print the full concrete path of this Topic instead of just its name
         return getName();
     }
     

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceImpl.java Tue Jul 26 11:41:08 2005
@@ -59,7 +59,7 @@
         return topic;
     }
 
-    public Topic addTopic( String name ) throws Exception
+    public Topic addTopic( String name )
     {
         return addTopic( new TopicImpl( name ) );
     }

Modified: webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceSetImpl.java
URL: http://svn.apache.org/viewcvs/webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceSetImpl.java?rev=225372&r1=225371&r2=225372&view=diff
==============================================================================
--- webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceSetImpl.java (original)
+++ webservices/pubscribe/trunk/src/java/org/apache/ws/notification/topics/impl/TopicSpaceSetImpl.java Tue Jul 26 11:41:08 2005
@@ -38,8 +38,7 @@
      *
      * @param topicSpace
      */
-    // TODO: throw more specific exceptions
-    public TopicSpace addTopicSpace(TopicSpace topicSpace) throws Exception
+    public TopicSpace addTopicSpace(TopicSpace topicSpace)
     {
         String namespaceURI = topicSpace.getTargetNamespace();
         //if topicSpace exists, simply add all topics to topicspace