If I had to choose between the two, I'd say the second (datastucture with URI) ...Making a list whose first element is the namespace, and the rest local names, is not intuitive at all.....
-----Original Message----- From: Samuel Meder [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 12:48 PM To: hermes-dev Subject: Re: svn commit: r155798 -in incubator/hermes/trunk/src/java/org/apache/ws/notification/topics:Topic. java impl/TopicImpl.javaimpl/TopicSpaceImpl.java util/TopicSpaceParser.java On Tue, 2005-03-01 at 18:16 +0100, Stefan Lischke wrote: > Hi sam, > > Samuel Meder wrote: > > >What's the rationale for this interface change? > > > > > its not really a change, its an enhancement. ian changed the topicPath > attribute which was a list of QName in globus to a list of strings, > cause the NameSpace in a TopicExpression never changes. > I added a method to get the TopicSpace of each Topic, so we are able > to get the NameSpace. > > Ok with that? I see. So that list of QNames was supposed to be a self-contained representation that allowed you to find the topic again. With the move away from QName I would suggest that it should either return a list of string with the first string in the list being the namespace or a datastructure with a URI for the namespace and a list of strings for the topic name path in that namespace. Thoughts? /Sam > stefan > > >/Sam > > > >On Tue, 2005-03-01 at 16:07 +0000, [EMAIL PROTECTED] wrote: > > > > > >>Author: lischke > >>Date: Tue Mar 1 08:07:51 2005 > >>New Revision: 155798 > >> > >>URL: http://svn.apache.org/viewcvs?view=rev&rev=155798 > >>Log: > >>added TopicSpace reference to Topic, to get NameSpace > >> > >>Modified: > >> incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic. java > >> incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/T opicImpl.java > >> incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/T opicSpaceImpl.java > >> > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ut > >>il/TopicSpaceParser.java > >> > >>Modified: > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/To > >>pic.java > >>URL: > >>http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/ap > >>ache/ws/notification/topics/Topic.java?view=diff&r1=155797&r2=155798 > >>==================================================================== > >>========== > >>--- > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/To > >>pic.java (original) > >>+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topic > >>+++ s/Topic.java Tue Mar 1 08:07:51 2005 > >>@@ -117,4 +117,18 @@ > >> */ > >> Iterator topicIterator(); > >> > >>+ /** > >>+ * Set the TopicSpace this Topic is part of > >>+ * > >>+ * @param topicSpace The TopicSpace this Topic is part of > >>+ */ > >>+ void setTopicSpace( TopicSpace topicSpace ); > >>+ > >>+ /** > >>+ * gets the TopicSpace this Topic is part of > >>+ * > >>+ * @return The TopicSpace this Topic is part of > >>+ */ > >>+ TopicSpace getTopicSpace(); > >>+ > >> } > >> > >>Modified: > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/im > >>pl/TopicImpl.java > >>URL: > >>http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/ap > >>ache/ws/notification/topics/impl/TopicImpl.java?view=diff&r1=155797& > >>r2=155798 > >>==================================================================== > >>========== > >>--- > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/im > >>pl/TopicImpl.java (original) > >>+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topic > >>+++ s/impl/TopicImpl.java Tue Mar 1 08:07:51 2005 > >>@@ -18,6 +18,7 @@ > >> import org.apache.commons.logging.Log; import > >>org.apache.commons.logging.LogFactory; > >> import org.apache.ws.notification.topics.Topic; > >>+import org.apache.ws.notification.topics.TopicSpace; > >> import org.apache.ws.notification.topics.TopicExpression; > >> import org.apache.ws.notification.topics.TopicListener; > >> > >>@@ -41,6 +42,7 @@ > >> protected String m_name; > >> protected Object m_current; > >> protected List m_topicPath; // ordered set of QNames > >>+ protected TopicSpace m_topicSpace; > >> private static final Log LOG = LogFactory.getLog( > >> TopicImpl.class.getName() ); > >> > >> public void addTopic( Topic topic ) throws Exception @@ -54,12 > >>+56,14 @@ > >> > >> List topicPath = new LinkedList(); > >> > >>- if(m_topicPath!=null) > >>- topicPath.addAll( m_topicPath ); > >>+ topicPath.addAll( m_topicPath ); > >> topicPath.add( topic.getName() ); > >> > >> topic.setTopicPath( topicPath ); > >> topic.addTopicListener( this ); > >>+ > >>+ topic.setTopicSpace(m_topicSpace); > >>+ > >> this.topicAdded( topic ); > >> } > >> > >>@@ -175,7 +179,10 @@ > >> this.m_listeners = listeners; > >> this.m_name = name; > >> this.m_current = current; > >>- this.m_topicPath = topicPath; > >>+ if(topicPath==null){ > >>+ this.m_topicPath = new java.util.LinkedList(); > >>+ m_topicPath.add(name); > >>+ } > >> } > >> > >> public synchronized void topicAdded( Topic topic ) @@ -220,4 > >>+227,12 @@ > >> public String toString(){ > >> return getName(); > >> } > >>+ > >>+ public void setTopicSpace(TopicSpace topicSpace) { > >>+ m_topicSpace=topicSpace; > >>+ } > >>+ > >>+ public TopicSpace getTopicSpace() { > >>+ return m_topicSpace; > >>+ } > >> } > >> > >>Modified: > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/im > >>pl/TopicSpaceImpl.java > >>URL: > >>http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/ap > >>ache/ws/notification/topics/impl/TopicSpaceImpl.java?view=diff&r1=15 > >>5797&r2=155798 > >>==================================================================== > >>========== > >>--- > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/im > >>pl/TopicSpaceImpl.java (original) > >>+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topic > >>+++ s/impl/TopicSpaceImpl.java Tue Mar 1 08:07:51 2005 > >>@@ -52,6 +52,7 @@ > >> public void addTopic( Topic topic ) > >> { > >> m_rootTopicMap.put( topic.getName(), topic ); > >>+ topic.setTopicSpace(this); > >> } > >> > >> public void removeTopic( Topic topic ) > >> > >>Modified: > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ut > >>il/TopicSpaceParser.java > >>URL: > >>http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/ap > >>ache/ws/notification/topics/util/TopicSpaceParser.java?view=diff&r1= > >>155797&r2=155798 > >>==================================================================== > >>========== > >>--- > >>incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/ut > >>il/TopicSpaceParser.java (original) > >>+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topic > >>+++ s/util/TopicSpaceParser.java Tue Mar 1 08:07:51 2005 > >>@@ -28,15 +28,15 @@ > >> // Parse the input with the default (non-validating) parser > >> stack= new java.util.Stack(); > >> try{ > >>- SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); > >>- //System.out.println("start parsing"); > >>- saxParser.parse( is, handler ); > >>- //System.out.println("end parsing"); > >>- > >>+ SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); > >>+ //System.out.println("start parsing"); > >>+ saxParser.parse( is, handler ); > >>+ //System.out.println("end parsing"); > >>+ > >> }catch(Exception e){ > >> e.printStackTrace(); > >> } > >>- return m_topicSpace; > >>+ return m_topicSpace; > >> } > >> > >> public void startElement( String namespaceURI, @@ -44,25 +44,25 > >>@@ > >> String qName, // qualified name > >> Attributes attrs ) throws SAXException { > >> try{ > >>- //System.out.println("start element "+qName); > >>- if(qName.endsWith("topicSpace")){ > >>- tns=attrs.getValue("targetNamespace"); > >>- m_topicSpace=new TopicSpaceImpl(tns); > >>- //System.out.println("topicspace "+tns); > >>- } > >>- if(qName.endsWith("topic")){ > >>- Topic t=new TopicImpl(attrs.getValue("name")); > >>- if(depth==0){ > >>- m_topicSpace.addTopic(t); > >>- stack.push(t); > >>- }else{ > >>- Topic in = (Topic)stack.peek(); > >>- in.addTopic(t); > >>- stack.push(t); > >>- } > >>- //System.out.println(depth+" : "+attrs.getValue("name")); > >>- depth++; > >>- } > >>+ //System.out.println("start element "+qName); > >>+ if(qName.endsWith("topicSpace")){ > >>+ tns=attrs.getValue("targetNamespace"); > >>+ m_topicSpace=new TopicSpaceImpl(tns); > >>+ //System.out.println("topicspace "+tns); > >>+ } > >>+ if(qName.endsWith("topic")){ > >>+ Topic t=new TopicImpl(attrs.getValue("name")); > >>+ if(depth==0){ > >>+ m_topicSpace.addTopic(t); > >>+ stack.push(t); > >>+ }else{ > >>+ Topic in = (Topic)stack.peek(); > >>+ in.addTopic(t); > >>+ stack.push(t); > >>+ } > >>+ //System.out.println(depth+" : "+attrs.getValue("name")); > >>+ depth++; > >>+ } > >> }catch(Exception e){ > >> e.printStackTrace(); > >> } > >>@@ -77,7 +77,7 @@ > >> depth--; > >> stack.pop(); > >> } > >>- > >>- } > >>+ > >>+ } > >> } > >> } > >> > >> > >> > >>-------------------------------------------------------------------- > >>- To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > -- Sam Meder <[EMAIL PROTECTED]> The Globus Alliance - University of Chicago 630-252-1752 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
