ws-pubscribe-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r179824 - in /incubator/hermes/trunk/src/java/org/apache/ws/notification/topics: Topic.java impl/TopicImpl.java util/TopicUtils.java
Date Fri, 03 Jun 2005 16:09:59 GMT
Author: scamp
Date: Fri Jun  3 09:09:58 2005
New Revision: 179824

URL: http://svn.apache.org/viewcvs?rev=179824&view=rev
Log:
update to provide a way to hide topics

Modified:
    incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic.java
    incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
    incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic.java?rev=179824&r1=179823&r2=179824&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/Topic.java Fri Jun 
3 09:09:58 2005
@@ -102,4 +102,5 @@
      */
     TopicSpace getTopicSpace();
 
+    boolean isVisible();
 }

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java?rev=179824&r1=179823&r2=179824&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
(original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/impl/TopicImpl.java
Fri Jun  3 09:09:58 2005
@@ -47,6 +47,7 @@
     private Topic m_parent;
 
     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
@@ -261,6 +262,11 @@
     
     public TopicSpace getTopicSpace() {
         return m_topicSpace;
+    }
+
+    public boolean isVisible()
+    {
+        return m_isVisible;
     }
 
 }

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java?rev=179824&r1=179823&r2=179824&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java
(original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/topics/util/TopicUtils.java
Fri Jun  3 09:09:58 2005
@@ -48,7 +48,7 @@
 {
 
     /**
-     * Adds the topic for ResoruceTermination....there should be only one of these!
+     * Adds the topic for ResourceTermination....there should be only one of these!
      *
      * @param topicSpaceSet
      * @return
@@ -167,7 +167,12 @@
                 Topic topic =  (Topic)iterator.next();
                 String topicName = topic.getName();
                 QName rootTopicQName = new QName(targetNamespace, topicName);
-                addSimpleTopic(rootTopicQName, resourceProperty);
+
+                if (topic.isVisible())
+                {
+                    addSimpleTopic(rootTopicQName, resourceProperty);
+                }
+
                 Iterator subTopics = topic.topicIterator();
                 while (subTopics.hasNext())
                 {
@@ -211,10 +216,13 @@
         TopicDocument topicDocument = TopicDocument.Factory.newInstance();
         String topicName = subTopic.getName();
         QName concreteTopicName = new QName(rootTopicQName.getNamespaceURI(), rootTopicQName.getLocalPart()
+ "/" + topicName);
-        TopicExpressionType topicExpressionType = topicDocument.addNewTopic();
-        topicExpressionType.setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE);
-        XmlBeanUtils.setValueAsQName(topicExpressionType, concreteTopicName);
-        resourceProp.add(topicDocument);
+        if (subTopic.isVisible())
+        {
+            TopicExpressionType topicExpressionType = topicDocument.addNewTopic();
+            topicExpressionType.setDialect(TopicsConstants.TOPIC_EXPR_DIALECT_CONCRETE);
+            XmlBeanUtils.setValueAsQName(topicExpressionType, concreteTopicName);
+            resourceProp.add(topicDocument);
+        }
         Iterator iterator = subTopic.topicIterator();
         while (iterator.hasNext())
         {



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


Mime
View raw message